Class NodeTypeCache
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache
-
public class NodeTypeCache extends Object
NodeTypeCacheimplements a cache forQNodeTypeDefinitions 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 theQNodeTypeDefinitions for the given node type names.static NodeTypeCachegetInstance(RepositoryService service, String userId)voidregisterNodeTypes(NodeTypeStorage storage, QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate)voidunregisterNodeTypes(NodeTypeStorage storage, Name[] nodeTypeNames)NodeTypeStoragewrap(NodeTypeStorage storage)Wraps thisNodeTypeCachearound the passedstorageand exposes itself again as aNodeTypeStorage.
-
-
-
Method Detail
-
getInstance
public static NodeTypeCache getInstance(RepositoryService service, String userId)
- Parameters:
service- the repository service.userId- the userId. Ifnullthis method will return a new cache instance for each such call.- Returns:
- the
NodeTypeCacheinstance for the givenserviceanduserId.
-
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 theQNodeTypeDefinitions for the given node type names. The implementation is free to return additional definitions e.g. dependencies.- Parameters:
nodeTypeNames-- Returns:
- Throws:
NoSuchNodeTypeExceptionRepositoryException
-
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 thisNodeTypeCachearound the passedstorageand exposes itself again as aNodeTypeStorage.- Parameters:
storage- the node type storage to wrap.- Returns:
- node type storage instance using this cache.
-
-