Class RepositoryServiceLogger
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.logging.AbstractLogger
-
- org.apache.jackrabbit.spi.commons.logging.RepositoryServiceLogger
-
- All Implemented Interfaces:
RepositoryService
public class RepositoryServiceLogger extends AbstractLogger implements RepositoryService
Log wrapper for aRepositoryService
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
AbstractLogger.Callable, AbstractLogger.SafeCallable
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
writer
-
-
Constructor Summary
Constructors Constructor Description RepositoryServiceLogger(RepositoryService service, LogWriter writer)
Create a new instance for the givenservice
which useswriter
for persisting log messages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theNode
identified by the givenNodeId
.void
checkout(SessionInfo sessionInfo, NodeId nodeId)
Performs a checkout for theNode
identified by the givenNodeId
.void
checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId)
Performs a checkout for theNode
identified by the givenNodeId
and for activity identified by the specifiedactivityId
.NodeId
checkpoint(SessionInfo sessionInfo, NodeId nodeId)
Performs a checkpoint for theNode
identified by the givenNodeId
.NodeId
checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId)
Performs a checkpoint for theNode
identified by the givenNodeId
.String[]
checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String,String> namespaces)
Checks if the querystatement
is valid according to the specified querylanguage
and returns the bind variable names found in the query statement.void
clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting)
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
.void
copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName)
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
.NodeId
createActivity(SessionInfo sessionInfo, 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, String[] uuid, Name[] qnodeTypeName, boolean noLocal)
Creates an event filter.Subscription
createSubscription(SessionInfo sessionInfo, EventFilter[] filters)
Creates a newSubscription
for events with an initial set ofEventFilter
s.Tree
createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId)
Creates a newTree
that can be populated and later on be applied to the specifiedBatch
by calling#setTree
.void
createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName)
Create a new workspace with the specifiedname
.void
deleteWorkspace(SessionInfo sessionInfo, String name)
Deletes the workspace with the specifiedname
.void
dispose(SessionInfo sessionInfo)
Indicates to theRepositoryService
, that the given SessionInfo will not be used any more.void
dispose(Subscription subscription)
Indicates that the passed subscription is no longer needed.QueryInfo
executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String,String> namespaces, long limit, long offset, Map<String,QValue> values)
Execute the given query statement with the specified query language.Iterator<ChildInfo>
getChildInfos(SessionInfo sessionInfo, NodeId parentId)
Returns an Iterator ofChildInfo
s present on the Node represented by the given parentId.EventBundle
getEvents(SessionInfo sessionInfo, EventFilter filter, long after)
Returns events from theEventJournal
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 theIdFactory
.ItemInfoCache
getItemInfoCache(SessionInfo sessionInfo)
Returns aItemInfoCache
for the givenSessionInfo
.Iterator<? extends ItemInfo>
getItemInfos(SessionInfo sessionInfo, ItemId itemId)
Method used to 'batch-read' from the persistent storage.LockInfo
getLockInfo(SessionInfo sessionInfo, NodeId nodeId)
Returns the lock information that applies toNode
identified by the givenNodeId
ornull
.NameFactory
getNameFactory()
Return theNameFactory
.String
getNamespacePrefix(SessionInfo sessionInfo, String uri)
Returns the namespace prefix for the given namespaceuri
.String
getNamespaceURI(SessionInfo sessionInfo, String prefix)
Returns the namespace URI for the given namespaceprefix
.QNodeDefinition
getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId)
Returns theQNodeDefinition
for theNode
identified by the given id.NodeInfo
getNodeInfo(SessionInfo sessionInfo, NodeId nodeId)
Retrieve theNodeInfo
for the node identified by the givenNodeId
.PathFactory
getPathFactory()
Return thePathFactory
.PrivilegeDefinition[]
getPrivilegeDefinitions(SessionInfo sessionInfo)
TODOName[]
getPrivilegeNames(SessionInfo sessionInfo, NodeId nodeId)
TODOQPropertyDefinition
getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId)
Returns theQPropertyDefinition
for theProperty
identified by the given id.PropertyInfo
getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId)
Returns thePropertyInfo
for theProperty
identified by the given id.Iterator<QNodeTypeDefinition>
getQNodeTypeDefinitions(SessionInfo sessionInfo)
Retrieve theQNodeTypeDefinition
s of all registered nodetypes.Iterator<QNodeTypeDefinition>
getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames)
RetrieveQNodeTypeDefinition
s for the given names.QValueFactory
getQValueFactory()
Return theQValueFactory
defined with this SPI implementation.Iterator<PropertyId>
getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences)
Returns theId
s of the properties that are referencing the node identified by the givennodeId
.Map<String,String>
getRegisteredNamespaces(SessionInfo sessionInfo)
Retrieve all registered namespaces.Map<String,QValue[]>
getRepositoryDescriptors()
Returns all property descriptors that can be exposed with theRepository
implementation built on top of thisRepositoryService
.RepositoryService
getRepositoryService()
PrivilegeDefinition[]
getSupportedPrivileges(SessionInfo sessionInfo, NodeId nodeId)
TODOString[]
getSupportedQueryLanguages(SessionInfo sessionInfo)
Returns a String array identifying all query languages supported by this SPI implementation.String[]
getWorkspaceNames(SessionInfo sessionInfo)
Return all workspace names available for the givenSessionInfo
.SessionInfo
impersonate(SessionInfo sessionInfo, Credentials credentials)
Returns aSessionInfo
that will be used by other methods on theRepositoryService
.void
importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour)
Imports the data present in the givenInputStream
into the persistent layer.boolean
isGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions)
Returns true if all actions defined in the specified array are granted to givenSessionInfo
.LockInfo
lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped)
Create a lock on theNode
identified by the given id.LockInfo
lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint)
Create a lock on theNode
identified by the given id.Iterator<NodeId>
merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort)
Merge the node identified by the givenNodeId
and its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName
.Iterator<NodeId>
merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow)
Merge the node identified by the givenNodeId
and its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName
.Iterator<NodeId>
mergeActivity(SessionInfo sessionInfo, NodeId activityId)
Merges the activity identified by the givenactivityId
into the workspace the specifiedsessionInfo
has been created for.void
move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName)
Moves the node identified by the givensrcNodeId
(and its entire subtree) to the new location defined bydestParentNodeId
and a new name (destName
).SessionInfo
obtain(Credentials credentials, String workspaceName)
Returns aSessionInfo
that will be used by other methods on theRepositoryService
.SessionInfo
obtain(SessionInfo sessionInfo, String workspaceName)
Returns a newSessionInfo
for the given workspace name that will be used by other methods on theRepositoryService
.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
registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate)
Registers the node types with the specifiedQNodeTypeDefinition
s.void
removeActivity(SessionInfo sessionInfo, NodeId activityId)
Removes the activity identified by the specifiedactivityId
.void
removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId)
Remove the version identified by the specifiedversionId
.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 givenNodeId
.void
restore(SessionInfo sessionInfo, NodeId[] nodeIds, boolean removeExisting)
Restore multiple versions at once.void
restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting)
Restores the node identified bynodeId
to the state defined by the version with the specifiedversionId
.void
submit(Batch batch)
Completes the givenBatch
or discard all the previous modifications.void
unlock(SessionInfo sessionInfo, NodeId nodeId)
Releases the lock on theNode
identified by the givenNodeId
.void
unregisterNamespace(SessionInfo sessionInfo, String uri)
Unregister the namespace identified by the given urivoid
unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames)
Unregisters the node types with the specifiednames
.void
update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName)
Updates the node identified by the givenNodeId
replacing it (an the complete subtree) with a clone of its corresponding node present in the workspace with the givensrcWorkspaceName
.void
updateEventFilters(Subscription subscription, EventFilter[] eventFilters)
Updates events filters on the subscription.-
Methods inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
execute, execute
-
-
-
-
Constructor Detail
-
RepositoryServiceLogger
public RepositoryServiceLogger(RepositoryService service, LogWriter writer)
Create a new instance for the givenservice
which useswriter
for persisting log messages.- Parameters:
service
-writer
-
-
-
Method Detail
-
getRepositoryService
public RepositoryService getRepositoryService()
- Returns:
- the wrapped RepositoryService
-
getNameFactory
public NameFactory getNameFactory() throws RepositoryException
Description copied from interface:RepositoryService
Return theNameFactory
.- Specified by:
getNameFactory
in interfaceRepositoryService
- Returns:
- The
NameFactory
. - Throws:
RepositoryException
- If an error occurs.
-
getPathFactory
public PathFactory getPathFactory() throws RepositoryException
Description copied from interface:RepositoryService
Return thePathFactory
.- Specified by:
getPathFactory
in interfaceRepositoryService
- Returns:
- The
PathFactory
. - Throws:
RepositoryException
- If an error occurs.
-
getIdFactory
public IdFactory getIdFactory() throws RepositoryException
Description copied from interface:RepositoryService
Return theIdFactory
.- Specified by:
getIdFactory
in interfaceRepositoryService
- Returns:
- The
IdFactory
. - Throws:
RepositoryException
- If an error occurs.
-
getQValueFactory
public QValueFactory getQValueFactory() throws RepositoryException
Description copied from interface:RepositoryService
Return theQValueFactory
defined with this SPI implementation.- Specified by:
getQValueFactory
in interfaceRepositoryService
- Returns:
- The
QValueFactory
. - Throws:
RepositoryException
- If an error occurs.
-
getRepositoryDescriptors
public Map<String,QValue[]> getRepositoryDescriptors() throws RepositoryException
Description copied from interface:RepositoryService
Returns all property descriptors that can be exposed with theRepository
implementation built on top of thisRepositoryService
.- Specified by:
getRepositoryDescriptors
in interfaceRepositoryService
- Returns:
- key-value pairs for repository descriptor keys and values.
- Throws:
RepositoryException
- See Also:
Repository.getDescriptorKeys()
,Repository.getDescriptor(String)
-
getItemInfoCache
public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Returns aItemInfoCache
for the givenSessionInfo
.- Specified by:
getItemInfoCache
in interfaceRepositoryService
- Returns:
- Throws:
RepositoryException
-
obtain
public SessionInfo obtain(Credentials credentials, String workspaceName) throws RepositoryException
Description copied from interface:RepositoryService
Returns aSessionInfo
that will be used by other methods on theRepositoryService
. An implementation may choose to authenticate the user using the suppliedcredentials
.- Specified by:
obtain
in interfaceRepositoryService
- Parameters:
credentials
- the credentials of the user.workspaceName
- the name of the workspace theSessionInfo
should be built for. If the specified workspaceName isnull
the implementation should select a default workspace.- Returns:
- a
SessionInfo
if authentication was successful. - Throws:
LoginException
- if authentication of the user fails.NoSuchWorkspaceException
- if the specifiedworkspaceName
is not recognized.RepositoryException
- if an error occurs.
-
obtain
public SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws RepositoryException
Description copied from interface:RepositoryService
Returns a newSessionInfo
for the given workspace name that will be used by other methods on theRepositoryService
.- Specified by:
obtain
in interfaceRepositoryService
- Parameters:
sessionInfo
- for another workspaceworkspaceName
- the name of the workspace the newSessionInfo
should be built for. If the specified workspaceName isnull
the implementation should select a default workspace.- Returns:
- a
SessionInfo
if authentication was successful. - Throws:
LoginException
- if authentication of the user fails.NoSuchWorkspaceException
- if the specifiedworkspaceName
is not recognized.RepositoryException
- if an error occurs.
-
impersonate
public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws RepositoryException
Description copied from interface:RepositoryService
Returns aSessionInfo
that will be used by other methods on theRepositoryService
.- Specified by:
impersonate
in interfaceRepositoryService
- Returns:
- a
SessionInfo
if impersonate was successful. - Throws:
LoginException
RepositoryException
- See Also:
Session.impersonate(javax.jcr.Credentials)
-
dispose
public void dispose(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Indicates to theRepositoryService
, that the given SessionInfo will not be used any more.- Specified by:
dispose
in interfaceRepositoryService
- Throws:
RepositoryException
-
getWorkspaceNames
public String[] getWorkspaceNames(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Return all workspace names available for the givenSessionInfo
.- Specified by:
getWorkspaceNames
in interfaceRepositoryService
- Returns:
- An array of workspace names.
- Throws:
RepositoryException
- See Also:
Workspace.getAccessibleWorkspaceNames()
,Workspace.getName()
-
isGranted
public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) throws RepositoryException
Description copied from interface:RepositoryService
Returns true if all actions defined in the specified array are granted to givenSessionInfo
. False otherwise.- Specified by:
isGranted
in interfaceRepositoryService
- Returns:
- true if the session with the given
SessionInfo
has the specified rights for the given item. - Throws:
RepositoryException
- See Also:
Session.checkPermission(String, String)
,Session.hasPermission(String, String)
-
getPrivilegeDefinitions
public PrivilegeDefinition[] getPrivilegeDefinitions(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
TODO- Specified by:
getPrivilegeDefinitions
in interfaceRepositoryService
- Returns:
- Throws:
RepositoryException
-
getSupportedPrivileges
public PrivilegeDefinition[] getSupportedPrivileges(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
TODO- Specified by:
getSupportedPrivileges
in interfaceRepositoryService
- Returns:
- Throws:
RepositoryException
-
getPrivilegeNames
public Name[] getPrivilegeNames(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
TODO- Specified by:
getPrivilegeNames
in interfaceRepositoryService
- Returns:
- Throws:
RepositoryException
-
getNodeDefinition
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Returns theQNodeDefinition
for theNode
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 or if no parent exists (i.e. for the root).- Specified by:
getNodeDefinition
in interfaceRepositoryService
- Returns:
- The node definition applicable to the
Node
identified by the given id. - Throws:
RepositoryException
-
getPropertyDefinition
public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException
Description copied from interface:RepositoryService
Returns theQPropertyDefinition
for theProperty
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.- Specified by:
getPropertyDefinition
in interfaceRepositoryService
- Returns:
- The property definition applicable for the
Property
identified by the given id. - Throws:
RepositoryException
-
getNodeInfo
public NodeInfo getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Retrieve theNodeInfo
for the node identified by the givenNodeId
. SeeRepositoryService.getItemInfos(SessionInfo, ItemId)
for a similar method that in addition may returnItemInfo
s of childrenItem
s.- Specified by:
getNodeInfo
in interfaceRepositoryService
- Returns:
- The
NodeInfo
for the node identified by the given id. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
Session.getItem(String)
,Node.getNode(String)
,VersionHistory.getAllVersions()
,VersionHistory.getVersion(String)
,VersionHistory.getVersionByLabel(String)
,VersionHistory.getRootVersion()
,Node.getBaseVersion()
,Node.getVersionHistory()
,Version.getContainingHistory()
-
getItemInfos
public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException
Description copied from interface:RepositoryService
Method used to 'batch-read' from the persistent storage. It returns theItemInfo
for the givenItemId
as the first element in theIterator
. In addition the iterator may contain arbitraryItemInfo
s.- Specified by:
getItemInfos
in interfaceRepositoryService
- Returns:
- An
Iterator
ofItemInfo
s containing at least a single element: theItemInfo
that represents the Item identified by the givenItemId
. If the Iterator contains multiple elements, the first is expected to represent the Item identified by the givenItemId
. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
Session.getItem(String)
,Node.getNode(String)
,VersionHistory.getAllVersions()
,VersionHistory.getVersion(String)
,VersionHistory.getVersionByLabel(String)
,VersionHistory.getRootVersion()
,Node.getBaseVersion()
,Node.getVersionHistory()
,Version.getContainingHistory()
-
getChildInfos
public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId) throws RepositoryException
Description copied from interface:RepositoryService
Returns an Iterator ofChildInfo
s present on the Node represented by the given parentId.- Specified by:
getChildInfos
in interfaceRepositoryService
- Returns:
- An Iterator of
ChildInfo
s present on the Node represented by the given parentId. - Throws:
ItemNotFoundException
RepositoryException
-
getReferences
public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws RepositoryException
Description copied from interface:RepositoryService
Returns theId
s of the properties that are referencing the node identified by the givennodeId
. IfweakReferences
istrue
the ids ofWEAKREFERENCE
properties are returned, otherwise the property must be of typeREFERENCE
.- Specified by:
getReferences
in interfaceRepositoryService
propertyName
- name filter of referring properties to be returned; ifnull
then all references are returned.weakReferences
- Iftrue
the properties must be of typePropertyType.WEAKREFERENCE
, otherwise of typePropertyType.REFERENCE
.- Returns:
- An Iterator of
Id
s of the properties that are referencing the node identified by the givennodeId
or an empty iterator if the node is not referenceable or no references exist. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
PropertyInfo.getId()
-
getPropertyInfo
public PropertyInfo getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException
Description copied from interface:RepositoryService
Returns thePropertyInfo
for theProperty
identified by the given id.- Specified by:
getPropertyInfo
in interfaceRepositoryService
- Returns:
- The
PropertyInfo
for theProperty
identified by the given id. - Throws:
ItemNotFoundException
RepositoryException
- See Also:
Session.getItem(String)
,Node.getProperty(String)
-
createBatch
public Batch createBatch(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException
Description copied from interface:RepositoryService
Indicates the start of a set of operations that cause modifications on the underlying persistence layer. All modification called on theBatch
must be executed at once or non must be executed upon callingRepositoryService.submit(Batch)
.- Specified by:
createBatch
in interfaceRepositoryService
itemId
- Id of the Item that is a common ancestor of allItem
s affected upon batch execution. ThisItem
might itself be modified within the scope of theBatch
.- Returns:
- A Batch indicating the start of a set of transient modifications
that will be execute at once upon
RepositoryService.submit(Batch)
. - Throws:
RepositoryException
- See Also:
Item.save()
,Session.save()
,Batch
-
submit
public void submit(Batch batch) throws RepositoryException
Description copied from interface:RepositoryService
Completes the givenBatch
or discard all the previous modifications. SeeRepositoryService.createBatch(SessionInfo,ItemId)
for additional information regarding batch creation.- Specified by:
submit
in interfaceRepositoryService
- Throws:
PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Batch
-
createTree
public Tree createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId) throws RepositoryException
Description copied from interface:RepositoryService
Creates a newTree
that can be populated and later on be applied to the specifiedBatch
by calling#setTree
.- Specified by:
createTree
in interfaceRepositoryService
- Returns:
- a new
Tree
instance. - Throws:
RepositoryException
-
importXml
public void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws RepositoryException
Description copied from interface:RepositoryService
Imports the data present in the givenInputStream
into the persistent layer. Note, that the implementation is responsible for validating the data presented and for the integrity of the repository upon completion.- Specified by:
importXml
in interfaceRepositoryService
- Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Workspace.importXML(String, java.io.InputStream, int)
-
move
public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException
Description copied from interface:RepositoryService
Moves the node identified by the givensrcNodeId
(and its entire subtree) to the new location defined bydestParentNodeId
and a new name (destName
).
-
copy
public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException
Description copied from interface:RepositoryService
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
. The destination is composed by the given parent id and the new name as indicated bydestName
.Note, that
srcWorkspaceName
may be the same as the one specified within theSessionInfo
. In this case the copy corresponds to a copy within a single workspace.- Specified by:
copy
in interfaceRepositoryService
- Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Workspace.copy(String, String)
,Workspace.copy(String, String, String)
-
update
public void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws RepositoryException
Description copied from interface:RepositoryService
Updates the node identified by the givenNodeId
replacing it (an the complete subtree) with a clone of its corresponding node present in the workspace with the givensrcWorkspaceName
.- Specified by:
update
in interfaceRepositoryService
- Throws:
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.update(String)
-
clone
public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws RepositoryException
Description copied from interface:RepositoryService
Clone the subtree identified by the givensrcNodeId
in workspace namedsrcWorkspaceName
to the destination in the workspace specified by the givenSessionInfo
. The destination is composed by the given parent id and the new name as indicated bydestName
.- Specified by:
clone
in interfaceRepositoryService
- Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Workspace.clone(String, String, String, boolean)
-
getLockInfo
public LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Returns the lock information that applies toNode
identified by the givenNodeId
ornull
. If the implementation does not support locking at all, this method always returnsnull
.- Specified by:
getLockInfo
in interfaceRepositoryService
- Returns:
- The lock information for the Node identified by the given
nodeId
ornull
if no lock applies to that Node. - Throws:
AccessDeniedException
RepositoryException
- If some other error occurs.- See Also:
Node.getLock()
-
lock
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped) throws RepositoryException
Description copied from interface:RepositoryService
Create a lock on theNode
identified by the given id.- Specified by:
lock
in interfaceRepositoryService
- Returns:
- The
LockInfo
associated with the new lock that has been created. - Throws:
UnsupportedRepositoryOperationException
- If this SPI implementation does not support locking at all.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.- See Also:
Node.lock(boolean, boolean)
-
lock
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws RepositoryException
Description copied from interface:RepositoryService
Create a lock on theNode
identified by the given id.- Specified by:
lock
in interfaceRepositoryService
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.- Returns:
- The
LockInfo
associated with the new lock that has been created. - Throws:
UnsupportedRepositoryOperationException
- If this SPI implementation does not support locking at all.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.- See Also:
LockManager.lock(String, boolean, boolean, long, String)
-
refreshLock
public void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Explicit refresh of an existing lock. Existing locks should be refreshed implicitly with all read and write methods listed here.- Specified by:
refreshLock
in interfaceRepositoryService
- Throws:
UnsupportedRepositoryOperationException
- If this SPI implementation does not support locking at all.LockException
- If the Node identified by the given id is not locked (any more) or if theSessionInfo
does not contain the token associated with the lock to be refreshed.AccessDeniedException
RepositoryException
- If another error occurs.- See Also:
Lock
-
unlock
public void unlock(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Releases the lock on theNode
identified by the givenNodeId
.Please note, that on
logout
all session-scoped locks must be released by calling unlock.- Specified by:
unlock
in interfaceRepositoryService
- Throws:
UnsupportedRepositoryOperationException
- If this SPI implementation does not support locking at all.LockException
- If the Node identified by the given id is not locked or if theSessionInfo
does not contain the token associated with the lock to be released.AccessDeniedException
RepositoryException
- If another error occurs.- See Also:
Node.unlock()
-
checkin
public NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Performs a checkin for theNode
identified by the givenNodeId
.- Specified by:
checkin
in interfaceRepositoryService
- Returns:
NodeId
of newly created version- Throws:
VersionException
UnsupportedRepositoryOperationException
InvalidItemStateException
LockException
RepositoryException
- See Also:
Node.checkin()
-
checkout
public void checkout(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
Description copied from interface:RepositoryService
Performs a checkout for theNode
identified by the givenNodeId
. Same asRepositoryService.checkout(SessionInfo, NodeId, NodeId)
where theactivityId
isnull
.- Specified by:
checkout
in interfaceRepositoryService
- Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException
- See Also:
Node.checkout()
-
checkout
public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws RepositoryException
Description copied from interface:RepositoryService
Performs a checkout for theNode
identified by the givenNodeId
and for activity identified by the specifiedactivityId
. If theactivityId
isnull
this corresponds toRepositoryService.checkout(SessionInfo, NodeId)
- Specified by:
checkout
in interfaceRepositoryService
activityId
- Id of the activity node set to the editing session ornull
if no activity is in effect.- Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException
-
checkpoint
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Performs a checkpoint for theNode
identified by the givenNodeId
.- Specified by:
checkpoint
in interfaceRepositoryService
- Returns:
NodeId
of newly created version- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
VersionManager.checkpoint(String)
-
checkpoint
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Performs a checkpoint for theNode
identified by the givenNodeId
. For the checkout part the specifiedactivityId
is taken into account as specified inRepositoryService.checkout(SessionInfo, NodeId, NodeId)
.- Specified by:
checkpoint
in interfaceRepositoryService
activityId
- Id of the activity node set to the editing session ornull
if no activity is in effect.- Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException
-
removeVersion
public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws RepositoryException
Description copied from interface:RepositoryService
Remove the version identified by the specifiedversionId
.- Specified by:
removeVersion
in interfaceRepositoryService
versionHistoryId
-NodeId
identifying the version history the version identified byversionId
belongs to.- Throws:
ReferentialIntegrityException
AccessDeniedException
UnsupportedRepositoryOperationException
VersionException
RepositoryException
- See Also:
VersionHistory.removeVersion(String)
-
restore
public void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) throws RepositoryException
Description copied from interface:RepositoryService
Restores the node identified bynodeId
to the state defined by the version with the specifiedversionId
.- Specified by:
restore
in interfaceRepositoryService
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 theremoveExisting
istrue
the restored node takes precedence and the existing node is removed. Otherwise the restore fails.- Throws:
VersionException
PathNotFoundException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.restore(String, boolean)
,Node.restore(javax.jcr.version.Version, boolean)
,Node.restore(javax.jcr.version.Version, String, boolean)
,Node.restoreByLabel(String, boolean)
-
restore
public void restore(SessionInfo sessionInfo, NodeId[] nodeIds, boolean removeExisting) throws RepositoryException
Description copied from interface:RepositoryService
Restore multiple versions at once. The versions to be restored are identified by the given array ofNodeId
s.- Specified by:
restore
in interfaceRepositoryService
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 theremoveExisting
istrue
the node to be restored takes precedence and the existing node is removed. Otherwise the restore fails.- Throws:
ItemExistsException
UnsupportedRepositoryOperationException
VersionException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Workspace.restore(javax.jcr.version.Version[], boolean)
-
merge
public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws RepositoryException
Description copied from interface:RepositoryService
Merge the node identified by the givenNodeId
and its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName
.- Specified by:
merge
in interfaceRepositoryService
- Returns:
- an
Iterator
over theNodeId
s of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException
- See Also:
Node.merge(String, boolean)
-
merge
public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws RepositoryException
Description copied from interface:RepositoryService
Merge the node identified by the givenNodeId
and its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName
.- Specified by:
merge
in interfaceRepositoryService
- Returns:
- an
Iterator
over theNodeId
s of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException
- See Also:
VersionManager.merge(String, String, boolean, boolean)
-
resolveMergeConflict
public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws RepositoryException
Description copied from interface:RepositoryService
Resolve an existing merge conflict present with the node identified by the givenNodeId
.- Specified by:
resolveMergeConflict
in interfaceRepositoryService
mergeFailedIds
- TheNodeId
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 ofNode.doneMerge(Version)
. In case of aNode.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.- Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
Node.cancelMerge(javax.jcr.version.Version)
,Node.doneMerge(javax.jcr.version.Version)
-
addVersionLabel
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws RepositoryException
Description copied from interface:RepositoryService
Add the given version label in the persistent layer.- Specified by:
addVersionLabel
in interfaceRepositoryService
versionHistoryId
-NodeId
identifying the version history the version identified byversionId
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: Iftrue
the label already present gets moved to be now be a label of the version indicated byversionId
. Iffalse
this method fails and the label remains with the original version.- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
removeVersionLabel
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws RepositoryException
Description copied from interface:RepositoryService
Remove the given version label in the persistent layer.- Specified by:
removeVersionLabel
in interfaceRepositoryService
versionHistoryId
-NodeId
identifying the version history the version identified byversionId
belongs to.versionId
-NodeId
identifying the version the label belongs to.label
- The label to be removed.- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.removeVersionLabel(String)
-
createActivity
public NodeId createActivity(SessionInfo sessionInfo, String title) throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Create a new activity.- Specified by:
createActivity
in interfaceRepositoryService
- Returns:
- the
NodeId
of the new activity node. - Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
VersionManager.createActivity(String)
-
removeActivity
public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Removes the activity identified by the specifiedactivityId
.- Specified by:
removeActivity
in interfaceRepositoryService
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
VersionManager.removeActivity(Node)
-
mergeActivity
public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Merges the activity identified by the givenactivityId
into the workspace the specifiedsessionInfo
has been created for.- Specified by:
mergeActivity
in interfaceRepositoryService
- Returns:
- an
Iterator
over theNodeId
s of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
UnsupportedRepositoryOperationException
RepositoryException
-
createConfiguration
public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
createConfiguration
in interfaceRepositoryService
- Returns:
- Throws:
UnsupportedRepositoryOperationException
RepositoryException
- See Also:
VersionManager.createConfiguration(String)
-
getSupportedQueryLanguages
public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Returns a String array identifying all query languages supported by this SPI implementation.- Specified by:
getSupportedQueryLanguages
in interfaceRepositoryService
- Returns:
- String array identifying all query languages supported by this SPI implementation.
- Throws:
RepositoryException
- See Also:
QueryManager.getSupportedQueryLanguages()
-
checkQueryStatement
public String[] checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String,String> namespaces) throws RepositoryException
Description copied from interface:RepositoryService
Checks if the querystatement
is valid according to the specified querylanguage
and returns the bind variable names found in the query statement.- Specified by:
checkQueryStatement
in interfaceRepositoryService
- Parameters:
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 querystatement
.- Returns:
- the bind variable names.
- Throws:
InvalidQueryException
- if the query statement is invalid or the language is not supported.RepositoryException
- if an error occurs while checking the statement.- See Also:
QueryManager.createQuery(String, String)
-
executeQuery
public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String,String> namespaces, long limit, long offset, Map<String,QValue> values) throws RepositoryException
Description copied from interface:RepositoryService
Execute the given query statement with the specified query language. The additionalnamespaces
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.- Specified by:
executeQuery
in interfaceRepositoryService
- Parameters:
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 querystatement
.namespaces
- the locally re-mapped namespace which may be used in the querystatement
.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 toQuery.bindValue(String, javax.jcr.Value)
.- Returns:
- The query info.
- Throws:
RepositoryException
- if an error occurs.- See Also:
Query.execute()
-
createEventFilter
public EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] qnodeTypeName, boolean noLocal) throws RepositoryException
Description copied from interface:RepositoryService
Creates an event filter. If the repository supports observation, the filter created is based on the parameters available inObservationManager.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'.- Specified by:
createEventFilter
in interfaceRepositoryService
- Parameters:
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
- Aboolean
.uuid
- Array of jcr:uuid properties.qnodeTypeName
- Array of node type names.noLocal
- Aboolean
.- Returns:
- the event filter instance with the given parameters.
- Throws:
UnsupportedRepositoryOperationException
- if this SPI implementation does not allow to create event filters.RepositoryException
- if an error occurs while creating the EventFilter.- See Also:
ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, String, boolean, String[], String[], boolean)
-
createSubscription
public Subscription createSubscription(SessionInfo sessionInfo, EventFilter[] filters) throws RepositoryException
Description copied from interface:RepositoryService
Creates a newSubscription
for events with an initial set ofEventFilter
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 callingRepositoryService.updateEventFilters(Subscription, EventFilter[])
.- Specified by:
createSubscription
in interfaceRepositoryService
- Parameters:
sessionInfo
- the session info.filters
- the initial event filters for the subscription.- Returns:
- Throws:
UnsupportedRepositoryOperationException
- if this SPI implementation does not support observation.RepositoryException
- if an error occurs while creating the Subscription.
-
getEvents
public EventBundle[] getEvents(Subscription subscription, long timeout) throws RepositoryException, InterruptedException
Description copied from interface:RepositoryService
Retrieves the events that occurred since the last call to this method for the passed subscription.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.
- Specified by:
getEvents
in interfaceRepositoryService
- Parameters:
subscription
- a subscription.timeout
- a timeout in milliseconds to wait at most for an event bundle. Iftimeout
is up and no event occurred meanwhile an empty array is returned.- Returns:
- an array of
EventBundle
s representing the events that occurred. - Throws:
RepositoryException
- if an error occurs while retrieving the event bundles.InterruptedException
- if the calling thread is interrupted while waiting for events within the specifiedtimeout
.
-
getEvents
public EventBundle getEvents(SessionInfo sessionInfo, EventFilter filter, long after) throws RepositoryException, UnsupportedRepositoryOperationException
Description copied from interface:RepositoryService
Returns events from theEventJournal
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.- Specified by:
getEvents
in interfaceRepositoryService
- Parameters:
sessionInfo
- the session info.filter
- the event filter to apply. Please note: thenoLocal
flag is ignored.after
- retrieve events that occurred after the given timestamp.- Returns:
- the event bundle.
- Throws:
RepositoryException
- if an error occurs.UnsupportedRepositoryOperationException
- if the underlying implementation does not support event journaling.
-
updateEventFilters
public void updateEventFilters(Subscription subscription, EventFilter[] eventFilters) throws RepositoryException
Description copied from interface:RepositoryService
Updates events filters on the subscription. When this method returns all events that go through the passed subscription and have been generated after this method call must be filtered using the passedfilters
.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.- Specified by:
updateEventFilters
in interfaceRepositoryService
- Parameters:
subscription
- the subscription where the event filters are applied.eventFilters
- the filters that are applied to the events as they occurred on the repository. An event is included in an event bundle if it isaccept
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.- Throws:
RepositoryException
- if an error occurs while updating the event filters.
-
dispose
public void dispose(Subscription subscription) throws RepositoryException
Description copied from interface:RepositoryService
Indicates that the passed subscription is no longer needed.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.- Specified by:
dispose
in interfaceRepositoryService
- Throws:
RepositoryException
- if an error occurs while the subscription is disposed.
-
getRegisteredNamespaces
public Map<String,String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Retrieve all registered namespaces. The namespace to prefix mapping is done using the prefix as key and the namespace as value in the Map.- Specified by:
getRegisteredNamespaces
in interfaceRepositoryService
- Returns:
- Throws:
RepositoryException
- See Also:
Workspace.getNamespaceRegistry()
,NamespaceRegistry.getPrefixes()
,NamespaceRegistry.getURIs()
-
getNamespaceURI
public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws RepositoryException
Description copied from interface:RepositoryService
Returns the namespace URI for the given namespaceprefix
.- Specified by:
getNamespaceURI
in interfaceRepositoryService
- Parameters:
sessionInfo
- the session info.prefix
- a namespace prefix to resolve.- Returns:
- the namespace URI for the given namespace
prefix
. - Throws:
NamespaceException
- if prefix is not mapped to a namespace URI.RepositoryException
- if another error occurs.- See Also:
NamespaceRegistry.getURI(String)
-
getNamespacePrefix
public String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws RepositoryException
Description copied from interface:RepositoryService
Returns the namespace prefix for the given namespaceuri
.- Specified by:
getNamespacePrefix
in interfaceRepositoryService
- Parameters:
sessionInfo
- the session info.uri
- the namespace URI.- Returns:
- the namespace prefix.
- Throws:
NamespaceException
- if the URI unknown.RepositoryException
- if another error occurs.- See Also:
NamespaceRegistry.getPrefix(String)
-
registerNamespace
public void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws RepositoryException
Description copied from interface:RepositoryService
Register a new namespace with the given prefix and uri.- Specified by:
registerNamespace
in interfaceRepositoryService
prefix
- Prefix of the namespace to be registered.uri
- Namespace URI to be registered.- Throws:
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException
- See Also:
NamespaceRegistry.registerNamespace(String, String)
-
unregisterNamespace
public void unregisterNamespace(SessionInfo sessionInfo, String uri) throws RepositoryException
Description copied from interface:RepositoryService
Unregister the namespace identified by the given uri- Specified by:
unregisterNamespace
in interfaceRepositoryService
uri
- Namespace URI to be unregistered.- Throws:
NamespaceException
UnsupportedRepositoryOperationException
AccessDeniedException
RepositoryException
- See Also:
NamespaceRegistry.unregisterNamespace(String)
-
getQNodeTypeDefinitions
public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException
Description copied from interface:RepositoryService
Retrieve theQNodeTypeDefinition
s of all registered nodetypes.- Specified by:
getQNodeTypeDefinitions
in interfaceRepositoryService
- Returns:
- Iterator of
QNodeTypeDefinition
s. - Throws:
RepositoryException
- See Also:
Workspace.getNodeTypeManager()
,NodeTypeManager.getAllNodeTypes()
,NodeTypeManager.getMixinNodeTypes()
,NodeTypeManager.getPrimaryNodeTypes()
,NodeTypeManager.getNodeType(String)
-
getQNodeTypeDefinitions
public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException
Description copied from interface:RepositoryService
RetrieveQNodeTypeDefinition
s for the given names. The implementation is free to return additional definitions which will (probably) be needed by the caller due to node type inheritance. The caller must be able to deal with any kind of additionalQNodeTypeDefinition
s present in theIterator
irrespective whether they have been loaded before or not.- Specified by:
getQNodeTypeDefinitions
in interfaceRepositoryService
nodetypeNames
- names of node types to retrieve- Returns:
QNodeTypeDefinition
- Throws:
NoSuchNodeTypeException
- if for any of the given names noQNodeTypeDefinition
exists.RepositoryException
- See Also:
Workspace.getNodeTypeManager()
,NodeTypeManager.getAllNodeTypes()
,NodeTypeManager.getMixinNodeTypes()
,NodeTypeManager.getPrimaryNodeTypes()
,NodeTypeManager.getNodeType(String)
-
registerNodeTypes
public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException
Description copied from interface:RepositoryService
Registers the node types with the specifiedQNodeTypeDefinition
s. IfallowUpdate
istrue
this method may also be used to reregister existing node types with a modified definition, otherwise this method will fail withNodeTypeExistsException
if any of the specified definition has the name of an already registered node type.- Specified by:
registerNodeTypes
in interfaceRepositoryService
- Throws:
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 andallowUpdate
isfalse
.UnsupportedRepositoryOperationException
- If registering node types is not supported.RepositoryException
- If another error occurs.- See Also:
NodeTypeManager.registerNodeTypes(javax.jcr.nodetype.NodeTypeDefinition[], boolean)
-
unregisterNodeTypes
public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException
Description copied from interface:RepositoryService
Unregisters the node types with the specifiednames
.- Specified by:
unregisterNodeTypes
in interfaceRepositoryService
- Throws:
UnsupportedRepositoryOperationException
- If unregistering node types is not supported.NoSuchNodeTypeException
- If any of the specified names has no corresponding registered node type.RepositoryException
- If another error occurs.- See Also:
NodeTypeManager.unregisterNodeTypes(String[])
-
createWorkspace
public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws RepositoryException
Description copied from interface:RepositoryService
Create a new workspace with the specifiedname
. IfsrcWorkspaceName
isn'tnull
the content of that workspace is 'cloned' to the new workspace as inital content, otherwise an empty workspace will be created.- Specified by:
createWorkspace
in interfaceRepositoryService
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'.- Throws:
AccessDeniedException
UnsupportedRepositoryOperationException
NoSuchWorkspaceException
RepositoryException
- See Also:
Workspace.createWorkspace(String)
,Workspace.createWorkspace(String, String)
-
deleteWorkspace
public void deleteWorkspace(SessionInfo sessionInfo, String name) throws RepositoryException
Description copied from interface:RepositoryService
Deletes the workspace with the specifiedname
.- Specified by:
deleteWorkspace
in interfaceRepositoryService
name
- The name of the workspace to be deleted.- Throws:
AccessDeniedException
UnsupportedRepositoryOperationException
NoSuchWorkspaceException
RepositoryException
- See Also:
Workspace.deleteWorkspace(String)
-
-