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
Modifier and TypeClassDescriptionprotected static class
Consumer to load data from CSV according to the dataLoadingPolicy. -
Field Summary
Modifier and TypeFieldDescriptionprotected final DirectoryCache
final BaseDirectoryDescriptor
protected DirectoryFieldMapper
protected final io.dropwizard.metrics5.MetricRegistry
protected final io.dropwizard.metrics5.Counter
protected final io.dropwizard.metrics5.Counter
static final String
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDirectory
(BaseDirectoryDescriptor descriptor, Class<? extends Reference> referenceClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
addReference
(Reference reference) protected void
void
addSession
(Session session) protected boolean
protected void
getCache()
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.4void
INTERNAL, DO NOT CALL.void
INTERNAL, DO NOT CALL.void
INTERNAL, DO NOT CALL.protected void
void
Invalidate cachesvoid
Invalidates the cache instance of the directoryboolean
Returnstrue
if this directory is a multi tenant directory,false
otherwise.boolean
Checks if this directory is read-only.boolean
isReference
(String referenceFieldName) protected void
loadData()
Deprecated.protected void
loadDataOnInit
(boolean tableExists) void
loadFromCSV
(Blob dataBlob, String dataLoadingPolicy) Loads a CSV into a Directory.makeOrderBy
(OrderByList orders) Helper to create an old-style ordering map.protected Reference
void
orderEntries
(List<DocumentModel> entries, Map<String, String> orderBy) Helper method to order entries.void
removeSession
(Session session) void
setReadOnly
(boolean readOnly) void
shutdown()
Shuts down the directory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.directory.Directory
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:Directory
INTERNAL, DO NOT CALL. Initializes the directory when Nuxeo starts. Called without a transaction.- Specified by:
initialize
in interfaceDirectory
-
loadData
Deprecated.since 11.1, useloadDataOnInit(boolean)
instead -
loadDataOnInit
protected void loadDataOnInit(boolean tableExists) -
loadFromCSV
Description copied from interface:Directory
Loads a CSV into a Directory.- Specified by:
loadFromCSV
in interfaceDirectory
- 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 interfaceDirectory
-
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 interfaceDirectory
-
getName
Description copied from interface:Directory
Gets the unique name of the directory, used for registering. -
getSchema
Description copied from interface:Directory
Gets the schema name used by this directory. -
getParentDirectory
Description copied from interface:Directory
Gets the name of the parent directory. This is used for hierarchical vocabularies.- Specified by:
getParentDirectory
in interfaceDirectory
- Returns:
- the name of the parent directory, or null.
-
getIdField
Description copied from interface:Directory
Gets the id field of the schema for this directory.- Specified by:
getIdField
in interfaceDirectory
- Returns:
- the id field.
-
getPasswordField
Description copied from interface:Directory
Gets the password field of the schema for this directory.- Specified by:
getPasswordField
in interfaceDirectory
- Returns:
- the password field.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:Directory
Checks if this directory is read-only.- Specified by:
isReadOnly
in interfaceDirectory
-
setReadOnly
public void setReadOnly(boolean readOnly) -
invalidateCaches
public void invalidateCaches()Description copied from interface:Directory
Invalidate caches- Specified by:
invalidateCaches
in interfaceDirectory
-
getFieldMapper
-
getReferences
Description copied from interface:Directory
Lookup the References by field name.- Specified by:
getReferences
in interfaceDirectory
- Returns:
- the matching references implementation or null
-
isReference
-
addReference
-
addReferences
protected void addReferences() -
newReference
-
addInverseReferences
protected void addInverseReferences() -
getReferences
Description copied from interface:Directory
Lookup all References defined on the directory.- Specified by:
getReferences
in 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:Directory
Gets the cache instance of the directory -
removeSession
-
addSession
-
invalidateDirectoryCache
public void invalidateDirectoryCache()Description copied from interface:Directory
Invalidates the cache instance of the directory- Specified by:
invalidateDirectoryCache
in interfaceDirectory
-
isMultiTenant
public boolean isMultiTenant()Description copied from interface:Directory
Returnstrue
if this directory is a multi tenant directory,false
otherwise.- Specified by:
isMultiTenant
in interfaceDirectory
-
shutdown
public void shutdown()Description copied from interface:Directory
Shuts down the directory. -
getTypes
since @8.4 -
getDirectoryDeleteConstraints
- Specified by:
getDirectoryDeleteConstraints
in interfaceDirectory
- Since:
- 8.4
-
initSchemaFieldMap
protected void initSchemaFieldMap() -
getSchemaFieldMap
Description copied from interface:Directory
Get schema field map- Specified by:
getSchemaFieldMap
in interfaceDirectory
-
fallbackOnDefaultCache
protected void fallbackOnDefaultCache()
-
loadDataOnInit(boolean)
instead