Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2009 eXo Platform SAS.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.exoplatform.services.jcr.ext.registry;
 
 
 import javax.jcr.Node;
Created by The eXo Platform SAS .
JCR based Services Registry abstraction. As interchange object all the methods use Nodes' wrappers to not to let using an arbitrary Type of Node. There is 2 phase modification of RegistryEntry (1) get or create RegistryEntry retrieves or creates new object in memory and (2) register/unregister stores the object permanently

Author(s):
Gennady Azarenkov
Version:
$Id: $
 
 
 public abstract class Registry
 {

   
Returns Registry node object which wraps Node of "exo:registry" type (the whole registry tree)

Parameters:
sessionProvider
repository
Returns:
egistry node object
Throws:
javax.jcr.RepositoryException
 
    public abstract RegistryNode getRegistry(SessionProvider sessionProviderthrows RepositoryConfigurationException,
       RepositoryException;

   
Returns existed RegistryEntry which wraps Node of "exo:registryEntry" type

Parameters:
sessionProvider
entryPath
Returns:
existed RegistryEntry
Throws:
javax.jcr.PathNotFoundException if entry not found
javax.jcr.RepositoryException
 
    public abstract RegistryEntry getEntry(SessionProvider sessionProviderString entryPath)
       throws PathNotFoundExceptionRepositoryException;

   
creates an entry in the group. In a case if the group does not exist it will be silently created as well

Parameters:
sessionProvider
groupPath related path (w/o leading slash) to group
entry
Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException
javax.jcr.RepositoryException
 
    public abstract void createEntry(SessionProvider sessionProviderString groupPathRegistryEntry entry)
       throws RepositoryException;

   
updates an entry in the group

Parameters:
sessionProvider
groupPath related path (w/o leading slash) to group
entry
Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException
javax.jcr.RepositoryException
 
    public abstract void recreateEntry(SessionProvider sessionProviderString groupPathRegistryEntry entry)
       throws RepositoryException;

   
removes entry located on entryPath (concatenation of group path / entry name)

Parameters:
sessionProvider
entryPath related path (w/o leading slash) to entry
Throws:
org.exoplatform.services.jcr.config.RepositoryConfigurationException
javax.jcr.RepositoryException
   public abstract void removeEntry(SessionProvider sessionProviderString entryPaththrows RepositoryException;

   
Internal Node wrapper which ensures the node of "exo:registry" type inside
   public final class RegistryNode extends NodeWrapper
   {
      protected RegistryNode(final Node nodethrows RepositoryException
      {
         super(node);
      }
   }
New to GrepCode? Check out our FAQ X