org.apache.jackrabbit.jcr2spi.nodetype
Class NodeTypeCache

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache

public class NodeTypeCache
extends Object

NodeTypeCache implements a cache for QNodeTypeDefinitions on a userId basis.


Method Summary
 Iterator getAllDefinitions(NodeTypeStorage storage)
          Returns an Iterator over all node type definitions registered.
 Iterator getDefinitions(NodeTypeStorage storage, Name[] nodeTypeNames)
          Returns the QNodeTypeDefinitions for the given node type names.
static NodeTypeCache getInstance(RepositoryService service, String userId)
           
 void registerNodeTypes(NodeTypeStorage storage, QNodeTypeDefinition[] nodeTypeDefs)
           
 void reregisterNodeTypes(NodeTypeStorage storage, QNodeTypeDefinition[] nodeTypeDefs)
           
 void unregisterNodeTypes(NodeTypeStorage storage, Name[] nodeTypeNames)
           
 NodeTypeStorage wrap(NodeTypeStorage storage)
          Wraps this NodeTypeCache around the passed storage and exposes itself again as a NodeTypeStorage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NodeTypeCache getInstance(RepositoryService service,
                                        String userId)
Parameters:
service - the repository service.
userId - the userId. If null this method will return a new cache instance for each such call.
Returns:
the NodeTypeCache instance for the given service and userId.

getAllDefinitions

public Iterator getAllDefinitions(NodeTypeStorage storage)
                           throws RepositoryException
Returns an Iterator over all node type definitions registered.

Returns:
Throws:
RepositoryException

getDefinitions

public Iterator getDefinitions(NodeTypeStorage storage,
                               Name[] nodeTypeNames)
                        throws NoSuchNodeTypeException,
                               RepositoryException
Returns the QNodeTypeDefinitions for the given node type names. The implementation is free to return additional definitions e.g. dependencies.

Parameters:
nodeTypeNames -
Returns:
Throws:
NoSuchNodeTypeException
RepositoryException

registerNodeTypes

public void registerNodeTypes(NodeTypeStorage storage,
                              QNodeTypeDefinition[] nodeTypeDefs)
                       throws NoSuchNodeTypeException,
                              RepositoryException
Throws:
NoSuchNodeTypeException
RepositoryException

reregisterNodeTypes

public void reregisterNodeTypes(NodeTypeStorage storage,
                                QNodeTypeDefinition[] nodeTypeDefs)
                         throws NoSuchNodeTypeException,
                                RepositoryException
Throws:
NoSuchNodeTypeException
RepositoryException

unregisterNodeTypes

public void unregisterNodeTypes(NodeTypeStorage storage,
                                Name[] nodeTypeNames)
                         throws NoSuchNodeTypeException,
                                RepositoryException
Throws:
NoSuchNodeTypeException
RepositoryException

wrap

public NodeTypeStorage wrap(NodeTypeStorage storage)
Wraps this NodeTypeCache around the passed storage and exposes itself again as a NodeTypeStorage.

Parameters:
storage - the node type storage to wrap.
Returns:
node type storage instance using this cache.


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.