Class RepositoryServiceLogger
- All Implemented Interfaces:
RepositoryService
RepositoryService.-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryServiceLogger(RepositoryService service, LogWriter writer) Create a new instance for the givenservicewhich useswriterfor persisting log messages. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) Add the given version label in the persistent layer.checkin(SessionInfo sessionInfo, NodeId nodeId) Performs a checkin for theNodeidentified by the givenNodeId.voidcheckout(SessionInfo sessionInfo, NodeId nodeId) Performs a checkout for theNodeidentified by the givenNodeId.voidcheckout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) Performs a checkout for theNodeidentified by the givenNodeIdand for activity identified by the specifiedactivityId.checkpoint(SessionInfo sessionInfo, NodeId nodeId) Performs a checkpoint for theNodeidentified by the givenNodeId.checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) Performs a checkpoint for theNodeidentified by the givenNodeId.String[]checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces) Checks if the querystatementis valid according to the specified querylanguageand returns the bind variable names found in the query statement.voidclone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) Clone the subtree identified by the givensrcNodeIdin workspace namedsrcWorkspaceNameto the destination in the workspace specified by the givenSessionInfo.voidcopy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) Clone the subtree identified by the givensrcNodeIdin workspace namedsrcWorkspaceNameto the destination in the workspace specified by the givenSessionInfo.createActivity(SessionInfo sessionInfo, String title) Create a new activity.createBatch(SessionInfo sessionInfo, ItemId itemId) Indicates the start of a set of operations that cause modifications on the underlying persistence layer.createConfiguration(SessionInfo sessionInfo, NodeId nodeId) createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] qnodeTypeName, boolean noLocal) Creates an event filter.createSubscription(SessionInfo sessionInfo, EventFilter[] filters) Creates a newSubscriptionfor events with an initial set ofEventFilters.createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId) Creates a newTreethat can be populated and later on be applied to the specifiedBatchby calling#setTree.voidcreateWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) Create a new workspace with the specifiedname.voiddeleteWorkspace(SessionInfo sessionInfo, String name) Deletes the workspace with the specifiedname.voiddispose(SessionInfo sessionInfo) Indicates to theRepositoryService, that the given SessionInfo will not be used any more.voiddispose(Subscription subscription) Indicates that the passed subscription is no longer needed.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.getChildInfos(SessionInfo sessionInfo, NodeId parentId) Returns an Iterator ofChildInfos present on the Node represented by the given parentId.getEvents(SessionInfo sessionInfo, EventFilter filter, long after) Returns events from theEventJournalafter a given point in time.getEvents(Subscription subscription, long timeout) Retrieves the events that occurred since the last call to this method for the passed subscription.Return theIdFactory.getItemInfoCache(SessionInfo sessionInfo) Returns aItemInfoCachefor the givenSessionInfo.getItemInfos(SessionInfo sessionInfo, ItemId itemId) Method used to 'batch-read' from the persistent storage.getLockInfo(SessionInfo sessionInfo, NodeId nodeId) Returns the lock information that applies toNodeidentified by the givenNodeIdornull.Return theNameFactory.getNamespacePrefix(SessionInfo sessionInfo, String uri) Returns the namespace prefix for the given namespaceuri.getNamespaceURI(SessionInfo sessionInfo, String prefix) Returns the namespace URI for the given namespaceprefix.getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) Returns theQNodeDefinitionfor theNodeidentified by the given id.getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) Retrieve theNodeInfofor the node identified by the givenNodeId.Return thePathFactory.getPrivilegeDefinitions(SessionInfo sessionInfo) TODOName[]getPrivilegeNames(SessionInfo sessionInfo, NodeId nodeId) TODOgetPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId) Returns theQPropertyDefinitionfor thePropertyidentified by the given id.getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId) Returns thePropertyInfofor thePropertyidentified by the given id.getQNodeTypeDefinitions(SessionInfo sessionInfo) Retrieve theQNodeTypeDefinitions of all registered nodetypes.getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) RetrieveQNodeTypeDefinitions for the given names.Return theQValueFactorydefined with this SPI implementation.getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) Returns theIds of the properties that are referencing the node identified by the givennodeId.getRegisteredNamespaces(SessionInfo sessionInfo) Retrieve all registered namespaces.Returns all property descriptors that can be exposed with theRepositoryimplementation built on top of thisRepositoryService.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.impersonate(SessionInfo sessionInfo, Credentials credentials) Returns aSessionInfothat will be used by other methods on theRepositoryService.voidimportXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) Imports the data present in the givenInputStreaminto the persistent layer.booleanisGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) Returns true if all actions defined in the specified array are granted to givenSessionInfo.lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped) Create a lock on theNodeidentified by the given id.lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) Create a lock on theNodeidentified by the given id.merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) Merge the node identified by the givenNodeIdand its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName.merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) Merge the node identified by the givenNodeIdand its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName.mergeActivity(SessionInfo sessionInfo, NodeId activityId) Merges the activity identified by the givenactivityIdinto the workspace the specifiedsessionInfohas been created for.voidmove(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) Moves the node identified by the givensrcNodeId(and its entire subtree) to the new location defined bydestParentNodeIdand a new name (destName).obtain(Credentials credentials, String workspaceName) Returns aSessionInfothat will be used by other methods on theRepositoryService.obtain(SessionInfo sessionInfo, String workspaceName) Returns a newSessionInfofor the given workspace name that will be used by other methods on theRepositoryService.voidrefreshLock(SessionInfo sessionInfo, NodeId nodeId) Explicit refresh of an existing lock.voidregisterNamespace(SessionInfo sessionInfo, String prefix, String uri) Register a new namespace with the given prefix and uri.voidregisterNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) Registers the node types with the specifiedQNodeTypeDefinitions.voidremoveActivity(SessionInfo sessionInfo, NodeId activityId) Removes the activity identified by the specifiedactivityId.voidremoveVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) Remove the version identified by the specifiedversionId.voidremoveVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) Remove the given version label in the persistent layer.voidresolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) Resolve an existing merge conflict present with the node identified by the givenNodeId.voidrestore(SessionInfo sessionInfo, NodeId[] nodeIds, boolean removeExisting) Restore multiple versions at once.voidrestore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) Restores the node identified bynodeIdto the state defined by the version with the specifiedversionId.voidCompletes the givenBatchor discard all the previous modifications.voidunlock(SessionInfo sessionInfo, NodeId nodeId) Releases the lock on theNodeidentified by the givenNodeId.voidunregisterNamespace(SessionInfo sessionInfo, String uri) Unregister the namespace identified by the given urivoidunregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) Unregisters the node types with the specifiednames.voidupdate(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) Updates the node identified by the givenNodeIdreplacing it (an the complete subtree) with a clone of its corresponding node present in the workspace with the givensrcWorkspaceName.voidupdateEventFilters(Subscription subscription, EventFilter[] eventFilters) Updates events filters on the subscription.
-
Constructor Details
-
RepositoryServiceLogger
Create a new instance for the givenservicewhich useswriterfor persisting log messages.- Parameters:
service-writer-
-
-
Method Details
-
getRepositoryService
- Returns:
- the wrapped RepositoryService
-
getNameFactory
Description copied from interface:RepositoryServiceReturn theNameFactory.- Specified by:
getNameFactoryin interfaceRepositoryService- Returns:
- The
NameFactory. - Throws:
RepositoryException- If an error occurs.
-
getPathFactory
Description copied from interface:RepositoryServiceReturn thePathFactory.- Specified by:
getPathFactoryin interfaceRepositoryService- Returns:
- The
PathFactory. - Throws:
RepositoryException- If an error occurs.
-
getIdFactory
Description copied from interface:RepositoryServiceReturn theIdFactory.- Specified by:
getIdFactoryin interfaceRepositoryService- Returns:
- The
IdFactory. - Throws:
RepositoryException- If an error occurs.
-
getQValueFactory
Description copied from interface:RepositoryServiceReturn theQValueFactorydefined with this SPI implementation.- Specified by:
getQValueFactoryin interfaceRepositoryService- Returns:
- The
QValueFactory. - Throws:
RepositoryException- If an error occurs.
-
getRepositoryDescriptors
Description copied from interface:RepositoryServiceReturns all property descriptors that can be exposed with theRepositoryimplementation built on top of thisRepositoryService.- Specified by:
getRepositoryDescriptorsin interfaceRepositoryService- Returns:
- key-value pairs for repository descriptor keys and values.
- Throws:
RepositoryException- See Also:
-
getItemInfoCache
Description copied from interface:RepositoryServiceReturns aItemInfoCachefor the givenSessionInfo.- Specified by:
getItemInfoCachein interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- Throws:
RepositoryException
-
obtain
Description copied from interface:RepositoryServiceReturns aSessionInfothat will be used by other methods on theRepositoryService. An implementation may choose to authenticate the user using the suppliedcredentials.- Specified by:
obtainin interfaceRepositoryService- Parameters:
credentials- the credentials of the user.workspaceName- the name of the workspace theSessionInfoshould be built for. If the specified workspaceName isnullthe implementation should select a default workspace.- Returns:
- a
SessionInfoif authentication was successful. - Throws:
RepositoryException- if an error occurs.
-
obtain
Description copied from interface:RepositoryServiceReturns a newSessionInfofor the given workspace name that will be used by other methods on theRepositoryService.- Specified by:
obtainin interfaceRepositoryService- Parameters:
sessionInfo- for another workspaceworkspaceName- the name of the workspace the newSessionInfoshould be built for. If the specified workspaceName isnullthe implementation should select a default workspace.- Returns:
- a
SessionInfoif authentication was successful. - Throws:
RepositoryException- if an error occurs.
-
impersonate
public SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws RepositoryException Description copied from interface:RepositoryServiceReturns aSessionInfothat will be used by other methods on theRepositoryService.- Specified by:
impersonatein interfaceRepositoryService- Parameters:
sessionInfo-credentials-- Returns:
- a
SessionInfoif impersonate was successful. - Throws:
RepositoryException- See Also:
-
dispose
Description copied from interface:RepositoryServiceIndicates to theRepositoryService, that the given SessionInfo will not be used any more.- Specified by:
disposein interfaceRepositoryService- Parameters:
sessionInfo-- Throws:
RepositoryException
-
getWorkspaceNames
Description copied from interface:RepositoryServiceReturn all workspace names available for the givenSessionInfo.- Specified by:
getWorkspaceNamesin interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- An array of workspace names.
- Throws:
RepositoryException- See Also:
-
isGranted
public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, String[] actions) throws RepositoryException Description copied from interface:RepositoryServiceReturns true if all actions defined in the specified array are granted to givenSessionInfo. False otherwise.- Specified by:
isGrantedin interfaceRepositoryService- Parameters:
sessionInfo-itemId-actions-- Returns:
- true if the session with the given
SessionInfohas the specified rights for the given item. - Throws:
RepositoryException- See Also:
-
getPrivilegeDefinitions
public PrivilegeDefinition[] getPrivilegeDefinitions(SessionInfo sessionInfo) throws RepositoryException Description copied from interface:RepositoryServiceTODO- Specified by:
getPrivilegeDefinitionsin interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- Throws:
RepositoryException
-
getSupportedPrivileges
public PrivilegeDefinition[] getSupportedPrivileges(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException Description copied from interface:RepositoryServiceTODO- Specified by:
getSupportedPrivilegesin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- Throws:
RepositoryException
-
getPrivilegeNames
Description copied from interface:RepositoryServiceTODO- Specified by:
getPrivilegeNamesin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- Throws:
RepositoryException
-
getNodeDefinition
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException Description copied from interface:RepositoryServiceReturns theQNodeDefinitionfor theNodeidentified 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:
getNodeDefinitionin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- The node definition applicable to the
Nodeidentified by the given id. - Throws:
RepositoryException
-
getPropertyDefinition
public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException Description copied from interface:RepositoryServiceReturns theQPropertyDefinitionfor thePropertyidentified 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:
getPropertyDefinitionin interfaceRepositoryService- Parameters:
sessionInfo-propertyId-- Returns:
- The property definition applicable for the
Propertyidentified by the given id. - Throws:
RepositoryException
-
getNodeInfo
Description copied from interface:RepositoryServiceRetrieve theNodeInfofor the node identified by the givenNodeId. SeeRepositoryService.getItemInfos(SessionInfo, ItemId)for a similar method that in addition may returnItemInfos of childrenItems.- Specified by:
getNodeInfoin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- The
NodeInfofor the node identified by the given id. - Throws:
RepositoryException- See Also:
-
getItemInfos
public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException Description copied from interface:RepositoryServiceMethod used to 'batch-read' from the persistent storage. It returns theItemInfofor the givenItemIdas the first element in theIterator. In addition the iterator may contain arbitraryItemInfos.- Specified by:
getItemInfosin interfaceRepositoryService- Parameters:
sessionInfo-itemId-- Returns:
- An
IteratorofItemInfos containing at least a single element: theItemInfothat 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:
RepositoryException- See Also:
-
getChildInfos
public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId) throws RepositoryException Description copied from interface:RepositoryServiceReturns an Iterator ofChildInfos present on the Node represented by the given parentId.- Specified by:
getChildInfosin interfaceRepositoryService- Parameters:
sessionInfo-parentId-- Returns:
- An Iterator of
ChildInfos present on the Node represented by the given parentId. - Throws:
RepositoryException
-
getReferences
public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId, Name propertyName, boolean weakReferences) throws RepositoryException Description copied from interface:RepositoryServiceReturns theIds of the properties that are referencing the node identified by the givennodeId. IfweakReferencesistruethe ids ofWEAKREFERENCEproperties are returned, otherwise the property must be of typeREFERENCE.- Specified by:
getReferencesin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-propertyName- name filter of referring properties to be returned; ifnullthen all references are returned.weakReferences- Iftruethe properties must be of typePropertyType.WEAKREFERENCE, otherwise of typePropertyType.REFERENCE.- Returns:
- An Iterator of
Ids of the properties that are referencing the node identified by the givennodeIdor an empty iterator if the node is not referenceable or no references exist. - Throws:
RepositoryException- See Also:
-
getPropertyInfo
public PropertyInfo getPropertyInfo(SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException Description copied from interface:RepositoryServiceReturns thePropertyInfofor thePropertyidentified by the given id.- Specified by:
getPropertyInfoin interfaceRepositoryService- Parameters:
sessionInfo-propertyId-- Returns:
- The
PropertyInfofor thePropertyidentified by the given id. - Throws:
RepositoryException- See Also:
-
createBatch
Description copied from interface:RepositoryServiceIndicates the start of a set of operations that cause modifications on the underlying persistence layer. All modification called on theBatchmust be executed at once or non must be executed upon callingRepositoryService.submit(Batch).- Specified by:
createBatchin interfaceRepositoryService- Parameters:
sessionInfo-itemId- Id of the Item that is a common ancestor of allItems affected upon batch execution. ThisItemmight 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:
-
submit
Description copied from interface:RepositoryServiceCompletes the givenBatchor discard all the previous modifications. SeeRepositoryService.createBatch(SessionInfo,ItemId)for additional information regarding batch creation.- Specified by:
submitin interfaceRepositoryService- Parameters:
batch-- Throws:
RepositoryException- See Also:
-
createTree
public Tree createTree(SessionInfo sessionInfo, Batch batch, Name nodeName, Name primaryTypeName, String uniqueId) throws RepositoryException Description copied from interface:RepositoryServiceCreates a newTreethat can be populated and later on be applied to the specifiedBatchby calling#setTree.- Specified by:
createTreein interfaceRepositoryService- Parameters:
nodeName-primaryTypeName-uniqueId-- Returns:
- a new
Treeinstance. - Throws:
RepositoryException
-
importXml
public void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws RepositoryException Description copied from interface:RepositoryServiceImports the data present in the givenInputStreaminto 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:
importXmlin interfaceRepositoryService- Parameters:
sessionInfo-parentId-xmlStream-uuidBehaviour-- Throws:
RepositoryException- See Also:
-
move
public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException Description copied from interface:RepositoryServiceMoves the node identified by the givensrcNodeId(and its entire subtree) to the new location defined bydestParentNodeIdand a new name (destName).- Specified by:
movein interfaceRepositoryService- Parameters:
sessionInfo-srcNodeId-destParentNodeId-destName-- Throws:
RepositoryException- See Also:
-
copy
public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException Description copied from interface:RepositoryServiceClone the subtree identified by the givensrcNodeIdin workspace namedsrcWorkspaceNameto 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
srcWorkspaceNamemay be the same as the one specified within theSessionInfo. In this case the copy corresponds to a copy within a single workspace.- Specified by:
copyin interfaceRepositoryService- Parameters:
sessionInfo-srcWorkspaceName-srcNodeId-destParentNodeId-destName-- Throws:
RepositoryException- See Also:
-
update
public void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws RepositoryException Description copied from interface:RepositoryServiceUpdates the node identified by the givenNodeIdreplacing it (an the complete subtree) with a clone of its corresponding node present in the workspace with the givensrcWorkspaceName.- Specified by:
updatein interfaceRepositoryService- Parameters:
sessionInfo-nodeId-srcWorkspaceName-- Throws:
RepositoryException- See Also:
-
clone
public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws RepositoryException Description copied from interface:RepositoryServiceClone the subtree identified by the givensrcNodeIdin workspace namedsrcWorkspaceNameto 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:
clonein interfaceRepositoryService- Parameters:
sessionInfo-srcWorkspaceName-srcNodeId-destParentNodeId-destName-removeExisting-- Throws:
RepositoryException- See Also:
-
getLockInfo
Description copied from interface:RepositoryServiceReturns the lock information that applies toNodeidentified by the givenNodeIdornull. If the implementation does not support locking at all, this method always returnsnull.- Specified by:
getLockInfoin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- The lock information for the Node identified by the given
nodeIdornullif no lock applies to that Node. - Throws:
RepositoryException- If some other error occurs.- See Also:
-
lock
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped) throws RepositoryException Description copied from interface:RepositoryServiceCreate a lock on theNodeidentified by the given id.- Specified by:
lockin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-deep-sessionScoped-- Returns:
- The
LockInfoassociated with the new lock that has been created. - Throws:
RepositoryException- If another error occurs.- See Also:
-
lock
public LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws RepositoryException Description copied from interface:RepositoryServiceCreate a lock on theNodeidentified by the given id.- Specified by:
lockin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-deep-sessionScoped-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
LockInfoassociated with the new lock that has been created. - Throws:
RepositoryException- If another error occurs.- See Also:
-
refreshLock
Description copied from interface:RepositoryServiceExplicit refresh of an existing lock. Existing locks should be refreshed implicitly with all read and write methods listed here.- Specified by:
refreshLockin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Throws:
RepositoryException- If another error occurs.- See Also:
-
unlock
Description copied from interface:RepositoryServiceReleases the lock on theNodeidentified by the givenNodeId.Please note, that on
logoutall session-scoped locks must be released by calling unlock.- Specified by:
unlockin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Throws:
RepositoryException- If another error occurs.- See Also:
-
checkin
Description copied from interface:RepositoryServicePerforms a checkin for theNodeidentified by the givenNodeId.- Specified by:
checkinin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
NodeIdof newly created version- Throws:
RepositoryException- See Also:
-
checkout
Description copied from interface:RepositoryServicePerforms a checkout for theNodeidentified by the givenNodeId. Same asRepositoryService.checkout(SessionInfo, NodeId, NodeId)where theactivityIdisnull.- Specified by:
checkoutin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Throws:
RepositoryException- See Also:
-
checkout
public void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws RepositoryException Description copied from interface:RepositoryServicePerforms a checkout for theNodeidentified by the givenNodeIdand for activity identified by the specifiedactivityId. If theactivityIdisnullthis corresponds toRepositoryService.checkout(SessionInfo, NodeId)- Specified by:
checkoutin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-activityId- Id of the activity node set to the editing session ornullif no activity is in effect.- Throws:
RepositoryException
-
checkpoint
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServicePerforms a checkpoint for theNodeidentified by the givenNodeId.- Specified by:
checkpointin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
NodeIdof newly created version- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
-
checkpoint
public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServicePerforms a checkpoint for theNodeidentified by the givenNodeId. For the checkout part the specifiedactivityIdis taken into account as specified inRepositoryService.checkout(SessionInfo, NodeId, NodeId).- Specified by:
checkpointin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-activityId- Id of the activity node set to the editing session ornullif no activity is in effect.- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException
-
removeVersion
public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws RepositoryException Description copied from interface:RepositoryServiceRemove the version identified by the specifiedversionId.- Specified by:
removeVersionin interfaceRepositoryService- Parameters:
sessionInfo-versionHistoryId-NodeIdidentifying the version history the version identified byversionIdbelongs to.versionId-- Throws:
RepositoryException- See Also:
-
restore
public void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) throws RepositoryException Description copied from interface:RepositoryServiceRestores the node identified bynodeIdto the state defined by the version with the specifiedversionId.- Specified by:
restorein interfaceRepositoryService- Parameters:
sessionInfo-nodeId-versionId-removeExisting- boolean flag indicating how to deal with an identifier collision that may occur if a node exists outside the subtree to be restored with the same identified as a node that would be introduces by the restore. If theremoveExistingistruethe restored node takes precedence and the existing node is removed. Otherwise the restore fails.- Throws:
RepositoryException- See Also:
-
restore
public void restore(SessionInfo sessionInfo, NodeId[] nodeIds, boolean removeExisting) throws RepositoryException Description copied from interface:RepositoryServiceRestore multiple versions at once. The versions to be restored are identified by the given array ofNodeIds.- Specified by:
restorein interfaceRepositoryService- Parameters:
sessionInfo-nodeIds-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 theremoveExistingistruethe node to be restored takes precedence and the existing node is removed. Otherwise the restore fails.- Throws:
RepositoryException- See Also:
-
merge
public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws RepositoryException Description copied from interface:RepositoryServiceMerge the node identified by the givenNodeIdand its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName.- Specified by:
mergein interfaceRepositoryService- Parameters:
sessionInfo-nodeId-srcWorkspaceName-bestEffort-- Returns:
- an
Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
RepositoryException- See Also:
-
merge
public Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws RepositoryException Description copied from interface:RepositoryServiceMerge the node identified by the givenNodeIdand its subtree with the corresponding node present in the workspace with the name ofsrcWorkspaceName.- Specified by:
mergein interfaceRepositoryService- Parameters:
sessionInfo-nodeId-srcWorkspaceName-bestEffort-- Returns:
- an
Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
RepositoryException- See Also:
-
resolveMergeConflict
public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws RepositoryException Description copied from interface:RepositoryServiceResolve an existing merge conflict present with the node identified by the givenNodeId.- Specified by:
resolveMergeConflictin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-mergeFailedIds- TheNodeIds 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:
RepositoryException- See Also:
-
addVersionLabel
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws RepositoryException Description copied from interface:RepositoryServiceAdd the given version label in the persistent layer.- Specified by:
addVersionLabelin interfaceRepositoryService- Parameters:
sessionInfo-versionHistoryId-NodeIdidentifying the version history the version identified byversionIdbelongs to.versionId-NodeIdidentifying 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: Iftruethe label already present gets moved to be now be a label of the version indicated byversionId. Iffalsethis method fails and the label remains with the original version.- Throws:
RepositoryException- See Also:
-
removeVersionLabel
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws RepositoryException Description copied from interface:RepositoryServiceRemove the given version label in the persistent layer.- Specified by:
removeVersionLabelin interfaceRepositoryService- Parameters:
sessionInfo-versionHistoryId-NodeIdidentifying the version history the version identified byversionIdbelongs to.versionId-NodeIdidentifying the version the label belongs to.label- The label to be removed.- Throws:
RepositoryException- See Also:
-
createActivity
public NodeId createActivity(SessionInfo sessionInfo, String title) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceCreate a new activity.- Specified by:
createActivityin interfaceRepositoryService- Parameters:
sessionInfo-title-- Returns:
- the
NodeIdof the new activity node. - Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
-
removeActivity
public void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceRemoves the activity identified by the specifiedactivityId.- Specified by:
removeActivityin interfaceRepositoryService- Parameters:
sessionInfo-activityId-- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
-
mergeActivity
public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceMerges the activity identified by the givenactivityIdinto the workspace the specifiedsessionInfohas been created for.- Specified by:
mergeActivityin interfaceRepositoryService- Parameters:
sessionInfo-activityId-- Returns:
- an
Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation. - Throws:
UnsupportedRepositoryOperationExceptionRepositoryException
-
createConfiguration
public NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException - Specified by:
createConfigurationin interfaceRepositoryService- Parameters:
sessionInfo-nodeId-- Returns:
- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- See Also:
-
getSupportedQueryLanguages
Description copied from interface:RepositoryServiceReturns a String array identifying all query languages supported by this SPI implementation.- Specified by:
getSupportedQueryLanguagesin interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- String array identifying all query languages supported by this SPI implementation.
- Throws:
RepositoryException- See Also:
-
checkQueryStatement
public String[] checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces) throws RepositoryExceptionDescription copied from interface:RepositoryServiceChecks if the querystatementis valid according to the specified querylanguageand returns the bind variable names found in the query statement.- Specified by:
checkQueryStatementin 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:
RepositoryException- if an error occurs while checking the statement.- See Also:
-
executeQuery
public QueryInfo executeQuery(SessionInfo sessionInfo, String statement, String language, Map<String, String> namespaces, long limit, long offset, Map<String, throws RepositoryExceptionQValue> values) Description copied from interface:RepositoryServiceExecute the given query statement with the specified query language. The additionalnamespacesparameter 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:
executeQueryin 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-1is no maximum is set.offset- The offset in the total result set or-1is 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:
-
createEventFilter
public EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] qnodeTypeName, boolean noLocal) throws RepositoryException Description copied from interface:RepositoryServiceCreates 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 descriptordoes not return 'true'.- Specified by:
createEventFilterin 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:
RepositoryException- if an error occurs while creating the EventFilter.- See Also:
-
createSubscription
public Subscription createSubscription(SessionInfo sessionInfo, EventFilter[] filters) throws RepositoryException Description copied from interface:RepositoryServiceCreates a newSubscriptionfor events with an initial set ofEventFilters. 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:
createSubscriptionin interfaceRepositoryService- Parameters:
sessionInfo- the session info.filters- the initial event filters for the subscription.- Returns:
- Throws:
RepositoryException- if an error occurs while creating the Subscription.
-
getEvents
public EventBundle[] getEvents(Subscription subscription, long timeout) throws RepositoryException, InterruptedException Description copied from interface:RepositoryServiceRetrieves 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 descriptordoes 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:
getEventsin interfaceRepositoryService- Parameters:
subscription- a subscription.timeout- a timeout in milliseconds to wait at most for an event bundle. Iftimeoutis up and no event occurred meanwhile an empty array is returned.- Returns:
- an array of
EventBundles 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:RepositoryServiceReturns events from theEventJournalafter 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:
getEventsin interfaceRepositoryService- Parameters:
sessionInfo- the session info.filter- the event filter to apply. Please note: thenoLocalflag 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:RepositoryServiceUpdates 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:
updateEventFiltersin 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 isaccepted 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
Description copied from interface:RepositoryServiceIndicates 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:
disposein 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:RepositoryServiceRetrieve 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:
getRegisteredNamespacesin interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- Throws:
RepositoryException- See Also:
-
getNamespaceURI
Description copied from interface:RepositoryServiceReturns the namespace URI for the given namespaceprefix.- Specified by:
getNamespaceURIin interfaceRepositoryService- Parameters:
sessionInfo- the session info.prefix- a namespace prefix to resolve.- Returns:
- the namespace URI for the given namespace
prefix. - Throws:
RepositoryException- if another error occurs.- See Also:
-
getNamespacePrefix
Description copied from interface:RepositoryServiceReturns the namespace prefix for the given namespaceuri.- Specified by:
getNamespacePrefixin interfaceRepositoryService- Parameters:
sessionInfo- the session info.uri- the namespace URI.- Returns:
- the namespace prefix.
- Throws:
RepositoryException- if another error occurs.- See Also:
-
registerNamespace
public void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws RepositoryException Description copied from interface:RepositoryServiceRegister a new namespace with the given prefix and uri.- Specified by:
registerNamespacein interfaceRepositoryService- Parameters:
sessionInfo-prefix- Prefix of the namespace to be registered.uri- Namespace URI to be registered.- Throws:
RepositoryException- See Also:
-
unregisterNamespace
Description copied from interface:RepositoryServiceUnregister the namespace identified by the given uri- Specified by:
unregisterNamespacein interfaceRepositoryService- Parameters:
sessionInfo-uri- Namespace URI to be unregistered.- Throws:
RepositoryException- See Also:
-
getQNodeTypeDefinitions
public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException Description copied from interface:RepositoryServiceRetrieve theQNodeTypeDefinitions of all registered nodetypes.- Specified by:
getQNodeTypeDefinitionsin interfaceRepositoryService- Parameters:
sessionInfo-- Returns:
- Iterator of
QNodeTypeDefinitions. - Throws:
RepositoryException- See Also:
-
getQNodeTypeDefinitions
public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException Description copied from interface:RepositoryServiceRetrieveQNodeTypeDefinitions 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 additionalQNodeTypeDefinitions present in theIteratorirrespective whether they have been loaded before or not.- Specified by:
getQNodeTypeDefinitionsin interfaceRepositoryService- Parameters:
sessionInfo-nodetypeNames- names of node types to retrieve- Returns:
QNodeTypeDefinition- Throws:
RepositoryException- See Also:
-
registerNodeTypes
public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceRegisters the node types with the specifiedQNodeTypeDefinitions. IfallowUpdateistruethis method may also be used to reregister existing node types with a modified definition, otherwise this method will fail withNodeTypeExistsExceptionif any of the specified definition has the name of an already registered node type.- Specified by:
registerNodeTypesin interfaceRepositoryService- Parameters:
sessionInfo-nodeTypeDefinitions-allowUpdate-- 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 andallowUpdateisfalse.UnsupportedRepositoryOperationException- If registering node types is not supported.RepositoryException- If another error occurs.- See Also:
-
unregisterNodeTypes
public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException Description copied from interface:RepositoryServiceUnregisters the node types with the specifiednames.- Specified by:
unregisterNodeTypesin interfaceRepositoryService- Parameters:
sessionInfo-nodeTypeNames-- 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:
-
createWorkspace
public void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws RepositoryException Description copied from interface:RepositoryServiceCreate a new workspace with the specifiedname. IfsrcWorkspaceNameisn'tnullthe content of that workspace is 'cloned' to the new workspace as inital content, otherwise an empty workspace will be created.- Specified by:
createWorkspacein interfaceRepositoryService- Parameters:
sessionInfo-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:
RepositoryException- See Also:
-
deleteWorkspace
Description copied from interface:RepositoryServiceDeletes the workspace with the specifiedname.- Specified by:
deleteWorkspacein interfaceRepositoryService- Parameters:
sessionInfo-name- The name of the workspace to be deleted.- Throws:
RepositoryException- See Also:
-