public abstract class AbstractDirectory extends Object implements Directory
Modifier and Type | Field and Description |
---|---|
protected DirectoryCache |
cache |
BaseDirectoryDescriptor |
descriptor |
protected DirectoryFieldMapper |
fieldMapper |
protected Class<? extends Reference> |
referenceClass |
protected Map<String,List<Reference>> |
references |
protected com.codahale.metrics.MetricRegistry |
registry |
protected Map<String,Field> |
schemaFieldMap |
protected com.codahale.metrics.Counter |
sessionCount |
protected com.codahale.metrics.Counter |
sessionMaxCount |
protected List<String> |
types |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDirectory(BaseDirectoryDescriptor descriptor,
Class<? extends Reference> referenceClass) |
Modifier and Type | Method and Description |
---|---|
protected void |
addInverseReferences(InverseReferenceDescriptor[] references) |
void |
addReference(Reference reference) |
void |
addReferences(Reference[] refs) |
protected void |
addReferences(ReferenceDescriptor[] references) |
void |
addSession(Session session) |
protected boolean |
doSanityChecks() |
protected void |
fallbackOnDefaultCache() |
DirectoryCache |
getCache()
Gets the cache instance of the directory
|
List<DirectoryDeleteConstraint> |
getDirectoryDeleteConstraints() |
DirectoryFieldMapper |
getFieldMapper() |
String |
getIdField()
Gets the id field of the schema for this directory.
|
String |
getName()
Gets the unique name of the directory, used for registering.
|
String |
getParentDirectory()
Gets the name of the parent directory.
|
String |
getPasswordField()
Gets the password field of the schema for this directory.
|
Reference |
getReference(String referenceFieldName)
Deprecated.
|
Collection<Reference> |
getReferences()
Lookup all References defined on the directory.
|
List<Reference> |
getReferences(String referenceFieldName)
Lookup the References by field name.
|
String |
getSchema()
Gets the schema name used by this directory.
|
Map<String,Field> |
getSchemaFieldMap()
Get schema field map
|
List<String> |
getTypes()
since @8.4
|
protected void |
initSchemaFieldMap() |
void |
invalidateCaches()
Invalidate caches
|
void |
invalidateDirectoryCache()
Invalidates the cache instance of the directory
|
boolean |
isMultiTenant()
Returns
true if this directory is a multi tenant directory, false otherwise. |
boolean |
isReadOnly()
Checks if this directory is read-only.
|
boolean |
isReference(String referenceFieldName) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescriptor, getSession
public final BaseDirectoryDescriptor descriptor
protected DirectoryFieldMapper fieldMapper
protected final Map<String,List<Reference>> references
protected final DirectoryCache cache
protected final com.codahale.metrics.MetricRegistry registry
protected final com.codahale.metrics.Counter sessionCount
protected final com.codahale.metrics.Counter sessionMaxCount
protected Map<String,Field> schemaFieldMap
protected Class<? extends Reference> referenceClass
protected AbstractDirectory(BaseDirectoryDescriptor descriptor, Class<? extends Reference> referenceClass)
protected boolean doSanityChecks()
public String getName()
Directory
public String getSchema()
Directory
public String getParentDirectory()
Directory
getParentDirectory
in interface Directory
public String getIdField()
Directory
getIdField
in interface Directory
public String getPasswordField()
Directory
getPasswordField
in interface Directory
public boolean isReadOnly()
Directory
isReadOnly
in interface Directory
public void setReadOnly(boolean readOnly)
public void invalidateCaches() throws DirectoryException
Directory
invalidateCaches
in interface Directory
DirectoryException
public DirectoryFieldMapper getFieldMapper()
@Deprecated public Reference getReference(String referenceFieldName)
Directory
getReference
in interface Directory
public List<Reference> getReferences(String referenceFieldName)
Directory
getReferences
in interface Directory
public boolean isReference(String referenceFieldName)
public void addReference(Reference reference)
public void addReferences(Reference[] refs)
protected void addInverseReferences(InverseReferenceDescriptor[] references)
protected void addReferences(ReferenceDescriptor[] references)
public Collection<Reference> getReferences()
Directory
getReferences
in interface Directory
public void orderEntries(List<DocumentModel> entries, Map<String,String> orderBy) throws DirectoryException
entries
- the list of entries.orderBy
- an ordered map of field name -> "asc" or "desc".DirectoryException
public DirectoryCache getCache()
Directory
public void removeSession(Session session)
public void addSession(Session session)
public void invalidateDirectoryCache() throws DirectoryException
Directory
invalidateDirectoryCache
in interface Directory
DirectoryException
public boolean isMultiTenant()
Directory
true
if this directory is a multi tenant directory, false
otherwise.isMultiTenant
in interface Directory
public void shutdown()
Directory
public List<DirectoryDeleteConstraint> getDirectoryDeleteConstraints()
getDirectoryDeleteConstraints
in interface Directory
protected void initSchemaFieldMap()
public Map<String,Field> getSchemaFieldMap()
Directory
getSchemaFieldMap
in interface Directory
protected void fallbackOnDefaultCache()
Copyright © 2018 Nuxeo. All rights reserved.