Package org.nuxeo.ecm.directory
Class AbstractDirectory
java.lang.Object
org.nuxeo.ecm.directory.AbstractDirectory
- All Implemented Interfaces:
Directory
- Direct Known Subclasses:
CoreDirectory,LDAPDirectory,MemoryDirectory,MongoDBDirectory,MultiDirectory,SQLDirectory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classConsumer to load data from CSV according to the dataLoadingPolicy. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DirectoryCachefinal BaseDirectoryDescriptorprotected DirectoryFieldMapperprotected final io.dropwizard.metrics5.MetricRegistryprotected final io.dropwizard.metrics5.Counterprotected final io.dropwizard.metrics5.Counterstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDirectory(BaseDirectoryDescriptor descriptor, Class<? extends Reference> referenceClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidaddReference(Reference reference) protected voidvoidaddSession(Session session) protected booleanprotected voidgetCache()Gets the cache instance of the directoryGets the id field of the schema for this directory.getName()Gets the unique name of the directory, used for registering.Gets the name of the parent directory.Gets the password field of the schema for this directory.Lookup all References defined on the directory.getReferences(String referenceFieldName) Lookup the References by field name.Gets the schema name used by this directory.Get schema field mapgetTypes()since @8.4voidINTERNAL, DO NOT CALL.voidINTERNAL, DO NOT CALL.voidINTERNAL, DO NOT CALL.protected voidvoidInvalidate cachesvoidInvalidates the cache instance of the directorybooleanReturnstrueif this directory is a multi tenant directory,falseotherwise.booleanChecks if this directory is read-only.booleanisReference(String referenceFieldName) protected voidloadData()Deprecated.protected voidloadDataOnInit(boolean tableExists) voidloadFromCSV(Blob dataBlob, String dataLoadingPolicy) Loads a CSV into a Directory.makeOrderBy(OrderByList orders) Helper to create an old-style ordering map.protected ReferencevoidorderEntries(List<DocumentModel> entries, Map<String, String> orderBy) Helper method to order entries.voidremoveSession(Session session) voidsetReadOnly(boolean readOnly) voidshutdown()Shuts down the directory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.directory.Directory
createBareDocumentModel, createBareDocumentModel, getDescriptor, getSession
-
Field Details
-
TENANT_ID_FIELD
- See Also:
-
descriptor
-
fieldMapper
-
references
-
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
-
types
-
referenceClass
-
-
Constructor Details
-
AbstractDirectory
protected AbstractDirectory(BaseDirectoryDescriptor descriptor, Class<? extends Reference> referenceClass)
-
-
Method Details
-
doSanityChecks
protected boolean doSanityChecks() -
initialize
public void initialize()Description copied from interface:DirectoryINTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initializein interfaceDirectory
-
loadData
Deprecated.since 11.1, useloadDataOnInit(boolean)instead -
loadDataOnInit
protected void loadDataOnInit(boolean tableExists) -
loadFromCSV
Description copied from interface:DirectoryLoads a CSV into a Directory.- Specified by:
loadFromCSVin interfaceDirectory- See Also:
-
initializeReferences
public void initializeReferences()Description copied from interface:DirectoryINTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initializeReferencesin interfaceDirectory
-
initializeInverseReferences
public void initializeInverseReferences()Description copied from interface:DirectoryINTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initializeInverseReferencesin interfaceDirectory
-
getName
Description copied from interface:DirectoryGets the unique name of the directory, used for registering. -
getSchema
Description copied from interface:DirectoryGets the schema name used by this directory. -
getParentDirectory
Description copied from interface:DirectoryGets the name of the parent directory. This is used for hierarchical vocabularies.- Specified by:
getParentDirectoryin interfaceDirectory- Returns:
- the name of the parent directory, or null.
-
getIdField
Description copied from interface:DirectoryGets the id field of the schema for this directory.- Specified by:
getIdFieldin interfaceDirectory- Returns:
- the id field.
-
getPasswordField
Description copied from interface:DirectoryGets the password field of the schema for this directory.- Specified by:
getPasswordFieldin interfaceDirectory- Returns:
- the password field.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:DirectoryChecks if this directory is read-only.- Specified by:
isReadOnlyin interfaceDirectory
-
setReadOnly
public void setReadOnly(boolean readOnly) -
invalidateCaches
public void invalidateCaches()Description copied from interface:DirectoryInvalidate caches- Specified by:
invalidateCachesin interfaceDirectory
-
getFieldMapper
-
getReferences
Description copied from interface:DirectoryLookup the References by field name.- Specified by:
getReferencesin interfaceDirectory- Returns:
- the matching references implementation or null
-
isReference
-
addReference
-
addReferences
protected void addReferences() -
newReference
-
addInverseReferences
protected void addInverseReferences() -
getReferences
Description copied from interface:DirectoryLookup all References defined on the directory.- Specified by:
getReferencesin interfaceDirectory- Returns:
- all registered references
-
orderEntries
Helper method to order entries.- Parameters:
entries- the list of entries.orderBy- an ordered map of field name -@gt; "asc" or "desc".
-
makeOrderBy
Helper to create an old-style ordering map.- Since:
- 10.3
-
getCache
Description copied from interface:DirectoryGets the cache instance of the directory -
removeSession
-
addSession
-
invalidateDirectoryCache
public void invalidateDirectoryCache()Description copied from interface:DirectoryInvalidates the cache instance of the directory- Specified by:
invalidateDirectoryCachein interfaceDirectory
-
isMultiTenant
public boolean isMultiTenant()Description copied from interface:DirectoryReturnstrueif this directory is a multi tenant directory,falseotherwise.- Specified by:
isMultiTenantin interfaceDirectory
-
shutdown
public void shutdown()Description copied from interface:DirectoryShuts down the directory. -
getTypes
since @8.4 -
getDirectoryDeleteConstraints
- Specified by:
getDirectoryDeleteConstraintsin interfaceDirectory- Since:
- 8.4
-
initSchemaFieldMap
protected void initSchemaFieldMap() -
getSchemaFieldMap
Description copied from interface:DirectoryGet schema field map- Specified by:
getSchemaFieldMapin interfaceDirectory
-
fallbackOnDefaultCache
protected void fallbackOnDefaultCache()
-
loadDataOnInit(boolean)instead