Class NodeTypeCache
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache
-
public class NodeTypeCache extends Object
NodeTypeCache
implements a cache forQNodeTypeDefinition
s on a userId basis.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<QNodeTypeDefinition>
getAllDefinitions(NodeTypeStorage storage)
Returns an Iterator over all node type definitions registered.Iterator<QNodeTypeDefinition>
getDefinitions(NodeTypeStorage storage, Name[] nodeTypeNames)
Returns theQNodeTypeDefinition
s for the given node type names.static NodeTypeCache
getInstance(RepositoryService service, String userId)
void
registerNodeTypes(NodeTypeStorage storage, QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate)
void
unregisterNodeTypes(NodeTypeStorage storage, Name[] nodeTypeNames)
NodeTypeStorage
wrap(NodeTypeStorage storage)
Wraps thisNodeTypeCache
around the passedstorage
and exposes itself again as aNodeTypeStorage
.
-
-
-
Method Detail
-
getInstance
public static NodeTypeCache getInstance(RepositoryService service, String userId)
- Parameters:
service
- the repository service.userId
- the userId. Ifnull
this method will return a new cache instance for each such call.- Returns:
- the
NodeTypeCache
instance for the givenservice
anduserId
.
-
getAllDefinitions
public Iterator<QNodeTypeDefinition> getAllDefinitions(NodeTypeStorage storage) throws RepositoryException
Returns an Iterator over all node type definitions registered.- Returns:
- Throws:
RepositoryException
-
getDefinitions
public Iterator<QNodeTypeDefinition> getDefinitions(NodeTypeStorage storage, Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
Returns theQNodeTypeDefinition
s 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, boolean allowUpdate) throws RepositoryException
- Throws:
RepositoryException
-
unregisterNodeTypes
public void unregisterNodeTypes(NodeTypeStorage storage, Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException
-
wrap
public NodeTypeStorage wrap(NodeTypeStorage storage)
Wraps thisNodeTypeCache
around the passedstorage
and exposes itself again as aNodeTypeStorage
.- Parameters:
storage
- the node type storage to wrap.- Returns:
- node type storage instance using this cache.
-
-