|
||||||||||
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)
Add the given version label in the persistent layer. |
protected abstract void |
checkCredentials(Credentials credentials,
String workspaceName)
Checks if the given credentials are valid. |
NodeId |
checkin(SessionInfo sessionInfo,
NodeId nodeId)
Performs a checkin for the Node identified by the given
NodeId . |
void |
checkout(SessionInfo sessionInfo,
NodeId nodeId)
Performs a checkout for the Node identified by the given
NodeId . |
void |
checkQueryStatement(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
Checks if the query statement is valid according to the
specified query language . |
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)
Clone the subtree identified by the given srcNodeId
in workspace named srcWorkspaceName to the destination
in the workspace specified by the given SessionInfo . |
void |
copy(SessionInfo sessionInfo,
String srcWorkspaceName,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
Clone the subtree identified by the given srcNodeId
in workspace named srcWorkspaceName to the destination
in the workspace specified by the given SessionInfo . |
Batch |
createBatch(SessionInfo sessionInfo,
ItemId itemId)
Indicates the start of a set of operations that cause modifications on the underlying persistence layer. |
EventFilter |
createEventFilter(SessionInfo sessionInfo,
int eventTypes,
Path absPath,
boolean isDeep,
String[] uuid,
Name[] nodeTypeName,
boolean noLocal)
Creates an event filter. |
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)
Creates a new Subscription for events with an initial set of
EventFilter s. |
void |
dispose(SessionInfo sessionInfo)
This default implementation does nothing. |
void |
dispose(Subscription subscription)
Indicates that the passed subscription is no longer needed. |
QueryInfo |
executeQuery(SessionInfo sessionInfo,
String statement,
String language,
Map namespaces)
Execute the given query statement with the specified query language. |
EventBundle[] |
getEvents(Subscription subscription,
long timeout)
Retrieves the events that occurred since the last call to this method for the passed subscription. |
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)
Returns the lock information that applies to Node identified
by the given NodeId or null . |
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)
Returns the QPropertyDefinition for the Property
identified by the given id. |
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 QNodeTypeDefinition s
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)
Returns a String array identifying all query languages supported by this SPI implementation. |
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)
Imports the data present in the given InputStream into the
persistent layer. |
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)
Create a lock on the Node identified by the given id. |
LockInfo |
lock(SessionInfo sessionInfo,
NodeId nodeId,
boolean deep,
boolean sessionScoped,
long timeoutHint,
String ownerHint)
Create a lock on the Node identified by the given id. |
Iterator |
merge(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName,
boolean bestEffort)
Merge the node identified by the given NodeId and its subtree
with the corresponding node present in the workspace with the name of
srcWorkspaceName . |
void |
move(SessionInfo sessionInfo,
NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
Moves the node identified by the given srcNodeId (and its
entire subtree) to the new location defined by destParentNodeId
and a new 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 . |
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)
Explicit refresh of an existing lock. |
void |
registerNamespace(SessionInfo sessionInfo,
String prefix,
String uri)
Register a new namespace with the given prefix and uri. |
void |
removeVersion(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId)
Remove the version inditified by the specified versionId . |
void |
removeVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label)
Remove the given version label in the persistent layer. |
void |
resolveMergeConflict(SessionInfo sessionInfo,
NodeId nodeId,
NodeId[] mergeFailedIds,
NodeId[] predecessorIds)
Resolve an existing merge conflict present with the node identified by the given NodeId . |
void |
restore(SessionInfo sessionInfo,
NodeId[] versionIds,
boolean removeExisting)
Restore multiple versions at once. |
void |
restore(SessionInfo sessionInfo,
NodeId nodeId,
NodeId versionId,
boolean removeExisting)
Restores the node identified by nodeId to the state defined
by the version with the specified versionId . |
void |
submit(Batch batch)
Completes the given Batch or discard all the previous modifications. |
void |
unlock(SessionInfo sessionInfo,
NodeId nodeId)
Releases the lock on the Node identified by the given
NodeId . |
void |
unregisterNamespace(SessionInfo sessionInfo,
String uri)
Unregister the namespace identified by the given uri |
void |
update(SessionInfo sessionInfo,
NodeId nodeId,
String srcWorkspaceName)
Updates the node identified by the given NodeId replacing
it (an the complete subtree) with a clone of its corresponding node
present in the workspace with the given srcWorkspaceName . |
void |
updateEventFilters(Subscription subscription,
EventFilter[] filters)
Updates events filters on the subscription. |
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
.
sessionInfo
- for another workspaceworkspaceName
- the name of the workspace the new SessionInfo
should be built for. If the specified workspaceName is null
the implementation should select a default workspace.
SessionInfo
if authentication was successful.
LoginException
- if authentication of the user fails.
NoSuchWorkspaceException
- if the specified workspaceName
is not recognized.
RepositoryException
- if an error occurs.public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException
obtain(Credentials, String)
with the workspaceName taken from
the passed sessionInfo
.
SessionInfo
if impersonate was successful.
LoginException
RepositoryException
Session.impersonate(javax.jcr.Credentials)
public void dispose(SessionInfo sessionInfo) throws RepositoryException
RepositoryException
public Iterator getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws ItemNotFoundException, RepositoryException
RepositoryService.getNodeInfo(SessionInfo, NodeId)
.
Iterator
of ItemInfo
s containing
at least a single element: the NodeInfo
that represents
the Node identified by the given NodeId
. If the Iterator
contains multiple elements, the first is expected to represent the Node
identified by the given NodeId
.
ItemNotFoundException
RepositoryException
Session.getItem(String)
,
Node.getNode(String)
,
VersionHistory.getAllVersions()
,
VersionHistory.getVersion(String)
,
VersionHistory.getVersionByLabel(String)
,
VersionHistory.getRootVersion()
,
Node.getBaseVersion()
,
Node.getVersionHistory()
,
Version.getContainingHistory()
public Map getRepositoryDescriptors() throws RepositoryException
RepositoryException
Repository.getDescriptorKeys()
,
Repository.getDescriptor(String)
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
Workspace.getAccessibleWorkspaceNames()
,
Workspace.getName()
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
.
SessionInfo
has
the specified rights for the given item.
RepositoryException
Session.checkPermission(String, String)
public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
,
QNodeTypeDefinition
s.
RepositoryException
Workspace.getNodeTypeManager()
,
NodeTypeManager.getAllNodeTypes()
,
NodeTypeManager.getMixinNodeTypes()
,
NodeTypeManager.getPrimaryNodeTypes()
,
NodeTypeManager.getNodeType(String)
public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
, then gathers the QNodeTypeDefinition
s
with the given nodetypeNames
. If one of the nodetypeNames
is not a valid node type definition then a RepositoryException
is thrown.
nodetypeNames
- names of node types to retrieve
QNodeTypeDefinition
NoSuchNodeTypeException
- if for any of the given
names no QNodeTypeDefinition
exists.
RepositoryException
Workspace.getNodeTypeManager()
,
NodeTypeManager.getAllNodeTypes()
,
NodeTypeManager.getMixinNodeTypes()
,
NodeTypeManager.getPrimaryNodeTypes()
,
NodeTypeManager.getNodeType(String)
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
.
Node
identified
by the given id.
RepositoryException
public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException
RepositoryService
QPropertyDefinition
for the Property
identified by the given id. This method should only be used if the
caller is not able to unambiguously determine the applicable definition
from the parent node type definition.
Property
identified by the given id.
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
Workspace.getNamespaceRegistry()
,
NamespaceRegistry.getPrefixes()
,
NamespaceRegistry.getURIs()
public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
, then returns the namepsace URI for the
given prefix
.
sessionInfo
- the session info.prefix
- a namespace prefix to resolve.
prefix
.
NamespaceException
- if prefix is not mapped to a namespace URI.
RepositoryException
- if another error occurs.NamespaceRegistry.getURI(String)
public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
, then return the namespace prefix for
the given uri
.
sessionInfo
- the session info.uri
- the namespace URI.
NamespaceException
- if the URI unknown.
RepositoryException
- if another error occurs.NamespaceRegistry.getPrefix(String)
public Batch createBatch(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException
RepositoryService
Batch
must be executed at once or non must be executed upon
calling RepositoryService.submit(Batch)
.
itemId
- Id of the Item that is a common ancestor of all
Item
s affected upon batch execution. This Item
might itself be modified within the scope of the Batch
.
RepositoryService.submit(Batch)
.
UnsupportedRepositoryOperationException
- always.
RepositoryException
Item.save()
,
Session.save()
,
Batch
public void submit(Batch batch) throws PathNotFoundException, ItemNotFoundException, NoSuchNodeTypeException, ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
Batch
or discard all the previous modifications.
See RepositoryService.createBatch(SessionInfo,ItemId)
for additional information
regarding batch creation.
UnsupportedRepositoryOperationException
- always.
PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
Batch
public void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
InputStream
into the
persistent layer. Note, that the implemenation is responsible for
validating the data presented and for the integrity of the repository
upon completion.
UnsupportedRepositoryOperationException
- always.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
Workspace.importXML(String, java.io.InputStream, int)
public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
srcNodeId
(and its
entire subtree) to the new location defined by destParentNodeId
and a new name (destName
).
UnsupportedRepositoryOperationException
- always.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
Workspace.move(String, String)
public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
srcNodeId
in workspace named srcWorkspaceName
to the destination
in the workspace specified by the given SessionInfo
. The
destination is composed by the given parent id and the new name
as indicated by destName
.
Note, that srcWorkspaceName
may be the same as the one
specified within the SessionInfo
. In this case the copy
corresponds to a copy within a single workspace.
UnsupportedRepositoryOperationException
- always.
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
Workspace.copy(String, String)
,
Workspace.copy(String, String, String)
public void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException
RepositoryService
NodeId
replacing
it (an the complete subtree) with a clone of its corresponding node
present in the workspace with the given srcWorkspaceName
.
UnsupportedRepositoryOperationException
- always.
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
Node.update(String)
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
RepositoryService
srcNodeId
in workspace named srcWorkspaceName
to the destination
in the workspace specified by the given SessionInfo
. The
destination is composed by the given parent id and the new name
as indicated by destName
.
UnsupportedRepositoryOperationException
- always.
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
Workspace.clone(String, String, String, boolean)
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
Node
identified by the given id.
LockInfo
associated with the new lock
that has been created.
UnsupportedRepositoryOperationException
- always.
LockException
- If the Node identified by the given
id cannot be locked due to an existing lock or due to missing mixin type.
AccessDeniedException
RepositoryException
- If another error occurs.Node.lock(boolean, boolean)
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
Node
identified by the given id.
timeoutHint
- long indicating the desired lock timeout in seconds.
The implementation is free to ignore the hint.ownerHint
- String indicating the desired lockOwner info. The
implementation is free to ignore the hint.
LockInfo
associated with the new lock
that has been created.
UnsupportedRepositoryOperationException
- always.
LockException
- If the Node identified by the given
id cannot be locked due to an existing lock or due to missing mixin type.
AccessDeniedException
RepositoryException
- If another error occurs.LockManager
public LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId) throws AccessDeniedException, RepositoryException
RepositoryService
Node
identified
by the given NodeId
or null
. If the implementation
does not support locking at all, this method always returns null
.
null
.
AccessDeniedException
RepositoryException
- If some other error occurs.Node.getLock()
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
UnsupportedRepositoryOperationException
- always.
LockException
- If the Node identified by the given
id is not locked (any more) or if the SessionInfo
does not
contain the token associated with the lock to be refreshed.
AccessDeniedException
RepositoryException
- If another error occurs.Lock
public void unlock(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
.
Please note, that on logout
all
session-scoped locks must be released by calling unlock.
UnsupportedRepositoryOperationException
- always.
LockException
- If the Node identified by the given
id is not locked or if the SessionInfo
does not contain the
token associated with the lock to be released.
AccessDeniedException
RepositoryException
- If another error occurs.Node.unlock()
public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
.
NodeId
of newly created version
UnsupportedRepositoryOperationException
- always.
VersionException
InvalidItemStateException
LockException
RepositoryException
Node.checkin()
public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
.
UnsupportedRepositoryOperationException
- always.
LockException
RepositoryException
Node.checkout()
public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException
RepositoryService
versionId
.
versionHistoryId
- NodeId
identifying the version
history the version identified by versionId
belongs to.
UnsupportedRepositoryOperationException
- always.
ReferentialIntegrityException
AccessDeniedException
VersionException
RepositoryException
VersionHistory.removeVersion(String)
public void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) throws VersionException, PathNotFoundException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException
RepositoryService
nodeId
to the state defined
by the version with the specified versionId
.
removeExisting
- boolean flag indicating how to deal with an
identifier collision that may occur if a node exists outside the subtree
to be restored with the same identified as a node that would be
introduces by the restore. If the removeExisting
is
true
the restored node takes precedence and the
existing node is removed. Otherwise the restore failes.
UnsupportedRepositoryOperationException
- always.
VersionException
PathNotFoundException
ItemExistsException
LockException
InvalidItemStateException
RepositoryException
Node.restore(String, boolean)
,
Node.restore(javax.jcr.version.Version, boolean)
,
Node.restore(javax.jcr.version.Version, String, boolean)
,
Node.restoreByLabel(String, boolean)
public void restore(SessionInfo sessionInfo, NodeId[] versionIds, boolean removeExisting) throws ItemExistsException, UnsupportedRepositoryOperationException, VersionException, LockException, InvalidItemStateException, RepositoryException
RepositoryService
NodeId
s.
removeExisting
- boolean flag indicating how to deal with an
identifier collision that may occur if a node exists outside the subtrees
to be restored with the same identified as any node that would be
introduces by the restore. If the removeExisting
is
true
the node to be restored takes precedence and the
existing node is removed. Otherwise the restore failes.
UnsupportedRepositoryOperationException
- always.
ItemExistsException
VersionException
LockException
InvalidItemStateException
RepositoryException
Workspace.restore(javax.jcr.version.Version[], boolean)
public Iterator merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException
RepositoryService
NodeId
and its subtree
with the corresponding node present in the workspace with the name of
srcWorkspaceName
.
Iterator
over the NodeId
s of all nodes that
received a merge result of "fail" in the course of this operation.
UnsupportedRepositoryOperationException
- always.
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException
Node.merge(String, boolean)
public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
NodeId
.
mergeFailedIds
- The NodeId
s remaining in the jcr:mergeFailed
REFERENCE property. The version id(s) to be resolved were removed from the
array and added to the predecessor ids in case of Node.doneMerge(Version)
.
In case of a Node.cancelMerge(Version)
the version id only gets
removed from the list.predecessorIds
- The complete set of predecessor id including those
that have been added in order to resolve a merge conflict.
UnsupportedRepositoryOperationException
- always.
VersionException
InvalidItemStateException
RepositoryException
Node.cancelMerge(javax.jcr.version.Version)
,
Node.doneMerge(javax.jcr.version.Version)
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws VersionException, RepositoryException
RepositoryService
versionHistoryId
- NodeId
identifying the version
history the version identified by versionId
belongs to.versionId
- NodeId
identifying the version the
label belongs to.label
- The label to be added.moveLabel
- If the label is already assigned to a version within
the same version history this parameter has the following effect: If true
the label already present gets moved to be now be a label of the version
indicated by versionId
. If false
this method
fails and the label remains with the original version.
UnsupportedRepositoryOperationException
- always.
VersionException
RepositoryException
VersionHistory.addVersionLabel(String, String, boolean)
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException
RepositoryService
versionHistoryId
- NodeId
identifying the version
history the version identified by versionId
belongs to.versionId
- NodeId
identifying the version the
label belongs to.label
- The label to be removed.
UnsupportedRepositoryOperationException
- always.
VersionException
RepositoryException
VersionHistory.removeVersionLabel(String)
public EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] nodeTypeName, boolean noLocal) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, java.lang.String, boolean, java.lang.String[], java.lang.String[], boolean)
.
Note, that an SPI implementation may support observation even if
the corresponding repository descriptor
does not return 'true'.
sessionInfo
- the session info which requests an event filter.eventTypes
- A combination of one or more event type constants
encoded as a bitmask.absPath
- An absolute path.isDeep
- A boolean
.uuid
- Array of jcr:uuid properties.nodeTypeName
- Array of node type names.noLocal
- A boolean
.
UnsupportedRepositoryOperationException
- always.
RepositoryException
- if an error occurs while creating the
EventFilter.ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, String, boolean, String[], String[], boolean)
public Subscription createSubscription(SessionInfo sessionInfo, EventFilter[] filters) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
Subscription
for events with an initial set of
EventFilter
s. The returned subscription must provide events from
the time when the subscription was created. If an empty array of filters
is passed no events will be available through the created subscription
unless the filters are later updated by calling
RepositoryService.updateEventFilters(Subscription, EventFilter[])
.
sessionInfo
- the session info.filters
- the initial event filters for the subscription.
UnsupportedRepositoryOperationException
- always.
RepositoryException
- if an error occurs while creating the
Subscription.public void updateEventFilters(Subscription subscription, EventFilter[] filters) throws RepositoryException
RepositoryService
filters
.
An implementation is required to accept at least event filter instances
created by RepositoryService.createEventFilter(org.apache.jackrabbit.spi.SessionInfo, int, org.apache.jackrabbit.spi.Path, boolean, java.lang.String[], org.apache.jackrabbit.spi.Name[], boolean)
. Optionally an
implementation may also support event filters instanciated by the client
itself. An implementation may require special deployment in that case,
e.g. to make the event filter implementation class available to the
repository server.
Note on thread-safety: it is permissible to call this methods
while another thread is blocked in calling RepositoryService.getEvents(Subscription, long)
using the same
subscription instance as a parameter.
subscription
- the subscription where the event filters are
applied.filters
- the filters that are applied to the events as they
occurred on the repository. An event is included in an
event bundle if it is accept
ed by at least one of the supplied
filters. If an empty array is passed none of the potential
events are include in an event bundle. This allows a
client to skip or ignore events for a certain period of
time.
UnsupportedRepositoryOperationException
- always.
RepositoryException
- if an error occurs while updating the event
filters.public EventBundle[] getEvents(Subscription subscription, long timeout) throws RepositoryException, InterruptedException
RepositoryService
repository descriptor
does return 'false'.
An implementation should un-block a calling thread and let it return if
the associated subscription is disposed by another thread.
subscription
- a subscription.timeout
- a timeout in milliseconds to wait at most for an
event bundle. If timeout
is up and no
event occurred meanwhile an empty array is returned.
EventBundle
s representing the events
that occurred.
UnsupportedRepositoryOperationException
- always.
RepositoryException
- if an error occurs while retrieving the
event bundles.
InterruptedException
- if the calling thread is interrupted while
waiting for events within the specified
timeout
.public void dispose(Subscription subscription) throws RepositoryException
RepositoryService
RepositoryService.getEvents(Subscription, long)
using the same
subscription instance as a parameter.
UnsupportedRepositoryOperationException
- always.
RepositoryException
- if an error occurs while the subscription is
disposed.public void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
RepositoryService
prefix
- Prefix of the namespace to be registered.uri
- Namespace URI to be registered.
UnsupportedRepositoryOperationException
- always.
NamespaceException
AccessDeniedException
RepositoryException
NamespaceRegistry.registerNamespace(String, String)
public void unregisterNamespace(SessionInfo sessionInfo, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
RepositoryService
uri
- Namespace URI to be unregistered.
UnsupportedRepositoryOperationException
- always.
NamespaceException
AccessDeniedException
RepositoryException
NamespaceRegistry.unregisterNamespace(String)
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException
RepositoryService
RepositoryException
QueryManager.getSupportedQueryLanguages()
public void checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map namespaces) throws InvalidQueryException, RepositoryException
RepositoryService
statement
is valid according to the
specified query language
.
sessionInfo
- the session info.statement
- the query statement to check.language
- the query language.namespaces
- the locally re-mapped namespace which may be used in
the query statement
.
InvalidQueryException
- if the query statement is invalid or the
language is not supported.
RepositoryException
- if an error occurs while checking the
statement.QueryManager.createQuery(String, String)
public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map namespaces) throws RepositoryException
RepositoryService
namespaces
parameter provides a mapping of prefix
to namespace uri in order to be able to properly resolve prefix:localname
patterns present within the query statement.
statement
- the query statement to be execute.language
- the query language used to parse the query statement
.namespaces
- the locally re-mapped namespace which may be used in
the query statement
.
RepositoryException
Query.execute()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |