Class RegistryService
java.lang.Object
org.exoplatform.services.jcr.ext.registry.Registry
org.exoplatform.services.jcr.ext.registry.RegistryService
- All Implemented Interfaces:
org.picocontainer.Startable
Created by The eXo Platform SAS
Centralized collector for JCR based entities (services, apps, users) It contains info about the whole system, i.e. for all repositories used by system. All operations performed in context of "current" repository, i.e. RepositoryService.getCurrentRepository() Each repository has own Registry storage which is placed in workspace configured in "locations" entry like:
Centralized collector for JCR based entities (services, apps, users) It contains info about the whole system, i.e. for all repositories used by system. All operations performed in context of "current" repository, i.e. RepositoryService.getCurrentRepository() Each repository has own Registry storage which is placed in workspace configured in "locations" entry like:
<properties-param>
<name>locations</name>
<description>registry locations</description>
<property name="repository1" value="workspace1"/>
<property name="repository2" value="workspace2"/>
</properties-param>
The implementation hides storage details from end user- Version:
- $Id: RegistryService.java 34445 2009-07-24 07:51:18Z dkatayev $
- Author:
- Gennady Azarenkov
- eXo level API
- Unsupported
-
Nested Class Summary
Nested classes/interfaces inherited from class org.exoplatform.services.jcr.ext.registry.Registry
Registry.RegistryNode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringprotected static final Stringprotected final org.exoplatform.services.jcr.RepositoryServiceprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionRegistryService(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.jcr.RepositoryService repositoryService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlugin(org.exoplatform.container.component.ComponentPlugin plugin) Defines the configuration of the service thanks to the provided plugin if and only if the plugin is of typeRegistryInitializationEntryPluginvoidaddRegistryLocation(String repositoryName, String workspaceName) Adds a new registry entryvoidcreateEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) Creates an entry in the group.getEntry(SessionProvider sessionProvider, String entryPath) Returns the corresponding registry entry which wraps a node of type "exo:registryEntry"booleangetForceXMLConfigurationValue(org.exoplatform.container.xml.InitParams initParams) Get value of force-xml-configuration param.getRegistry(SessionProvider sessionProvider) Returns the registry node which wraps a node of type "exo:registry" (the whole registry tree)org.exoplatform.services.jcr.RepositoryServicevoidinitRegistryEntry(String groupName, String entryName) Initializes the registry entryvoidinitStorage(boolean replace) Initializes the registry storagebooleanIndicates whether the service is started or notvoidrecreateEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) Re-creates an entry in the group.voidremoveEntry(SessionProvider sessionProvider, String entryPath) Removes the entry at the given absolute path (concatenation of group path / entry name)voidremoveRegistryLocation(String repositoryName) voidstart()voidstop()voidupdateEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) Update an entry in the group.
-
Field Details
-
EXO_REGISTRY_NT
- See Also:
-
EXO_REGISTRYENTRY_NT
- See Also:
-
EXO_REGISTRYGROUP_NT
- See Also:
-
NT_FILE
- See Also:
-
EXO_REGISTRY
- See Also:
-
EXO_REGISTRYENTRY
- See Also:
-
EXO_SERVICES
- See Also:
-
EXO_APPLICATIONS
- See Also:
-
EXO_USERS
- See Also:
-
EXO_GROUPS
- See Also:
-
regWorkspaces
-
repositoryService
protected final org.exoplatform.services.jcr.RepositoryService repositoryService -
mixinNames
-
started
protected boolean started
-
-
Constructor Details
-
RegistryService
public RegistryService(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.jcr.RepositoryService repositoryService) throws org.exoplatform.services.jcr.config.RepositoryConfigurationException - Parameters:
params- accepts locations properties param and mixin-names values param.repositoryService- the repository service- Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException- if noInitParamsare provided
-
-
Method Details
-
getEntry
public RegistryEntry getEntry(SessionProvider sessionProvider, String entryPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException Returns the corresponding registry entry which wraps a node of type "exo:registryEntry" -
createEntry
public void createEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) throws javax.jcr.RepositoryException Creates an entry in the group. In a case the group does not exist already it will be automatically created.- Specified by:
createEntryin classRegistrygroupPath- related path (w/o leading slash) to group- Throws:
javax.jcr.RepositoryException
-
removeEntry
public void removeEntry(SessionProvider sessionProvider, String entryPath) throws javax.jcr.RepositoryException Removes the entry at the given absolute path (concatenation of group path / entry name)- Specified by:
removeEntryin classRegistryentryPath- related path (w/o leading slash) to entry- Throws:
javax.jcr.RepositoryException
-
recreateEntry
public void recreateEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) throws javax.jcr.RepositoryException Re-creates an entry in the group.- Specified by:
recreateEntryin classRegistry- Parameters:
sessionProvider- the session providergroupPath- related path (w/o leading slash) to group- Throws:
javax.jcr.RepositoryException
-
updateEntry
public void updateEntry(SessionProvider sessionProvider, String groupPath, RegistryEntry entry) throws javax.jcr.RepositoryException Update an entry in the group.- Parameters:
sessionProvider- the session provider- Throws:
javax.jcr.RepositoryException
-
getRegistry
public Registry.RegistryNode getRegistry(SessionProvider sessionProvider) throws javax.jcr.RepositoryException Returns the registry node which wraps a node of type "exo:registry" (the whole registry tree)- Specified by:
getRegistryin classRegistry- Returns:
- registry node object
- Throws:
javax.jcr.RepositoryException
-
isStarted
public boolean isStarted()Indicates whether the service is started or not -
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
initStorage
public void initStorage(boolean replace) throws org.exoplatform.services.jcr.config.RepositoryConfigurationException, javax.jcr.RepositoryException Initializes the registry storage- Parameters:
replace-trueif we want to re-create the exo:registry node,falseotherwise- Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException- if a configuration issue occursjavax.jcr.RepositoryException- if any error occurs
-
addRegistryLocation
Adds a new registry entry- Parameters:
repositoryName- the repository nameworkspaceName- the workspace name
-
removeRegistryLocation
- Parameters:
repositoryName- the repository name
-
initRegistryEntry
public void initRegistryEntry(String groupName, String entryName) throws javax.jcr.RepositoryException, org.exoplatform.services.jcr.config.RepositoryConfigurationException Initializes the registry entry- Parameters:
groupName- the group entry nameentryName- the entry name- Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException- if a configuration issue occursjavax.jcr.RepositoryException- if any error occurs
-
getRepositoryService
public org.exoplatform.services.jcr.RepositoryService getRepositoryService()- Returns:
- repository service
-
getForceXMLConfigurationValue
public boolean getForceXMLConfigurationValue(org.exoplatform.container.xml.InitParams initParams) Get value of force-xml-configuration param.- Parameters:
initParams- The InitParams- Returns:
- force-xml-configuration value if present and false in other case
-
addPlugin
public void addPlugin(org.exoplatform.container.component.ComponentPlugin plugin) Defines the configuration of the service thanks to the provided plugin if and only if the plugin is of typeRegistryInitializationEntryPlugin- Parameters:
plugin- the plugin from which we extract the configuration that is expected to be of typeRegistryInitializationEntryPlugin
-