Class AbstractReadableRepositoryService
java.lang.Object
org.apache.jackrabbit.spi.commons.AbstractRepositoryService
org.apache.jackrabbit.spi.commons.AbstractReadableRepositoryService
- All Implemented Interfaces:
RepositoryService
AbstractReadableRepositoryService provides an abstract base
class where all methods that attempt to write throw an
UnsupportedRepositoryOperationException. This class useful for
repository service implementation that only provide read access to the
underlying content.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetItemInfoCache(SessionInfo sessionInfo) Returns aItemInfoCachefor the givenSessionInfo.getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) This default implementation returns the first item returned by the call toRepositoryService.getItemInfos(SessionInfo, ItemId).String[]getWorkspaceNames(SessionInfo sessionInfo) This default implementation first callsAbstractRepositoryService.checkSessionInfo(SessionInfo)with thesessionInfo, then returns the workspaces that were passed to the constructor of this repository service.booleanisGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) This default implementation first callsAbstractRepositoryService.checkSessionInfo(SessionInfo)with thesessionInfo, then returnsfalseif the any of theactionsare inWRITE_ACTIONS; otherwise returnstrue.Methods inherited from class org.apache.jackrabbit.spi.commons.AbstractRepositoryService
addVersionLabel, checkin, checkout, checkout, checkpoint, checkpoint, checkQueryStatement, clone, copy, createActivity, createBatch, createConfiguration, createEventFilter, createSubscription, createTree, createWorkspace, deleteWorkspace, dispose, dispose, executeQuery, getEvents, getEvents, getIdFactory, getLockInfo, getNameFactory, getNamespacePrefix, getNamespaceURI, getNodeDefinition, getPathFactory, getPropertyDefinition, getQNodeTypeDefinitions, getQNodeTypeDefinitions, getQValueFactory, getRegisteredNamespaces, getRepositoryDescriptors, getSupportedQueryLanguages, impersonate, importXml, lock, lock, merge, merge, mergeActivity, move, obtain, obtain, refreshLock, registerNamespace, registerNodeTypes, removeActivity, removeVersion, removeVersionLabel, resolveMergeConflict, restore, restore, submit, unlock, unregisterNamespace, unregisterNodeTypes, update, updateEventFiltersMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.spi.RepositoryService
getChildInfos, getItemInfos, getPrivilegeDefinitions, getPrivilegeNames, getPropertyInfo, getReferences, getSupportedPrivileges
-
Constructor Details
-
AbstractReadableRepositoryService
public AbstractReadableRepositoryService(Map<String, QValue[]> descriptors, Map<String, throws RepositoryException, ParseException, IllegalArgumentExceptionString> namespaces, Reader cnd, List<String> wspNames, String defaultWsp) Creates a newAbstractReadableRepositoryService.- Parameters:
descriptors- the repository descriptors. Maps descriptor keys to descriptor values.namespaces- the namespaces. Maps namespace prefixes to namespace URIs.cnd- a reader on the compact node type definition.wspNames- a list of workspace names.defaultWsp- name of the default workspace- Throws:
RepositoryException- if the namespace mappings are invalid.ParseException- if an error occurs while parsing the CND.IllegalArgumentException- ifdefaultWspisnull
-
-
Method Details
-
getItemInfoCache
Description copied from interface:RepositoryServiceReturns aItemInfoCachefor the givenSessionInfo.- Parameters:
sessionInfo-- Returns:
- a new instance of
ItemInfoCacheImpl
-
getNodeInfo
public NodeInfo getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) throws ItemNotFoundException, RepositoryException This default implementation returns the first item returned by the call toRepositoryService.getItemInfos(SessionInfo, ItemId). The underlying assumption here is that the implementation and the persistence layer are optimized for batch reading. That is, a call togetItemInfosis no more expensive than retrieving the singleNodeInfoonly. If this assumption does not hold, subclasses should override this method.- Parameters:
sessionInfo-nodeId-- Returns:
- The
NodeInfofor the node identified by the given id. - Throws:
ItemNotFoundExceptionRepositoryException- See Also:
-
getWorkspaceNames
This default implementation first callsAbstractRepositoryService.checkSessionInfo(SessionInfo)with thesessionInfo, then returns the workspaces that were passed to the constructor of this repository service.- Parameters:
sessionInfo-- Returns:
- An array of workspace names.
- Throws:
RepositoryException- See Also:
-
isGranted
public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) throws RepositoryException This default implementation first callsAbstractRepositoryService.checkSessionInfo(SessionInfo)with thesessionInfo, then returnsfalseif the any of theactionsare inWRITE_ACTIONS; otherwise returnstrue.- Parameters:
sessionInfo-itemId-actions-- Returns:
- true if the session with the given
SessionInfohas the specified rights for the given item. - Throws:
RepositoryException- See Also:
-