Package org.nuxeo.ecm.directory
Class DirectoryRegistry
- java.lang.Object
-
- org.nuxeo.ecm.directory.DirectoryRegistry
-
public class DirectoryRegistry extends Object
GenericBaseDirectoryDescriptor
registry holding registered descriptors and instantiatedDirectory
objects.The directory descriptors have two special boolean flags that control how merge works:
remove="true"
: this removes the definition of the directory. The next definition (if any) will be done from scratch.template="true"
: this defines an abstract descriptor which cannot be directly instantiated as a directory. However another descriptor can extend it throughextends="templatename"
to inherit all its properties.
- Since:
- 8.2
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,List<BaseDirectoryDescriptor>>
allDescriptors
All descriptors registered.protected Map<String,BaseDirectoryDescriptor>
descriptors
Effective descriptors.protected Map<String,Directory>
directories
Effective instantiated directories.
-
Constructor Summary
Constructors Constructor Description DirectoryRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContribution(BaseDirectoryDescriptor contrib)
protected void
contributionChanged(BaseDirectoryDescriptor contrib)
List<Directory>
getDirectories()
Gets all the directories.Directory
getDirectory(String id)
Gets the directory with the given id.BaseDirectoryDescriptor
getDirectoryDescriptor(String id)
Gets the effective directory descriptor with the given id.List<String>
getDirectoryIds()
Gets all the directory ids.protected BaseDirectoryDescriptor
recomputeDescriptor(String id)
Recomputes the effective descriptor for a directory id.void
removeContribution(BaseDirectoryDescriptor contrib)
protected void
removeDirectory(String id)
void
shutdown()
Shuts down all directories and clears the registry.protected static void
shutdownDirectory(Directory dir)
Shuts down the given directory and catches anyDirectoryException
.
-
-
-
Field Detail
-
allDescriptors
protected Map<String,List<BaseDirectoryDescriptor>> allDescriptors
All descriptors registered.
-
descriptors
protected Map<String,BaseDirectoryDescriptor> descriptors
Effective descriptors.
-
directories
protected Map<String,Directory> directories
Effective instantiated directories.
-
-
Constructor Detail
-
DirectoryRegistry
public DirectoryRegistry()
-
-
Method Detail
-
addContribution
public void addContribution(BaseDirectoryDescriptor contrib)
-
removeContribution
public void removeContribution(BaseDirectoryDescriptor contrib)
-
contributionChanged
protected void contributionChanged(BaseDirectoryDescriptor contrib)
-
removeDirectory
protected void removeDirectory(String id)
-
recomputeDescriptor
protected BaseDirectoryDescriptor recomputeDescriptor(String id)
Recomputes the effective descriptor for a directory id.
-
getDirectoryDescriptor
public BaseDirectoryDescriptor getDirectoryDescriptor(String id)
Gets the effective directory descriptor with the given id.Templates are not returned.
- Parameters:
id
- the directory id- Returns:
- the effective directory descriptor, or
null
if not found
-
getDirectory
public Directory getDirectory(String id)
Gets the directory with the given id.- Parameters:
id
- the directory id- Returns:
- the directory, or
null
if not found
-
getDirectoryIds
public List<String> getDirectoryIds()
Gets all the directory ids.- Returns:
- the directory ids
-
getDirectories
public List<Directory> getDirectories()
Gets all the directories.- Returns:
- the directories
-
shutdown
public void shutdown()
Shuts down all directories and clears the registry.
-
shutdownDirectory
protected static void shutdownDirectory(Directory dir)
Shuts down the given directory and catches anyDirectoryException
.- Parameters:
dir
- the directory
-
-