public abstract class AbstractRepositoryService extends java.lang.Object implements RepositoryService
AbstractRepositoryService
provides an abstract base class for
repository service implementations. This class provides default
implementations for the following methods:
Constructor and Description |
---|
AbstractRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors,
java.util.Map<java.lang.String,java.lang.String> namespaces,
QNodeTypeDefinition[] nodeTypeDefs) |
AbstractRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors,
java.util.Map<java.lang.String,java.lang.String> namespaces,
java.io.Reader cnd) |
Modifier and Type | Method and Description |
---|---|
void |
addVersionLabel(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId,
Name label,
boolean moveLabel)
Add the given version label in the persistent layer.
|
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 |
checkout(SessionInfo sessionInfo,
NodeId nodeId,
NodeId activityId)
Performs a checkout for the
Node identified by the given
NodeId and for activity identified by the specified
activityId . |
NodeId |
checkpoint(SessionInfo sessionInfo,
NodeId nodeId)
Performs a checkpoint for the
Node identified by the given
NodeId . |
NodeId |
checkpoint(SessionInfo sessionInfo,
NodeId nodeId,
NodeId activityId)
Performs a checkpoint for the
Node identified by the given
NodeId . |
java.lang.String[] |
checkQueryStatement(SessionInfo sessionInfo,
java.lang.String statement,
java.lang.String language,
java.util.Map<java.lang.String,java.lang.String> namespaces)
Checks if the query
statement is valid according to the
specified query language and returns the bind variable
names found in the query statement. |
void |
clone(SessionInfo sessionInfo,
java.lang.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,
java.lang.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 . |
NodeId |
createActivity(SessionInfo sessionInfo,
java.lang.String title)
Create a new activity.
|
Batch |
createBatch(SessionInfo sessionInfo,
ItemId itemId)
Indicates the start of a set of operations that cause modifications
on the underlying persistence layer.
|
NodeId |
createConfiguration(SessionInfo sessionInfo,
NodeId nodeId) |
EventFilter |
createEventFilter(SessionInfo sessionInfo,
int eventTypes,
Path absPath,
boolean isDeep,
java.lang.String[] uuid,
Name[] nodeTypeName,
boolean noLocal)
Creates an event filter.
|
Subscription |
createSubscription(SessionInfo sessionInfo,
EventFilter[] filters)
Creates a new
Subscription for events with an initial set of
EventFilter s. |
Tree |
createTree(SessionInfo sessionInfo,
Batch batch,
Name nodeName,
Name primaryTypeName,
java.lang.String uniqueId)
Creates a new
Tree that can be populated and later on be applied
to the specified Batch by calling #setTree . |
void |
createWorkspace(SessionInfo sessionInfo,
java.lang.String name,
java.lang.String srcWorkspaceName)
Create a new workspace with the specified
name . |
void |
deleteWorkspace(SessionInfo sessionInfo,
java.lang.String name)
Deletes the workspace with the specified
name . |
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,
java.lang.String statement,
java.lang.String language,
java.util.Map<java.lang.String,java.lang.String> namespaces,
long limit,
long offset,
java.util.Map<java.lang.String,QValue> values)
Execute the given query statement with the specified query language.
|
EventBundle |
getEvents(SessionInfo sessionInfo,
EventFilter filter,
long after)
Returns events from the
EventJournal after a given point in
time. |
EventBundle[] |
getEvents(Subscription subscription,
long timeout)
Retrieves the events that occurred since the last call to this method for
the passed subscription.
|
IdFactory |
getIdFactory()
Return the
IdFactory . |
LockInfo |
getLockInfo(SessionInfo sessionInfo,
NodeId nodeId)
Returns the lock information that applies to
Node identified
by the given NodeId or null . |
NameFactory |
getNameFactory()
Return the
NameFactory . |
java.lang.String |
getNamespacePrefix(SessionInfo sessionInfo,
java.lang.String uri)
This default implementation first calls
checkSessionInfo(SessionInfo)
with the sessionInfo , then return the namespace prefix for
the given uri . |
java.lang.String |
getNamespaceURI(SessionInfo sessionInfo,
java.lang.String prefix)
This default implementation first calls
checkSessionInfo(SessionInfo)
with the sessionInfo , then returns the namespace 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 . |
PathFactory |
getPathFactory()
Return the
PathFactory . |
QPropertyDefinition |
getPropertyDefinition(SessionInfo sessionInfo,
PropertyId propertyId)
Returns the
QPropertyDefinition for the Property
identified by the given id. |
java.util.Iterator<QNodeTypeDefinition> |
getQNodeTypeDefinitions(SessionInfo sessionInfo)
This default implementation first calls
checkSessionInfo(SessionInfo)
with the sessionInfo , |
java.util.Iterator<QNodeTypeDefinition> |
getQNodeTypeDefinitions(SessionInfo sessionInfo,
Name[] nodetypeNames)
This default implementation first calls
checkSessionInfo(SessionInfo)
with the sessionInfo , then gathers the QNodeTypeDefinition s
with the given nodetypeNames . |
QValueFactory |
getQValueFactory()
Return the
QValueFactory defined with this SPI implementation. |
java.util.Map<java.lang.String,java.lang.String> |
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. |
java.util.Map<java.lang.String,QValue[]> |
getRepositoryDescriptors()
This default implementation returns the descriptors that were passed
to the constructor of this repository service.
|
java.lang.String[] |
getSupportedQueryLanguages(SessionInfo sessionInfo)
Returns a String array identifying all query languages supported by this
SPI implementation.
|
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,
java.io.InputStream xmlStream,
int uuidBehaviour)
Imports the data present in the given
InputStream into the
persistent layer. |
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,
java.lang.String ownerHint)
Create a lock on the
Node identified by the given id. |
java.util.Iterator<NodeId> |
merge(SessionInfo sessionInfo,
NodeId nodeId,
java.lang.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 . |
java.util.Iterator<NodeId> |
merge(SessionInfo sessionInfo,
NodeId nodeId,
java.lang.String srcWorkspaceName,
boolean bestEffort,
boolean isShallow)
Merge the node identified by the given
NodeId and its subtree
with the corresponding node present in the workspace with the name of
srcWorkspaceName . |
java.util.Iterator<NodeId> |
mergeActivity(SessionInfo sessionInfo,
NodeId activityId)
Merges the activity identified by the given
activityId into
the workspace the specified sessionInfo has been created for. |
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,
java.lang.String workspaceName)
This default implementation does:
calls
checkCredentials(Credentials, String)
calls checkWorkspace(String)
calls createSessionInfo(Credentials, String)
|
void |
refreshLock(SessionInfo sessionInfo,
NodeId nodeId)
Explicit refresh of an existing lock.
|
void |
registerNamespace(SessionInfo sessionInfo,
java.lang.String prefix,
java.lang.String uri)
Register a new namespace with the given prefix and uri.
|
void |
registerNodeTypes(SessionInfo sessionInfo,
QNodeTypeDefinition[] nodeTypeDefinitions,
boolean allowUpdate)
Registers the node types with the specified
QNodeTypeDefinition s. |
void |
removeActivity(SessionInfo sessionInfo,
NodeId activityId)
Removes the activity identified by the specified
activityId . |
void |
removeVersion(SessionInfo sessionInfo,
NodeId versionHistoryId,
NodeId versionId)
Remove the version identified 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,
java.lang.String uri)
Unregister the namespace identified by the given uri
|
void |
unregisterNodeTypes(SessionInfo sessionInfo,
Name[] nodeTypeNames)
Unregisters the node types with the specified
names . |
void |
update(SessionInfo sessionInfo,
NodeId nodeId,
java.lang.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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildInfos, getItemInfoCache, getItemInfos, getNodeInfo, getPrivilegeDefinitions, getPrivilegeNames, getPropertyInfo, getReferences, getSupportedPrivileges, getWorkspaceNames, isGranted
public AbstractRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors, java.util.Map<java.lang.String,java.lang.String> namespaces, QNodeTypeDefinition[] nodeTypeDefs) throws RepositoryException
RepositoryException
public AbstractRepositoryService(java.util.Map<java.lang.String,QValue[]> descriptors, java.util.Map<java.lang.String,java.lang.String> namespaces, java.io.Reader cnd) throws RepositoryException
RepositoryException
public IdFactory getIdFactory() throws RepositoryException
RepositoryService
IdFactory
.getIdFactory
in interface RepositoryService
IdFactoryImpl.getInstance()
.RepositoryException
- if an error occurs.public NameFactory getNameFactory() throws RepositoryException
RepositoryService
NameFactory
.getNameFactory
in interface RepositoryService
NameFactoryImpl.getInstance()
.RepositoryException
- if an error occurs.public PathFactory getPathFactory() throws RepositoryException
RepositoryService
PathFactory
.getPathFactory
in interface RepositoryService
PathFactoryImpl.getInstance()
.RepositoryException
- if an error occurs.public QValueFactory getQValueFactory() throws RepositoryException
RepositoryService
QValueFactory
defined with this SPI implementation.getQValueFactory
in interface RepositoryService
QValueFactoryImpl.getInstance()
.RepositoryException
- if an error occurs.public java.util.Map<java.lang.String,QValue[]> getRepositoryDescriptors() throws RepositoryException
getRepositoryDescriptors
in interface RepositoryService
RepositoryException
javax.jcr.Repository#getDescriptorKeys()
,
javax.jcr.Repository#getDescriptor(String)
public SessionInfo obtain(Credentials credentials, java.lang.String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException
obtain
in interface RepositoryService
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 impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException
obtain(Credentials, String)
with the workspaceName taken from
the passed sessionInfo
.impersonate
in interface RepositoryService
SessionInfo
if impersonate was successful.LoginException
RepositoryException
javax.jcr.Session#impersonate(javax.jcr.Credentials)
public void dispose(SessionInfo sessionInfo) throws RepositoryException
dispose
in interface RepositoryService
RepositoryException
public java.util.Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
,getQNodeTypeDefinitions
in interface RepositoryService
QNodeTypeDefinition
s.RepositoryException
javax.jcr.Workspace#getNodeTypeManager()
,
javax.jcr.nodetype.NodeTypeManager#getAllNodeTypes()
,
javax.jcr.nodetype.NodeTypeManager#getMixinNodeTypes()
,
javax.jcr.nodetype.NodeTypeManager#getPrimaryNodeTypes()
,
javax.jcr.nodetype.NodeTypeManager#getNodeType(String)
public java.util.Iterator<QNodeTypeDefinition> 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.getQNodeTypeDefinitions
in interface RepositoryService
nodetypeNames
- names of node types to retrieveQNodeTypeDefinition
RepositoryException
javax.jcr.Workspace#getNodeTypeManager()
,
javax.jcr.nodetype.NodeTypeManager#getAllNodeTypes()
,
javax.jcr.nodetype.NodeTypeManager#getMixinNodeTypes()
,
javax.jcr.nodetype.NodeTypeManager#getPrimaryNodeTypes()
,
javax.jcr.nodetype.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
.getNodeDefinition
in interface RepositoryService
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.getPropertyDefinition
in interface RepositoryService
Property
identified by the given id.UnsupportedRepositoryOperationException
- always.RepositoryException
public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
QNodeTypeDefinition
s.
If allowUpdate
is true
this method may also be
used to reregister existing node types with a modified definition, otherwise
this method will fail with NodeTypeExistsException
if any of
the specified definition has the name of an already registered node type.registerNodeTypes
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.InvalidNodeTypeDefinitionException
- If any of the specified definitions
is invalid.NodeTypeExistsException
- If any of the specified definitions has the
name of an already registered node type and allowUpdate
is false
.RepositoryException
- If another error occurs.javax.jcr.nodetype.NodeTypeManager#registerNodeTypes(javax.jcr.nodetype.NodeTypeDefinition[], boolean)
public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException
RepositoryService
names
.unregisterNodeTypes
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.NoSuchNodeTypeException
- If any of the specified names has no
corresponding registered node type.RepositoryException
- If another error occurs.javax.jcr.nodetype.NodeTypeManager#unregisterNodeTypes(String[])
public java.util.Map<java.lang.String,java.lang.String> 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.getRegisteredNamespaces
in interface RepositoryService
RepositoryException
javax.jcr.Workspace#getNamespaceRegistry()
,
javax.jcr.NamespaceRegistry#getPrefixes()
,
javax.jcr.NamespaceRegistry#getURIs()
public java.lang.String getNamespaceURI(SessionInfo sessionInfo, java.lang.String prefix) throws NamespaceException, RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
, then returns the namespace URI for the
given prefix
.getNamespaceURI
in interface RepositoryService
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.javax.jcr.NamespaceRegistry#getURI(String)
public java.lang.String getNamespacePrefix(SessionInfo sessionInfo, java.lang.String uri) throws NamespaceException, RepositoryException
checkSessionInfo(SessionInfo)
with the sessionInfo
, then return the namespace prefix for
the given uri
.getNamespacePrefix
in interface RepositoryService
sessionInfo
- the session info.uri
- the namespace URI.NamespaceException
- if the URI unknown.RepositoryException
- if another error occurs.javax.jcr.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)
.createBatch
in interface RepositoryService
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
javax.jcr.Item#save()
,
javax.jcr.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.submit
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
RepositoryException
Batch
public Tree createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, java.lang.String uniqueId) throws RepositoryException
RepositoryService
Tree
that can be populated and later on be applied
to the specified Batch
by calling #setTree
.createTree
in interface RepositoryService
Tree
instance.UnsupportedRepositoryOperationException
- always.RepositoryException
public void importXml(SessionInfo sessionInfo, NodeId parentId, java.io.InputStream xmlStream, int uuidBehaviour) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
InputStream
into the
persistent layer. Note, that the implementation is responsible for
validating the data presented and for the integrity of the repository
upon completion.importXml
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
javax.jcr.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
).move
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
RepositoryException
javax.jcr.Workspace#move(String, String)
public void copy(SessionInfo sessionInfo, java.lang.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.
copy
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
javax.jcr.Workspace#copy(String, String)
,
javax.jcr.Workspace#copy(String, String, String)
public void update(SessionInfo sessionInfo, NodeId nodeId, java.lang.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
.update
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
javax.jcr.Node#update(String)
public void clone(SessionInfo sessionInfo, java.lang.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
.clone
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
javax.jcr.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.lock
in interface RepositoryService
LockInfo
associated with the new lock
that has been created.UnsupportedRepositoryOperationException
- always.LockException
AccessDeniedException
RepositoryException
javax.jcr.Node#lock(boolean, boolean)
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, java.lang.String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
Node
identified by the given id.lock
in interface RepositoryService
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
AccessDeniedException
RepositoryException
javax.jcr.lock.LockManager#lock(String, boolean, boolean, long, String)
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
.getLockInfo
in interface RepositoryService
null
.AccessDeniedException
RepositoryException
Node#getLock()
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException
RepositoryService
refreshLock
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.LockException
AccessDeniedException
RepositoryException
javax.jcr.lock.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.
unlock
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.LockException
AccessDeniedException
RepositoryException
javax.jcr.Node#unlock()
public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
.checkin
in interface RepositoryService
NodeId
of newly created versionUnsupportedRepositoryOperationException
- always.VersionException
InvalidItemStateException
LockException
RepositoryException
javax.jcr.Node#checkin()
public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
. Same as RepositoryService.checkout(SessionInfo, NodeId, NodeId)
where the activityId
is null
.checkout
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.LockException
RepositoryException
javax.jcr.Node#checkout()
public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
and for activity identified by the specified
activityId
. If the activityId
is null
this corresponds to RepositoryService.checkout(SessionInfo, NodeId)
checkout
in interface RepositoryService
activityId
- Id of the activity node set to the editing session or
null
if no activity is in effect.UnsupportedRepositoryOperationException
- always.LockException
RepositoryException
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
.checkpoint
in interface RepositoryService
NodeId
of newly created versionUnsupportedRepositoryOperationException
- always.LockException
RepositoryException
javax.jcr.version.VersionManager#checkpoint(String)
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException
RepositoryService
Node
identified by the given
NodeId
. For the checkout part the specified activityId
is taken into account as specified in RepositoryService.checkout(SessionInfo, NodeId, NodeId)
.checkpoint
in interface RepositoryService
activityId
- Id of the activity node set to the editing session or
null
if no activity is in effect.UnsupportedRepositoryOperationException
- always.LockException
RepositoryException
public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException
RepositoryService
versionId
.removeVersion
in interface RepositoryService
versionHistoryId
- NodeId
identifying the version
history the version identified by versionId
belongs to.UnsupportedRepositoryOperationException
- always.ReferentialIntegrityException
AccessDeniedException
VersionException
RepositoryException
javax.jcr.version.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
.restore
in interface RepositoryService
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 fails.UnsupportedRepositoryOperationException
- always.VersionException
PathNotFoundException
ItemExistsException
LockException
InvalidItemStateException
RepositoryException
javax.jcr.Node#restore(String, boolean)
,
javax.jcr.Node#restore(javax.jcr.version.Version, boolean)
,
javax.jcr.Node#restore(javax.jcr.version.Version, String, boolean)
,
javax.jcr.Node#restoreByLabel(String, boolean)
public void restore(SessionInfo sessionInfo, NodeId[] versionIds, boolean removeExisting) throws ItemExistsException, UnsupportedRepositoryOperationException, VersionException, LockException, InvalidItemStateException, RepositoryException
RepositoryService
NodeId
s.restore
in interface RepositoryService
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 fails.UnsupportedRepositoryOperationException
- always.ItemExistsException
VersionException
LockException
InvalidItemStateException
RepositoryException
javax.jcr.Workspace#restore(javax.jcr.version.Version[], boolean)
public java.util.Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, java.lang.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
.merge
in interface RepositoryService
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
javax.jcr.Node#merge(String, boolean)
public java.util.Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, java.lang.String srcWorkspaceName, boolean bestEffort, boolean isShallow) 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
.merge
in interface RepositoryService
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
javax.jcr.version.VersionManager#merge(String, String, boolean, boolean)
public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
NodeId
.resolveMergeConflict
in interface RepositoryService
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
javax.jcr.Node#cancelMerge(javax.jcr.version.Version)
,
javax.jcr.Node#doneMerge(javax.jcr.version.Version)
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws VersionException, RepositoryException
RepositoryService
addVersionLabel
in interface 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
javax.jcr.version.VersionHistory#addVersionLabel(String, String, boolean)
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException
RepositoryService
removeVersionLabel
in interface 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
javax.jcr.version.VersionHistory#removeVersionLabel(String)
public NodeId createActivity(SessionInfo sessionInfo, java.lang.String title) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
createActivity
in interface RepositoryService
NodeId
of the new activity node.UnsupportedRepositoryOperationException
- always.RepositoryException
javax.jcr.version.VersionManager#createActivity(String)
public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
activityId
.removeActivity
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.RepositoryException
javax.jcr.version.VersionManager#removeActivity(Node)
public java.util.Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
activityId
into
the workspace the specified sessionInfo
has been created for.mergeActivity
in interface RepositoryService
Iterator
over the NodeId
s of all nodes that
received a merge result of "fail" in the course of this operation.UnsupportedRepositoryOperationException
- always.RepositoryException
public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException
createConfiguration
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.RepositoryException
javax.jcr.version.VersionManager#createConfiguration(String)
public EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, java.lang.String[] uuid, Name[] nodeTypeName, boolean noLocal) throws UnsupportedRepositoryOperationException, RepositoryException
RepositoryService
javax.jcr.observation.ObservationManager#addEventListener
.
Note, that an SPI implementation may support observation even if
the corresponding repository descriptor
does not return 'true'.
createEventFilter
in interface RepositoryService
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.javax.jcr.observation.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[])
.createSubscription
in interface RepositoryService
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.
updateEventFilters
in interface RepositoryService
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, java.lang.InterruptedException
RepositoryService
Note, that an SPI implementation may support observation even if the
corresponding 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.
getEvents
in interface RepositoryService
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.java.lang.InterruptedException
- if the calling thread is interrupted while
waiting for events within the specified
timeout
.public EventBundle getEvents(SessionInfo sessionInfo, EventFilter filter, long after) throws RepositoryException, UnsupportedRepositoryOperationException
RepositoryService
EventJournal
after a given point in
time. The returned event bundle may only contain events up to a given
time. In order to retrieve more events a client must call this method
again with the timestamp from the last event bundle. An empty bundle
indicates that there are no more events.getEvents
in interface RepositoryService
sessionInfo
- the session info.filter
- the event filter to apply. Please note: the
noLocal
flag is ignored.after
- retrieve events that occurred after the given
timestamp.UnsupportedRepositoryOperationException
- always.RepositoryException
- if an error occurs.public void dispose(Subscription subscription) throws RepositoryException
RepositoryService
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.
dispose
in interface RepositoryService
UnsupportedRepositoryOperationException
- always.RepositoryException
- if an error occurs while the subscription is
disposed.public void registerNamespace(SessionInfo sessionInfo, java.lang.String prefix, java.lang.String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
RepositoryService
registerNamespace
in interface RepositoryService
prefix
- Prefix of the namespace to be registered.uri
- Namespace URI to be registered.UnsupportedRepositoryOperationException
- always.NamespaceException
AccessDeniedException
RepositoryException
javax.jcr.NamespaceRegistry#registerNamespace(String, String)
public void unregisterNamespace(SessionInfo sessionInfo, java.lang.String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException
RepositoryService
unregisterNamespace
in interface RepositoryService
uri
- Namespace URI to be unregistered.UnsupportedRepositoryOperationException
- always.NamespaceException
AccessDeniedException
RepositoryException
javax.jcr.NamespaceRegistry#unregisterNamespace(String)
public void createWorkspace(SessionInfo sessionInfo, java.lang.String name, java.lang.String srcWorkspaceName) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException
RepositoryService
name
. If
srcWorkspaceName
isn't null
the content of
that workspace is 'cloned' to the new workspace as inital content,
otherwise an empty workspace will be created.createWorkspace
in interface RepositoryService
name
- The name of the new workspace.srcWorkspaceName
- The name of the workspace from which the initial
content of the new workspace will be 'cloned'.UnsupportedRepositoryOperationException
- always.AccessDeniedException
NoSuchWorkspaceException
RepositoryException
javax.jcr.Workspace#createWorkspace(String)
,
javax.jcr.Workspace#createWorkspace(String, String)
public void deleteWorkspace(SessionInfo sessionInfo, java.lang.String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException
RepositoryService
name
.deleteWorkspace
in interface RepositoryService
name
- The name of the workspace to be deleted.UnsupportedRepositoryOperationException
- always.AccessDeniedException
NoSuchWorkspaceException
RepositoryException
javax.jcr.Workspace#deleteWorkspace(String)
public java.lang.String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException
RepositoryService
getSupportedQueryLanguages
in interface RepositoryService
RepositoryException
javax.jcr.query.QueryManager#getSupportedQueryLanguages()
public java.lang.String[] checkQueryStatement(SessionInfo sessionInfo, java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,java.lang.String> namespaces) throws InvalidQueryException, RepositoryException
RepositoryService
statement
is valid according to the
specified query language
and returns the bind variable
names found in the query statement.checkQueryStatement
in interface RepositoryService
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.javax.jcr.query.QueryManager#createQuery(String, String)
public QueryInfo executeQuery(SessionInfo sessionInfo, java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,java.lang.String> namespaces, long limit, long offset, java.util.Map<java.lang.String,QValue> values) 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.executeQuery
in interface RepositoryService
sessionInfo
- the session info that wants to execute the query.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
.limit
- The maximum result size or -1
is no
maximum is set.offset
- The offset in the total result set or -1
is no offset is set.values
- A Map of name/value pairs collected upon calls to
javax.jcr.query.Query#bindValue(String,
javax.jcr.Value)
.RepositoryException
- if an error occurs.javax.jcr.query.Query#execute()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"