public class DirectoryServiceImpl extends DefaultComponent implements DirectoryService
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DELIMITER_BETWEEN_DIRECTORY_NAME_AND_SUFFIX |
protected DirectoryRegistry |
registry |
lastModifiedSYSTEM_DIRECTORY_TYPE| Constructor and Description |
|---|
DirectoryServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
List<Directory> |
getDirectories()
Gets all the directories.
|
Directory |
getDirectory(String id)
Return the directory with the given id.
|
Directory |
getDirectory(String id,
DocumentModel documentContext)
Returns the directory for the specified id and document context.
|
protected DirectoryConfiguration |
getDirectoryConfiguration(DocumentModel documentContext) |
BaseDirectoryDescriptor |
getDirectoryDescriptor(String id)
Gets the effective directory descriptor for the given directory.
|
String |
getDirectoryIdField(String directoryName)
Gets the id field for a directory.
|
List<String> |
getDirectoryNames()
Gets the directory ids.
|
protected Directory |
getDirectoryOrFail(String name) |
protected Directory |
getDirectoryOrFail(String id,
DocumentModel documentContext) |
String |
getDirectoryPasswordField(String directoryName)
Gets the password field for a directory.
|
String |
getDirectorySchema(String directoryName)
Gets the schema for a directory.
|
String |
getParentDirectoryName(String directoryName)
Gets the parent directory id a directory.
|
protected String |
getWaitingLocalDirectoryName(String directoryName,
DirectoryConfiguration configuration)
This will return the local directory name according the local configuration.
|
Session |
open(String directoryName)
Opens a session on specified directory.
|
Session |
open(String directoryName,
DocumentModel documentContext)
Opens a session on the directory for the specified context.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
registerDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
INTERNAL registers a directory descriptor.
|
void |
start(ComponentContext context)
Start the component.
|
void |
unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
INTERNAL unregisters a directory descriptor.
|
getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, stop, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderprotected static final String DELIMITER_BETWEEN_DIRECTORY_NAME_AND_SUFFIX
protected DirectoryRegistry registry
public DirectoryServiceImpl()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void registerDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
DirectoryServiceregisterDirectoryDescriptor in interface DirectoryServicepublic void unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
DirectoryServiceunregisterDirectoryDescriptor in interface DirectoryServicepublic void start(ComponentContext context)
Componentstart in interface Componentstart in class DefaultComponentprotected DirectoryConfiguration getDirectoryConfiguration(DocumentModel documentContext)
protected String getWaitingLocalDirectoryName(String directoryName, DirectoryConfiguration configuration)
public BaseDirectoryDescriptor getDirectoryDescriptor(String id)
DirectoryServicegetDirectoryDescriptor in interface DirectoryServiceid - the directory idnull if not registeredpublic Directory getDirectory(String id)
DirectoryService
If the id is null, returns null.
getDirectory in interface DirectoryServiceid - the directory idnull if not foundpublic Directory getDirectory(String id, DocumentModel documentContext)
DirectoryServiceThe context is given by the document. The document service will try to find the directory local configuration of the document that will specify the suffix. The directory service will fetch the id + suffix found. If no local configuration is found the service will return the directory with the given id.
If the id is null, returns null.
getDirectory in interface DirectoryServiceid - the directory iddocumentContext - the document contextnull if not foundprotected Directory getDirectoryOrFail(String name) throws DirectoryException
DirectoryExceptionprotected Directory getDirectoryOrFail(String id, DocumentModel documentContext) throws DirectoryException
DirectoryExceptionpublic List<Directory> getDirectories()
DirectoryServicegetDirectories in interface DirectoryServicepublic List<String> getDirectoryNames()
DirectoryServicegetDirectoryNames in interface DirectoryServicepublic String getDirectorySchema(String directoryName) throws DirectoryException
DirectoryServicegetDirectorySchema in interface DirectoryServicedirectoryName - the directory idDirectoryException - if the directory does not existpublic String getDirectoryIdField(String directoryName) throws DirectoryException
DirectoryServicegetDirectoryIdField in interface DirectoryServicedirectoryName - the directory idDirectoryException - if the directory does not existpublic String getDirectoryPasswordField(String directoryName) throws DirectoryException
DirectoryServicegetDirectoryPasswordField in interface DirectoryServiceDirectoryException - if the directory does not existpublic String getParentDirectoryName(String directoryName) throws DirectoryException
DirectoryServicegetParentDirectoryName in interface DirectoryServicedirectoryName - the directory idnullDirectoryException - if the directory does not existpublic Session open(String directoryName) throws DirectoryException
DirectoryServiceThis method prefers to throw rather than returning null.
open in interface DirectoryServiceDirectoryException - in case the session cannot be createdpublic Session open(String directoryName, DocumentModel documentContext) throws DirectoryException
DirectoryServiceThis method prefers to throw rather than returning null.
open in interface DirectoryServiceDirectoryException - in case the session cannot be createdCopyright © 2018 Nuxeo. All rights reserved.