|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.spi.commons.AbstractRepositoryService
org.apache.jackrabbit.spi.commons.AbstractReadableRepositoryService
public abstract class AbstractReadableRepositoryService
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.
| Field Summary | |
|---|---|
protected Map |
descriptors
The repository descriptors. |
protected NamespaceMapping |
namespaces
The fixed set of namespaces known to the repository service. |
protected Map |
nodeTypeDefs
The fixed set of node type definitions known to the repository service. |
protected QNodeDefinition |
rootNodeDefinition
The node definition of the root node. |
protected static Set |
WRITE_ACTIONS
|
protected List |
wspNames
The list of workspaces that this repository service exposes. |
| Constructor Summary | |
|---|---|
AbstractReadableRepositoryService(Map descriptors,
Map namespaces,
Reader cnd,
List wspNames)
Creates a new AbstractReadableRepositoryService. |
|
| Method Summary | |
|---|---|
void |
addVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label,
boolean moveLabel)
|
protected abstract void |
checkCredentials(Credentials credentials,
String workspaceName)
Checks if the given credentials are valid. |
NodeId |
checkin(SessionInfo sessionInfo,
NodeId nodeId)
|
void |
checkout(SessionInfo sessionInfo,
NodeId nodeId)
|
void |
checkQueryStatement(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
|
protected void |
checkSessionInfo(SessionInfo sessionInfo)
Checks the type of the sessionInfo instance. |
void |
clone(SessionInfo sessionInfo,
String srcWorkspaceName,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName,
boolean removeExisting)
|
void |
copy(SessionInfo sessionInfo,
String srcWorkspaceName,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
|
Batch |
createBatch(SessionInfo sessionInfo,
ItemId itemId)
|
EventFilter |
createEventFilter(SessionInfo sessionInfo,
int eventTypes,
Path absPath,
boolean isDeep,
String[] uuid,
Name[] nodeTypeName,
boolean noLocal)
|
protected abstract QNodeDefinition |
createRootNodeDefinition()
Create the root node definition. |
protected SessionInfo |
createSessionInfo(String userId,
String workspaceName)
Creates a session info instance for the given userId and
workspaceName. |
Subscription |
createSubscription(SessionInfo sessionInfo,
EventFilter[] filters)
|
void |
dispose(SessionInfo sessionInfo)
This default implementation does nothing. |
void |
dispose(Subscription subscription)
|
QueryInfo |
executeQuery(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
|
EventBundle[] |
getEvents(Subscription subscription,
long timeout)
|
Iterator |
getItemInfos(SessionInfo sessionInfo,
NodeId nodeId)
This default implementation returns an iterator over the item infos returned by the call to RepositoryService.getNodeInfo(SessionInfo, NodeId). |
LockInfo |
getLockInfo(SessionInfo sessionInfo,
NodeId nodeId)
|
String |
getNamespacePrefix(SessionInfo sessionInfo,
String uri)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then return the namespace prefix for
the given uri. |
String |
getNamespaceURI(SessionInfo sessionInfo,
String prefix)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the namepsace URI for the
given prefix. |
QNodeDefinition |
getNodeDefinition(SessionInfo sessionInfo,
NodeId nodeId)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then lazily initializes rootNodeDefinition
if nodeId denotes the root node; otherwise throws a
UnsupportedRepositoryOperationException. |
QPropertyDefinition |
getPropertyDefinition(SessionInfo sessionInfo,
PropertyId propertyId)
|
Iterator |
getQNodeTypeDefinitions(SessionInfo sessionInfo)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, |
Iterator |
getQNodeTypeDefinitions(SessionInfo sessionInfo,
Name[] nodetypeNames)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then gathers the QNodeTypeDefinitions
with the given nodetypeNames. |
Map |
getRegisteredNamespaces(SessionInfo sessionInfo)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the prefix to namespace
URL mapping that was provided in the constructor of this repository
service. |
Map |
getRepositoryDescriptors()
This default implementation returns the descriptors that were passed to the constructor of this repository service. |
String[] |
getSupportedQueryLanguages(SessionInfo sessionInfo)
|
String[] |
getWorkspaceNames(SessionInfo sessionInfo)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the workspaces that were
passed to the constructor of this repository service. |
SessionInfo |
impersonate(SessionInfo sessionInfo,
Credentials credentials)
This default implementation returns the session info returned by the call to obtain(Credentials, String) with the workspaceName taken from
the passed sessionInfo. |
void |
importXml(SessionInfo sessionInfo,
NodeId parentId,
InputStream xmlStream,
int uuidBehaviour)
|
boolean |
isGranted(SessionInfo sessionInfo,
ItemId itemId,
String[] actions)
This default implementation first calls checkSessionInfo(SessionInfo)
with the sessionInfo, then returns false if
the any of the actions are in WRITE_ACTIONS;
otherwise returns true. |
LockInfo |
lock(SessionInfo sessionInfo,
NodeId nodeId,
boolean deep,
boolean sessionScoped)
|
LockInfo |
lock(SessionInfo sessionInfo,
NodeId nodeId,
boolean deep,
boolean sessionScoped,
long timeoutHint,
String ownerHint)
|
Iterator |
merge(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName,
boolean bestEffort)
|
void |
move(SessionInfo sessionInfo,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
|
SessionInfo |
obtain(Credentials credentials,
String workspaceName)
This default implementation does: calls checkCredentials(Credentials, String)
checks if the given workspaceName is in
wspNames otherwise throws a NoSuchWorkspaceException.
calls createSessionInfo(String, String) with a null
userId or the userId from credentials
if it is of type SimpleCredentials.
|
SessionInfo |
obtain(SessionInfo sessionInfo,
String workspaceName)
This default implementation returns the session info retuned by the call to createSessionInfo(String, String) with the userId taken
from the passed sessionInfo. |
void |
refreshLock(SessionInfo sessionInfo,
NodeId nodeId)
|
void |
registerNamespace(SessionInfo sessionInfo,
String prefix,
String uri)
|
void |
removeVersion(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId)
|
void |
removeVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label)
|
void |
resolveMergeConflict(SessionInfo sessionInfo,
NodeId nodeId,
NodeId[] mergeFailedIds,
NodeId[] predecessorIds)
|
void |
restore(SessionInfo sessionInfo,
NodeId[] versionIds,
boolean removeExisting)
|
void |
restore(SessionInfo sessionInfo,
NodeId nodeId,
NodeId versionId,
boolean removeExisting)
|
void |
submit(Batch batch)
|
void |
unlock(SessionInfo sessionInfo,
NodeId nodeId)
|
void |
unregisterNamespace(SessionInfo sessionInfo,
String uri)
|
void |
update(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName)
|
void |
updateEventFilters(Subscription subscription,
EventFilter[] filters)
|
| Methods inherited from class org.apache.jackrabbit.spi.commons.AbstractRepositoryService |
|---|
getIdFactory, getNameFactory, getPathFactory, getQValueFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.jackrabbit.spi.RepositoryService |
|---|
getChildInfos, getNodeInfo, getPropertyInfo |
| Field Detail |
|---|
protected static final Set WRITE_ACTIONS
protected final Map descriptors
protected final NamespaceMapping namespaces
protected final Map nodeTypeDefs
protected QNodeDefinition rootNodeDefinition
protected final List wspNames
| Constructor Detail |
|---|
public AbstractReadableRepositoryService(Map descriptors,
Map namespaces,
Reader cnd,
List wspNames)
throws RepositoryException,
ParseException
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.
RepositoryException - if the namespace mappings are invalid.
ParseException - if an error occurs while parsing the CND.| Method Detail |
|---|
protected abstract QNodeDefinition createRootNodeDefinition()
throws RepositoryException
RepositoryException - if an error occurs.
protected abstract void checkCredentials(Credentials credentials,
String workspaceName)
throws LoginException
credentials are valid.
credentials - the credentials to check.workspaceName - the workspace to access.
LoginException - if the credentials are invalid.
protected void checkSessionInfo(SessionInfo sessionInfo)
throws RepositoryException
sessionInfo instance. This default
implementation checks if sessionInfo is of type
SessionInfoImpl, otherwise throws a RepositoryException.
sessionInfo - the session info to check.
RepositoryException - if the given sessionInfo is not
of the required type for this repository
service implementation.
protected SessionInfo createSessionInfo(String userId,
String workspaceName)
userId and
workspaceName. This default implementation creates a
SessionInfoImpl instance and sets the userId and workspaceName.
userId - the userId.workspaceName - the name of the workspace to access.
userId and
workspaceName.
public SessionInfo obtain(Credentials credentials,
String workspaceName)
throws LoginException,
NoSuchWorkspaceException,
RepositoryException
checkCredentials(Credentials, String)workspaceName is in
wspNames otherwise throws a NoSuchWorkspaceException.createSessionInfo(String, String) with a null
userId or the userId from credentials
if it is of type SimpleCredentials.
credentials - the credentials for the login.workspaceName - the name of the workspace to log in.
LoginException - if the credentials are invalid.
NoSuchWorkspaceException - if workspaceName is unknown.
RepositoryException - if another error occurs.
public SessionInfo obtain(SessionInfo sessionInfo,
String workspaceName)
throws LoginException,
NoSuchWorkspaceException,
RepositoryException
createSessionInfo(String, String) with the userId taken
from the passed sessionInfo.
LoginException
NoSuchWorkspaceException
RepositoryException
public SessionInfo impersonate(SessionInfo sessionInfo,
Credentials credentials)
throws LoginException,
RepositoryException
obtain(Credentials, String) with the workspaceName taken from
the passed sessionInfo.
LoginException
RepositoryException
public void dispose(SessionInfo sessionInfo)
throws RepositoryException
RepositoryException
public Iterator getItemInfos(SessionInfo sessionInfo,
NodeId nodeId)
throws ItemNotFoundException,
RepositoryException
RepositoryService.getNodeInfo(SessionInfo, NodeId).
ItemNotFoundException
RepositoryException
public Map getRepositoryDescriptors()
throws RepositoryException
RepositoryException
public String[] getWorkspaceNames(SessionInfo sessionInfo)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the workspaces that were
passed to the constructor of this repository service.
RepositoryException
public boolean isGranted(SessionInfo sessionInfo,
ItemId itemId,
String[] actions)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then returns false if
the any of the actions are in WRITE_ACTIONS;
otherwise returns true.
RepositoryException
public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo,
RepositoryException
public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo,
Name[] nodetypeNames)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then gathers the QNodeTypeDefinitions
with the given nodetypeNames. If one of the nodetypeNames
is not a valid node type definition then a RepositoryException
is thrown.
RepositoryException
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo,
NodeId nodeId)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then lazily initializes rootNodeDefinition
if nodeId denotes the root node; otherwise throws a
UnsupportedRepositoryOperationException.
RepositoryException
public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo,
PropertyId propertyId)
throws RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public Map getRegisteredNamespaces(SessionInfo sessionInfo)
throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the prefix to namespace
URL mapping that was provided in the constructor of this repository
service.
RepositoryException
public String getNamespaceURI(SessionInfo sessionInfo,
String prefix)
throws NamespaceException,
RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then returns the namepsace URI for the
given prefix.
NamespaceException
RepositoryException
public String getNamespacePrefix(SessionInfo sessionInfo,
String uri)
throws NamespaceException,
RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo, then return the namespace prefix for
the given uri.
NamespaceException
RepositoryException
public Batch createBatch(SessionInfo sessionInfo,
ItemId itemId)
throws RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public void submit(Batch batch)
throws PathNotFoundException,
ItemNotFoundException,
NoSuchNodeTypeException,
ValueFormatException,
VersionException,
LockException,
ConstraintViolationException,
AccessDeniedException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
public void importXml(SessionInfo sessionInfo,
NodeId parentId,
InputStream xmlStream,
int uuidBehaviour)
throws ItemExistsException,
PathNotFoundException,
VersionException,
ConstraintViolationException,
LockException,
AccessDeniedException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
public void move(SessionInfo sessionInfo,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
throws ItemExistsException,
PathNotFoundException,
VersionException,
ConstraintViolationException,
LockException,
AccessDeniedException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
public void copy(SessionInfo sessionInfo,
String srcWorkspaceName,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
throws NoSuchWorkspaceException,
ConstraintViolationException,
VersionException,
AccessDeniedException,
PathNotFoundException,
ItemExistsException,
LockException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public void update(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName)
throws NoSuchWorkspaceException,
AccessDeniedException,
LockException,
InvalidItemStateException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
public void clone(SessionInfo sessionInfo,
String srcWorkspaceName,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName,
boolean removeExisting)
throws NoSuchWorkspaceException,
ConstraintViolationException,
VersionException,
AccessDeniedException,
PathNotFoundException,
ItemExistsException,
LockException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public LockInfo lock(SessionInfo sessionInfo,
NodeId nodeId,
boolean deep,
boolean sessionScoped)
throws UnsupportedRepositoryOperationException,
LockException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
LockException
AccessDeniedException
RepositoryException
public LockInfo lock(SessionInfo sessionInfo,
NodeId nodeId,
boolean deep,
boolean sessionScoped,
long timeoutHint,
String ownerHint)
throws UnsupportedRepositoryOperationException,
LockException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
LockException
AccessDeniedException
RepositoryException
public LockInfo getLockInfo(SessionInfo sessionInfo,
NodeId nodeId)
throws AccessDeniedException,
RepositoryException
null.
AccessDeniedException
RepositoryException
public void refreshLock(SessionInfo sessionInfo,
NodeId nodeId)
throws UnsupportedRepositoryOperationException,
LockException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
LockException
AccessDeniedException
RepositoryException
public void unlock(SessionInfo sessionInfo,
NodeId nodeId)
throws UnsupportedRepositoryOperationException,
LockException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
LockException
AccessDeniedException
RepositoryException
public NodeId checkin(SessionInfo sessionInfo,
NodeId nodeId)
throws VersionException,
UnsupportedRepositoryOperationException,
InvalidItemStateException,
LockException,
RepositoryException
UnsupportedRepositoryOperationException - always.
VersionException
InvalidItemStateException
LockException
RepositoryException
public void checkout(SessionInfo sessionInfo,
NodeId nodeId)
throws UnsupportedRepositoryOperationException,
LockException,
RepositoryException
UnsupportedRepositoryOperationException - always.
LockException
RepositoryException
public void removeVersion(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId)
throws ReferentialIntegrityException,
AccessDeniedException,
UnsupportedRepositoryOperationException,
VersionException,
RepositoryException
UnsupportedRepositoryOperationException - always.
ReferentialIntegrityException
AccessDeniedException
VersionException
RepositoryException
public void restore(SessionInfo sessionInfo,
NodeId nodeId,
NodeId versionId,
boolean removeExisting)
throws VersionException,
PathNotFoundException,
ItemExistsException,
UnsupportedRepositoryOperationException,
LockException,
InvalidItemStateException,
RepositoryException
UnsupportedRepositoryOperationException - always.
VersionException
PathNotFoundException
ItemExistsException
LockException
InvalidItemStateException
RepositoryException
public void restore(SessionInfo sessionInfo,
NodeId[] versionIds,
boolean removeExisting)
throws ItemExistsException,
UnsupportedRepositoryOperationException,
VersionException,
LockException,
InvalidItemStateException,
RepositoryException
UnsupportedRepositoryOperationException - always.
ItemExistsException
VersionException
LockException
InvalidItemStateException
RepositoryException
public Iterator merge(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName,
boolean bestEffort)
throws NoSuchWorkspaceException,
AccessDeniedException,
MergeException,
LockException,
InvalidItemStateException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException
public void resolveMergeConflict(SessionInfo sessionInfo,
NodeId nodeId,
NodeId[] mergeFailedIds,
NodeId[] predecessorIds)
throws VersionException,
InvalidItemStateException,
UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
VersionException
InvalidItemStateException
RepositoryException
public void addVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label,
boolean moveLabel)
throws VersionException,
RepositoryException
UnsupportedRepositoryOperationException - always.
VersionException
RepositoryException
public void removeVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label)
throws VersionException,
RepositoryException
UnsupportedRepositoryOperationException - always.
VersionException
RepositoryException
public EventFilter createEventFilter(SessionInfo sessionInfo,
int eventTypes,
Path absPath,
boolean isDeep,
String[] uuid,
Name[] nodeTypeName,
boolean noLocal)
throws UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public Subscription createSubscription(SessionInfo sessionInfo,
EventFilter[] filters)
throws UnsupportedRepositoryOperationException,
RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public void updateEventFilters(Subscription subscription,
EventFilter[] filters)
throws RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public EventBundle[] getEvents(Subscription subscription,
long timeout)
throws RepositoryException,
InterruptedException
UnsupportedRepositoryOperationException - always.
RepositoryException
InterruptedException
public void dispose(Subscription subscription)
throws RepositoryException
UnsupportedRepositoryOperationException - always.
RepositoryException
public void registerNamespace(SessionInfo sessionInfo,
String prefix,
String uri)
throws NamespaceException,
UnsupportedRepositoryOperationException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NamespaceException
AccessDeniedException
RepositoryException
public void unregisterNamespace(SessionInfo sessionInfo,
String uri)
throws NamespaceException,
UnsupportedRepositoryOperationException,
AccessDeniedException,
RepositoryException
UnsupportedRepositoryOperationException - always.
NamespaceException
AccessDeniedException
RepositoryException
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo)
throws RepositoryException
RepositoryException
public void checkQueryStatement(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
throws InvalidQueryException,
RepositoryException
InvalidQueryException
RepositoryException
public QueryInfo executeQuery(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
throws RepositoryException
RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||