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 |
lastModified
SYSTEM_DIRECTORY_TYPE
Constructor and Description |
---|
DirectoryServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
|
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 |
unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
INTERNAL unregisters a directory descriptor.
|
getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterContribution, unregisterExtension
protected static final String DELIMITER_BETWEEN_DIRECTORY_NAME_AND_SUFFIX
protected DirectoryRegistry registry
public DirectoryServiceImpl()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void registerDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
DirectoryService
registerDirectoryDescriptor
in interface DirectoryService
public void unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
DirectoryService
unregisterDirectoryDescriptor
in interface DirectoryService
public void applicationStarted(ComponentContext context)
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
protected DirectoryConfiguration getDirectoryConfiguration(DocumentModel documentContext)
protected String getWaitingLocalDirectoryName(String directoryName, DirectoryConfiguration configuration)
public BaseDirectoryDescriptor getDirectoryDescriptor(String id)
DirectoryService
getDirectoryDescriptor
in interface DirectoryService
id
- the directory idnull
if not registeredpublic Directory getDirectory(String id)
DirectoryService
If the id is null
, returns null
.
getDirectory
in interface DirectoryService
id
- the directory idnull
if not foundpublic Directory getDirectory(String id, DocumentModel documentContext)
DirectoryService
The 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 DirectoryService
id
- the directory iddocumentContext
- the document contextnull
if not foundprotected Directory getDirectoryOrFail(String name) throws DirectoryException
DirectoryException
protected Directory getDirectoryOrFail(String id, DocumentModel documentContext) throws DirectoryException
DirectoryException
public List<Directory> getDirectories()
DirectoryService
getDirectories
in interface DirectoryService
public List<String> getDirectoryNames()
DirectoryService
getDirectoryNames
in interface DirectoryService
public String getDirectorySchema(String directoryName) throws DirectoryException
DirectoryService
getDirectorySchema
in interface DirectoryService
directoryName
- the directory idDirectoryException
- if the directory does not existpublic String getDirectoryIdField(String directoryName) throws DirectoryException
DirectoryService
getDirectoryIdField
in interface DirectoryService
directoryName
- the directory idDirectoryException
- if the directory does not existpublic String getDirectoryPasswordField(String directoryName) throws DirectoryException
DirectoryService
getDirectoryPasswordField
in interface DirectoryService
DirectoryException
- if the directory does not existpublic String getParentDirectoryName(String directoryName) throws DirectoryException
DirectoryService
getParentDirectoryName
in interface DirectoryService
directoryName
- the directory idnull
DirectoryException
- if the directory does not existpublic Session open(String directoryName) throws DirectoryException
DirectoryService
This method prefers to throw rather than returning null.
open
in interface DirectoryService
DirectoryException
- in case the session cannot be createdpublic Session open(String directoryName, DocumentModel documentContext) throws DirectoryException
DirectoryService
This method prefers to throw rather than returning null.
open
in interface DirectoryService
DirectoryException
- in case the session cannot be createdCopyright © 2016 Nuxeo SA. All rights reserved.