Class AbstractDirectory

java.lang.Object
org.nuxeo.ecm.directory.AbstractDirectory
All Implemented Interfaces:
Directory
Direct Known Subclasses:
CoreDirectory, LDAPDirectory, MemoryDirectory, MongoDBDirectory, MultiDirectory, SQLDirectory

public abstract class AbstractDirectory extends Object implements Directory
  • Field Details

    • TENANT_ID_FIELD

      public static final String TENANT_ID_FIELD
      See Also:
    • descriptor

      public final BaseDirectoryDescriptor descriptor
    • fieldMapper

      protected DirectoryFieldMapper fieldMapper
    • references

      protected final Map<String,List<Reference>> references
    • cache

      protected final DirectoryCache cache
    • registry

      protected final io.dropwizard.metrics5.MetricRegistry registry
    • sessionCount

      protected final io.dropwizard.metrics5.Counter sessionCount
    • sessionMaxCount

      protected final io.dropwizard.metrics5.Counter sessionMaxCount
    • schemaFieldMap

      protected Map<String,Field> schemaFieldMap
    • types

      protected List<String> types
    • referenceClass

      protected Class<? extends Reference> referenceClass
  • Constructor Details

  • Method Details

    • doSanityChecks

      protected boolean doSanityChecks()
    • initialize

      public void initialize()
      Description copied from interface: Directory
      INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.
      Specified by:
      initialize in interface Directory
    • loadData

      @Deprecated(since="11.1") protected void loadData()
      Deprecated.
      since 11.1, use loadDataOnInit(boolean) instead
    • loadDataOnInit

      protected void loadDataOnInit(boolean tableExists)
    • loadFromCSV

      public void loadFromCSV(Blob dataBlob, String dataLoadingPolicy)
      Description copied from interface: Directory
      Loads a CSV into a Directory.
      Specified by:
      loadFromCSV in interface Directory
      See Also:
    • initializeReferences

      public void initializeReferences()
      Description copied from interface: Directory
      INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.
      Specified by:
      initializeReferences in interface Directory
    • initializeInverseReferences

      public void initializeInverseReferences()
      Description copied from interface: Directory
      INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.
      Specified by:
      initializeInverseReferences in interface Directory
    • getName

      public String getName()
      Description copied from interface: Directory
      Gets the unique name of the directory, used for registering.
      Specified by:
      getName in interface Directory
      Returns:
      the unique directory name
    • getSchema

      public String getSchema()
      Description copied from interface: Directory
      Gets the schema name used by this directory.
      Specified by:
      getSchema in interface Directory
      Returns:
      the schema name
    • getParentDirectory

      public String getParentDirectory()
      Description copied from interface: Directory
      Gets the name of the parent directory. This is used for hierarchical vocabularies.
      Specified by:
      getParentDirectory in interface Directory
      Returns:
      the name of the parent directory, or null.
    • getIdField

      public String getIdField()
      Description copied from interface: Directory
      Gets the id field of the schema for this directory.
      Specified by:
      getIdField in interface Directory
      Returns:
      the id field.
    • getPasswordField

      public String getPasswordField()
      Description copied from interface: Directory
      Gets the password field of the schema for this directory.
      Specified by:
      getPasswordField in interface Directory
      Returns:
      the password field.
    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: Directory
      Checks if this directory is read-only.
      Specified by:
      isReadOnly in interface Directory
    • setReadOnly

      public void setReadOnly(boolean readOnly)
    • invalidateCaches

      public void invalidateCaches()
      Description copied from interface: Directory
      Invalidate caches
      Specified by:
      invalidateCaches in interface Directory
    • getFieldMapper

      public DirectoryFieldMapper getFieldMapper()
    • getReferences

      public List<Reference> getReferences(String referenceFieldName)
      Description copied from interface: Directory
      Lookup the References by field name.
      Specified by:
      getReferences in interface Directory
      Returns:
      the matching references implementation or null
    • isReference

      public boolean isReference(String referenceFieldName)
    • addReference

      public void addReference(Reference reference)
    • addReferences

      protected void addReferences()
    • newReference

      protected Reference newReference(ReferenceDescriptor desc)
    • addInverseReferences

      protected void addInverseReferences()
    • getReferences

      public Collection<Reference> getReferences()
      Description copied from interface: Directory
      Lookup all References defined on the directory.
      Specified by:
      getReferences in interface Directory
      Returns:
      all registered references
    • orderEntries

      public void orderEntries(List<DocumentModel> entries, Map<String,String> orderBy)
      Helper method to order entries.
      Parameters:
      entries - the list of entries.
      orderBy - an ordered map of field name -@gt; "asc" or "desc".
    • makeOrderBy

      public static Map<String,String> makeOrderBy(OrderByList orders)
      Helper to create an old-style ordering map.
      Since:
      10.3
    • getCache

      public DirectoryCache getCache()
      Description copied from interface: Directory
      Gets the cache instance of the directory
      Specified by:
      getCache in interface Directory
      Returns:
      the cache of the directory
    • removeSession

      public void removeSession(Session session)
    • addSession

      public void addSession(Session session)
    • invalidateDirectoryCache

      public void invalidateDirectoryCache()
      Description copied from interface: Directory
      Invalidates the cache instance of the directory
      Specified by:
      invalidateDirectoryCache in interface Directory
    • isMultiTenant

      public boolean isMultiTenant()
      Description copied from interface: Directory
      Returns true if this directory is a multi tenant directory, false otherwise.
      Specified by:
      isMultiTenant in interface Directory
    • shutdown

      public void shutdown()
      Description copied from interface: Directory
      Shuts down the directory.
      Specified by:
      shutdown in interface Directory
    • getTypes

      public List<String> getTypes()
      since @8.4
      Specified by:
      getTypes in interface Directory
    • getDirectoryDeleteConstraints

      public List<DirectoryDeleteConstraint> getDirectoryDeleteConstraints()
      Specified by:
      getDirectoryDeleteConstraints in interface Directory
      Since:
      8.4
    • initSchemaFieldMap

      protected void initSchemaFieldMap()
    • getSchemaFieldMap

      public Map<String,Field> getSchemaFieldMap()
      Description copied from interface: Directory
      Get schema field map
      Specified by:
      getSchemaFieldMap in interface Directory
    • fallbackOnDefaultCache

      protected void fallbackOnDefaultCache()