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
public class RegistryService extends Registry implements 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:<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
Fields Modifier and Type Field Description static StringEXO_APPLICATIONSstatic StringEXO_GROUPSprotected static StringEXO_REGISTRYprotected static StringEXO_REGISTRY_NTprotected static StringEXO_REGISTRYENTRYprotected static StringEXO_REGISTRYENTRY_NTprotected static StringEXO_REGISTRYGROUP_NTstatic StringEXO_SERVICESstatic StringEXO_USERSprotected List<String>mixinNamesprotected static StringNT_FILEprotected Map<String,String>regWorkspacesprotected org.exoplatform.services.jcr.RepositoryServicerepositoryServiceprotected booleanstarted
-
Constructor Summary
Constructors Constructor Description RegistryService(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.jcr.RepositoryService repositoryService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPlugin(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.RegistryEntrygetEntry(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.Registry.RegistryNodegetRegistry(SessionProvider sessionProvider)Returns the registry node which wraps a node of type "exo:registry" (the whole registry tree)org.exoplatform.services.jcr.RepositoryServicegetRepositoryService()voidinitRegistryEntry(String groupName, String entryName)Initializes the registry entryvoidinitStorage(boolean replace)Initializes the registry storagebooleanisStarted()Indicates 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 Detail
-
EXO_REGISTRY_NT
protected static final String EXO_REGISTRY_NT
- See Also:
- Constant Field Values
-
EXO_REGISTRYENTRY_NT
protected static final String EXO_REGISTRYENTRY_NT
- See Also:
- Constant Field Values
-
EXO_REGISTRYGROUP_NT
protected static final String EXO_REGISTRYGROUP_NT
- See Also:
- Constant Field Values
-
NT_FILE
protected static final String NT_FILE
- See Also:
- Constant Field Values
-
EXO_REGISTRY
protected static final String EXO_REGISTRY
- See Also:
- Constant Field Values
-
EXO_REGISTRYENTRY
protected static final String EXO_REGISTRYENTRY
- See Also:
- Constant Field Values
-
EXO_SERVICES
public static final String EXO_SERVICES
- See Also:
- Constant Field Values
-
EXO_APPLICATIONS
public static final String EXO_APPLICATIONS
- See Also:
- Constant Field Values
-
EXO_USERS
public static final String EXO_USERS
- See Also:
- Constant Field Values
-
EXO_GROUPS
public static final String EXO_GROUPS
- See Also:
- Constant Field Values
-
repositoryService
protected final org.exoplatform.services.jcr.RepositoryService repositoryService
-
started
protected boolean started
-
-
Constructor Detail
-
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 Detail
-
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.RepositoryExceptionInitializes 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
public void addRegistryLocation(String repositoryName, String workspaceName)
Adds a new registry entry- Parameters:
repositoryName- the repository nameworkspaceName- the workspace name
-
removeRegistryLocation
public void removeRegistryLocation(String repositoryName)
- 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
-
-