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
  • Field Details

  • 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 no InitParams are 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"
      Specified by:
      getEntry in class Registry
      Parameters:
      sessionProvider -
      entryPath -
      Returns:
      the corresponding RegistryEntry
      Throws:
      javax.jcr.PathNotFoundException - if entry not found
      javax.jcr.RepositoryException
    • 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:
      createEntry in class Registry
      Parameters:
      sessionProvider -
      groupPath - related path (w/o leading slash) to group
      entry -
      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:
      removeEntry in class Registry
      Parameters:
      sessionProvider -
      entryPath - 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:
      recreateEntry in class Registry
      Parameters:
      sessionProvider - the session provider
      groupPath - related path (w/o leading slash) to group
      entry -
      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:
      getRegistry in class Registry
      Parameters:
      sessionProvider -
      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:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • initStorage

      public void initStorage(boolean replace) throws org.exoplatform.services.jcr.config.RepositoryConfigurationException, javax.jcr.RepositoryException
      Initializes the registry storage
      Parameters:
      replace - true if we want to re-create the exo:registry node, false otherwise
      Throws:
      org.exoplatform.services.jcr.config.RepositoryConfigurationException - if a configuration issue occurs
      javax.jcr.RepositoryException - if any error occurs
    • addRegistryLocation

      public void addRegistryLocation(String repositoryName, String workspaceName)
      Adds a new registry entry
      Parameters:
      repositoryName - the repository name
      workspaceName - 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 name
      entryName - the entry name
      Throws:
      org.exoplatform.services.jcr.config.RepositoryConfigurationException - if a configuration issue occurs
      javax.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 type RegistryInitializationEntryPlugin
      Parameters:
      plugin - the plugin from which we extract the configuration that is expected to be of type RegistryInitializationEntryPlugin