Class DirectoryServiceImpl
- All Implemented Interfaces:
DirectoryService
,Adaptable
,Component
,Extensible
,TimestampedService
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Duration
static final String
protected static final String
protected DirectoryRegistry
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
Fields inherited from interface org.nuxeo.ecm.directory.api.DirectoryService
SYSTEM_DIRECTORY_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.void
deactivate
(ComponentContext context) Deactivates the component.int
The component notification order forComponent.start(ComponentContext)
.Gets all the directories.getDirectory
(String id) Return the directory with the given id.getDirectory
(String id, DocumentModel documentContext) Returns the directory for the specified id and document context.protected DirectoryConfiguration
getDirectoryConfiguration
(DocumentModel documentContext) Gets the effective directory descriptor for the given directory.getDirectoryIdField
(String directoryName) Gets the id field for a directory.Gets the directory ids.protected Directory
getDirectoryOrFail
(String name) protected Directory
getDirectoryOrFail
(String id, DocumentModel documentContext) getDirectoryPasswordField
(String directoryName) Gets the password field for a directory.getDirectorySchema
(String directoryName) Gets the schema for a directory.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.void
loadFromCSV
(String directoryName, Blob dataBlob, String dataLoadingPolicy) Loads a CSV into the givendirectoryName
.Opens a session on specified directory.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.protected void
start()
void
start
(ComponentContext context) Start the component.void
unregisterDirectoryDescriptor
(BaseDirectoryDescriptor descriptor) INTERNAL unregisters a directory descriptor.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterContribution, unregisterExtension
-
Field Details
-
CLUSTER_START_DURATION_PROP
- Since:
- 11.1
- See Also:
-
CLUSTER_START_DURATION_DEFAULT
- Since:
- 11.1
-
DELIMITER_BETWEEN_DIRECTORY_NAME_AND_SUFFIX
- See Also:
-
registry
-
-
Constructor Details
-
DirectoryServiceImpl
public DirectoryServiceImpl()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContribution
in classDefaultComponent
-
registerDirectoryDescriptor
Description copied from interface:DirectoryService
INTERNAL registers a directory descriptor.- Specified by:
registerDirectoryDescriptor
in interfaceDirectoryService
-
unregisterDirectoryDescriptor
Description copied from interface:DirectoryService
INTERNAL unregisters a directory descriptor.- Specified by:
unregisterDirectoryDescriptor
in interfaceDirectoryService
-
loadFromCSV
Description copied from interface:DirectoryService
Loads a CSV into the givendirectoryName
.- Specified by:
loadFromCSV
in interfaceDirectoryService
- See Also:
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:Component
The component notification order forComponent.start(ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
start
protected void start() -
getDirectoryConfiguration
-
getWaitingLocalDirectoryName
protected String getWaitingLocalDirectoryName(String directoryName, DirectoryConfiguration configuration) This will return the local directory name according the local configuration. If the local configuration is null or the suffix value is null or the suffix value trimmed is an empty string the returned value is the directoryName given in parameter. If not this is directoryName + DELIMITER_BETWEEN_DIRECTORY_NAME_AND_SUFFIX + suffix. if directoryName is null, return null. -
getDirectoryDescriptor
Description copied from interface:DirectoryService
Gets the effective directory descriptor for the given directory.- Specified by:
getDirectoryDescriptor
in interfaceDirectoryService
- Parameters:
id
- the directory id- Returns:
- the effective directory descriptor, or
null
if not registered
-
getDirectory
Description copied from interface:DirectoryService
Return the directory with the given id.If the id is
null
, returnsnull
.- Specified by:
getDirectory
in interfaceDirectoryService
- Parameters:
id
- the directory id- Returns:
- the directory, or
null
if not found
-
getDirectory
Description copied from interface:DirectoryService
Returns the directory for the specified id and document context.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
, returnsnull
.- Specified by:
getDirectory
in interfaceDirectoryService
- Parameters:
id
- the directory iddocumentContext
- the document context- Returns:
- the directory, or
null
if not found
-
getDirectoryOrFail
-
getDirectoryOrFail
-
getDirectories
Description copied from interface:DirectoryService
Gets all the directories.- Specified by:
getDirectories
in interfaceDirectoryService
-
getDirectoryNames
Description copied from interface:DirectoryService
Gets the directory ids.- Specified by:
getDirectoryNames
in interfaceDirectoryService
-
getDirectorySchema
Description copied from interface:DirectoryService
Gets the schema for a directory.- Specified by:
getDirectorySchema
in interfaceDirectoryService
- Parameters:
directoryName
- the directory id- Returns:
- the schema for the directory
-
getDirectoryIdField
Description copied from interface:DirectoryService
Gets the id field for a directory.- Specified by:
getDirectoryIdField
in interfaceDirectoryService
- Parameters:
directoryName
- the directory id- Returns:
- the id field for the directory
-
getDirectoryPasswordField
Description copied from interface:DirectoryService
Gets the password field for a directory.- Specified by:
getDirectoryPasswordField
in interfaceDirectoryService
- Parameters:
directoryName
- the directory name- Returns:
- the password field for the directory
-
getParentDirectoryName
Description copied from interface:DirectoryService
Gets the parent directory id a directory.- Specified by:
getParentDirectoryName
in interfaceDirectoryService
- Parameters:
directoryName
- the directory id- Returns:
- the parent directory id, which may be
null
-
open
Description copied from interface:DirectoryService
Opens a session on specified directory.This method prefers to throw rather than returning null.
- Specified by:
open
in interfaceDirectoryService
- Returns:
- the session
-
open
Description copied from interface:DirectoryService
Opens a session on the directory for the specified context. 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 will fetch the directoryName + suffix found. If no local configuration is found the service will return the directoryName directory.This method prefers to throw rather than returning null.
- Specified by:
open
in interfaceDirectoryService
- Returns:
- the session
-