public abstract class AbstractReadableRepositoryService extends AbstractRepositoryService
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 and Description |
---|
AbstractReadableRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors,
java.util.Map<java.lang.String,java.lang.String> namespaces,
java.io.Reader cnd,
java.util.List<java.lang.String> wspNames,
java.lang.String defaultWsp)
Creates a new
AbstractReadableRepositoryService . |
Modifier and Type | Method and Description |
---|---|
ItemInfoCache |
getItemInfoCache(SessionInfo sessionInfo)
Returns a
ItemInfoCache for the given SessionInfo . |
NodeInfo |
getNodeInfo(SessionInfo sessionInfo,
NodeId nodeId)
This default implementation returns the first item returned by the call to
RepositoryService.getItemInfos(SessionInfo, ItemId) . |
java.lang.String[] |
getWorkspaceNames(SessionInfo sessionInfo)
This default implementation first calls
AbstractRepositoryService.checkSessionInfo(SessionInfo)
with the sessionInfo , then returns the workspaces that were
passed to the constructor of this repository service. |
boolean |
isGranted(SessionInfo sessionInfo,
ItemId itemId,
java.lang.String[] actions)
This default implementation first calls
AbstractRepositoryService.checkSessionInfo(SessionInfo)
with the sessionInfo , then returns false if
the any of the actions are in WRITE_ACTIONS ;
otherwise returns true . |
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, refreshLock, registerNamespace, registerNodeTypes, removeActivity, removeVersion, removeVersionLabel, resolveMergeConflict, restore, restore, submit, unlock, unregisterNamespace, unregisterNodeTypes, update, updateEventFilters
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildInfos, getItemInfos, getPrivilegeDefinitions, getPrivilegeNames, getPropertyInfo, getReferences, getSupportedPrivileges
public AbstractReadableRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors, java.util.Map<java.lang.String,java.lang.String> namespaces, java.io.Reader cnd, java.util.List<java.lang.String> wspNames, java.lang.String defaultWsp) throws RepositoryException, ParseException, java.lang.IllegalArgumentException
AbstractReadableRepositoryService
.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 workspaceRepositoryException
- if the namespace mappings are invalid.ParseException
- if an error occurs while parsing the CND.java.lang.IllegalArgumentException
- if defaultWsp
is null
public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo)
RepositoryService
ItemInfoCache
for the given SessionInfo
.sessionInfo
- ItemInfoCacheImpl
public NodeInfo getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) throws ItemNotFoundException, RepositoryException
RepositoryService.getItemInfos(SessionInfo, ItemId)
. The underlying assumption here is that
the implementation and the persistence layer are optimized for batch reading. That is,
a call to getItemInfos
is no more expensive than retrieving the single
NodeInfo
only. If this assumption does not hold, subclasses should override
this method.NodeInfo
for the node identified by the given id.ItemNotFoundException
RepositoryException
javax.jcr.Session#getItem(String)
,
javax.jcr.Node#getNode(String)
,
javax.jcr.version.VersionHistory#getAllVersions()
,
javax.jcr.version.VersionHistory#getVersion(String)
,
javax.jcr.version.VersionHistory#getVersionByLabel(String)
,
javax.jcr.version.VersionHistory#getRootVersion()
,
javax.jcr.Node#getBaseVersion()
,
javax.jcr.Node#getVersionHistory()
,
javax.jcr.version.Version#getContainingHistory()
public java.lang.String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException
AbstractRepositoryService.checkSessionInfo(SessionInfo)
with the sessionInfo
, then returns the workspaces that were
passed to the constructor of this repository service.RepositoryException
javax.jcr.Workspace#getAccessibleWorkspaceNames()
,
javax.jcr.Workspace#getName()
public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, java.lang.String[] actions) throws RepositoryException
AbstractRepositoryService.checkSessionInfo(SessionInfo)
with the sessionInfo
, then returns false
if
the any of the actions
are in WRITE_ACTIONS
;
otherwise returns true
.SessionInfo
has
the specified rights for the given item.RepositoryException
javax.jcr.Session#checkPermission(String, String)
,
javax.jcr.Session#hasPermission(String, String)
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"