Class AbstractRepositoryService
- java.lang.Object
- 
- org.apache.jackrabbit.spi.commons.AbstractRepositoryService
 
- 
- All Implemented Interfaces:
- RepositoryService
 - Direct Known Subclasses:
- AbstractReadableRepositoryService
 
 public abstract class AbstractRepositoryService extends Object implements RepositoryService AbstractRepositoryServiceprovides an abstract base class for repository service implementations. This class provides default implementations for the following methods:
- 
- 
Field SummaryFields Modifier and Type Field Description protected Map<String,QValue[]>descriptorsThe repository descriptors.protected NamespaceMappingnamespacesThe fixed set of namespaces known to the repository service.protected NodeTypeStoragenodeTypeDefsThe fixed set of node type definitions known to the repository service.protected QNodeDefinitionrootNodeDefinitionThe node definition of the root node.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractRepositoryService()AbstractRepositoryService(Map<String,QValue[]> descriptors, Map<String,String> namespaces, Reader cnd)AbstractRepositoryService(Map<String,QValue[]> descriptors, Map<String,String> namespaces, QNodeTypeDefinition[] nodeTypeDefs)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel)Add the given version label in the persistent layer.protected voidcheckCredentials(Credentials credentials, String workspaceName)Checks if the givencredentialsare valid.NodeIdcheckin(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.NodeIdcheckpoint(SessionInfo sessionInfo, NodeId nodeId)Performs a checkpoint for theNodeidentified by the givenNodeId.NodeIdcheckpoint(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.protected voidcheckSessionInfo(SessionInfo sessionInfo)Checks the type of thesessionInfoinstance.protected voidcheckWorkspace(String workspaceName)Checks if the given workspace is available.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.NodeIdcreateActivity(SessionInfo sessionInfo, String title)Create a new activity.BatchcreateBatch(SessionInfo sessionInfo, ItemId itemId)Indicates the start of a set of operations that cause modifications on the underlying persistence layer.NodeIdcreateConfiguration(SessionInfo sessionInfo, NodeId nodeId)EventFiltercreateEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] nodeTypeName, boolean noLocal)Creates an event filter.protected abstract QNodeDefinitioncreateRootNodeDefinition(SessionInfo sessionInfo)Create the root node definition.protected SessionInfocreateSessionInfo(Credentials credentials, String workspaceName)Creates a session info instance for the givencredentialsandworkspaceName.protected SessionInfocreateSessionInfo(SessionInfo sessionInfo, String workspaceName)Creates a session info instance for the givensessionInfoandworkspaceName.SubscriptioncreateSubscription(SessionInfo sessionInfo, EventFilter[] filters)Creates a newSubscriptionfor events with an initial set ofEventFilters.TreecreateTree(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)This default implementation does nothing.voiddispose(Subscription subscription)Indicates that the passed subscription is no longer needed.QueryInfoexecuteQuery(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.EventBundlegetEvents(SessionInfo sessionInfo, EventFilter filter, long after)Returns events from theEventJournalafter 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.IdFactorygetIdFactory()Return theIdFactory.LockInfogetLockInfo(SessionInfo sessionInfo, NodeId nodeId)Returns the lock information that applies toNodeidentified by the givenNodeIdornull.NameFactorygetNameFactory()Return theNameFactory.StringgetNamespacePrefix(SessionInfo sessionInfo, String uri)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then return the namespace prefix for the givenuri.StringgetNamespaceURI(SessionInfo sessionInfo, String prefix)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then returns the namespace URI for the givenprefix.QNodeDefinitiongetNodeDefinition(SessionInfo sessionInfo, NodeId nodeId)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then lazily initializesrootNodeDefinitionifnodeIddenotes the root node; otherwise throws aUnsupportedRepositoryOperationException.PathFactorygetPathFactory()Return thePathFactory.QPropertyDefinitiongetPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId)Returns theQPropertyDefinitionfor thePropertyidentified by the given id.Iterator<QNodeTypeDefinition>getQNodeTypeDefinitions(SessionInfo sessionInfo)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo,Iterator<QNodeTypeDefinition>getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then gathers theQNodeTypeDefinitions with the givennodetypeNames.QValueFactorygetQValueFactory()Return theQValueFactorydefined with this SPI implementation.Map<String,String>getRegisteredNamespaces(SessionInfo sessionInfo)This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then returns the prefix to namespace URL mapping that was provided in the constructor of this repository service.Map<String,QValue[]>getRepositoryDescriptors()This default implementation returns the descriptors that were passed to the constructor of this repository service.String[]getSupportedQueryLanguages(SessionInfo sessionInfo)Returns a String array identifying all query languages supported by this SPI implementation.SessionInfoimpersonate(SessionInfo sessionInfo, Credentials credentials)This default implementation returns the session info returned by the call toobtain(Credentials, String)with the workspaceName taken from the passedsessionInfo.voidimportXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour)Imports the data present in the givenInputStreaminto the persistent layer.LockInfolock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped)Create a lock on theNodeidentified by the given id.LockInfolock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint)Create a lock on theNodeidentified by the given id.Iterator<NodeId>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.Iterator<NodeId>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.Iterator<NodeId>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).SessionInfoobtain(Credentials credentials, String workspaceName)This default implementation does: callscheckCredentials(Credentials, String)callscheckWorkspace(String)callscreateSessionInfo(Credentials, String)SessionInfoobtain(SessionInfo sessionInfo, String workspaceName)This default implementation returns the session info returned by the call tocreateSessionInfo(SessionInfo, String).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[] versionIds, 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.voidsubmit(Batch batch)Completes 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[] filters)Updates events filters on the subscription.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.jackrabbit.spi.RepositoryServicegetChildInfos, getItemInfoCache, getItemInfos, getNodeInfo, getPrivilegeDefinitions, getPrivilegeNames, getPropertyInfo, getReferences, getSupportedPrivileges, getWorkspaceNames, isGranted
 
- 
 
- 
- 
- 
Field Detail- 
namespacesprotected final NamespaceMapping namespaces The fixed set of namespaces known to the repository service.
 - 
nodeTypeDefsprotected final NodeTypeStorage nodeTypeDefs The fixed set of node type definitions known to the repository service.
 - 
rootNodeDefinitionprotected QNodeDefinition rootNodeDefinition The node definition of the root node.
 
- 
 - 
Constructor Detail- 
AbstractRepositoryServiceprotected AbstractRepositoryService() throws RepositoryException- Throws:
- RepositoryException
 
 - 
AbstractRepositoryServicepublic AbstractRepositoryService(Map<String,QValue[]> descriptors, Map<String,String> namespaces, QNodeTypeDefinition[] nodeTypeDefs) throws RepositoryException - Throws:
- RepositoryException
 
 - 
AbstractRepositoryServicepublic AbstractRepositoryService(Map<String,QValue[]> descriptors, Map<String,String> namespaces, Reader cnd) throws RepositoryException - Throws:
- RepositoryException
 
 
- 
 - 
Method Detail- 
getIdFactorypublic IdFactory getIdFactory() throws RepositoryException Description copied from interface:RepositoryServiceReturn theIdFactory.- Specified by:
- getIdFactoryin interface- RepositoryService
- Returns:
- IdFactoryImpl.getInstance().
- Throws:
- RepositoryException- if an error occurs.
 
 - 
getNameFactorypublic NameFactory getNameFactory() throws RepositoryException Description copied from interface:RepositoryServiceReturn theNameFactory.- Specified by:
- getNameFactoryin interface- RepositoryService
- Returns:
- NameFactoryImpl.getInstance().
- Throws:
- RepositoryException- if an error occurs.
 
 - 
getPathFactorypublic PathFactory getPathFactory() throws RepositoryException Description copied from interface:RepositoryServiceReturn thePathFactory.- Specified by:
- getPathFactoryin interface- RepositoryService
- Returns:
- PathFactoryImpl.getInstance().
- Throws:
- RepositoryException- if an error occurs.
 
 - 
getQValueFactorypublic QValueFactory getQValueFactory() throws RepositoryException Description copied from interface:RepositoryServiceReturn theQValueFactorydefined with this SPI implementation.- Specified by:
- getQValueFactoryin interface- RepositoryService
- Returns:
- QValueFactoryImpl.getInstance().
- Throws:
- RepositoryException- if an error occurs.
 
 - 
createRootNodeDefinitionprotected abstract QNodeDefinition createRootNodeDefinition(SessionInfo sessionInfo) throws RepositoryException Create the root node definition.- Parameters:
- sessionInfo- the session info.
- Returns:
- the root node definition for a workspace.
- Throws:
- RepositoryException- if an error occurs.
 
 - 
checkCredentialsprotected void checkCredentials(Credentials credentials, String workspaceName) throws LoginException Checks if the givencredentialsare valid. This default implementation is empty thus allowing all credentials.- Parameters:
- credentials- the credentials to check.
- workspaceName- the workspace to access.
- Throws:
- LoginException- if the credentials are invalid.
 
 - 
checkWorkspaceprotected void checkWorkspace(String workspaceName) throws NoSuchWorkspaceException Checks if the given workspace is available. The default implementation is empty thus admitting every workspace name.- Parameters:
- workspaceName- Name of the workspace to check
- Throws:
- NoSuchWorkspaceException- If- workspaceNameis not available.
 
 - 
createSessionInfoprotected SessionInfo createSessionInfo(Credentials credentials, String workspaceName) throws RepositoryException Creates a session info instance for the givencredentialsandworkspaceName. This default implementation creates aSessionInfoImplinstance and sets theuserIdand workspaceName. The useruserIdisnullor theuserIdfromcredentialsif it is of typeSimpleCredentials.- Parameters:
- credentials- the credentials.
- workspaceName- the name of the workspace to access or- nullfor the default workspace.
- Returns:
- a session info instance for the given credentialsandworkspaceName.
- Throws:
- RepositoryException
 
 - 
createSessionInfoprotected SessionInfo createSessionInfo(SessionInfo sessionInfo, String workspaceName) throws RepositoryException Creates a session info instance for the givensessionInfoandworkspaceName. This default implementation creates aSessionInfoImplinstance and sets theuserIdand workspaceName. The useruserIdis set to the return value ofSessionInfo.getUserID().- Parameters:
- sessionInfo- the sessionInfo.
- workspaceName- the name of the workspace to access.
- Returns:
- a session info instance for the given credentialsandworkspaceName.
- Throws:
- RepositoryException
 
 - 
checkSessionInfoprotected void checkSessionInfo(SessionInfo sessionInfo) throws RepositoryException Checks the type of thesessionInfoinstance. This default implementation checks ifsessionInfois of typeSessionInfoImpl, otherwise throws aRepositoryException.- Parameters:
- sessionInfo- the session info to check.
- Throws:
- RepositoryException- if the given- sessionInfois not of the required type for this repository service implementation.
 
 - 
getRepositoryDescriptorspublic Map<String,QValue[]> getRepositoryDescriptors() throws RepositoryException This default implementation returns the descriptors that were passed to the constructor of this repository service.- Specified by:
- getRepositoryDescriptorsin interface- RepositoryService
- Returns:
- key-value pairs for repository descriptor keys and values.
- Throws:
- RepositoryException
- See Also:
- Repository.getDescriptorKeys(),- Repository.getDescriptor(String)
 
 - 
obtainpublic SessionInfo obtain(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException This default implementation does:- Specified by:
- obtainin interface- RepositoryService
- Parameters:
- credentials- the credentials for the login.
- workspaceName- the name of the workspace to log in.
- Returns:
- the session info.
- Throws:
- LoginException- if the credentials are invalid.
- NoSuchWorkspaceException- if- workspaceNameis unknown.
- RepositoryException- if another error occurs.
 
 - 
obtainpublic SessionInfo obtain(SessionInfo sessionInfo, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException This default implementation returns the session info returned by the call tocreateSessionInfo(SessionInfo, String).- Specified by:
- obtainin interface- RepositoryService
- Parameters:
- sessionInfo- for another workspace
- workspaceName- the name of the workspace the new- SessionInfoshould be built for. If the specified workspaceName is- nullthe implementation should select a default workspace.
- Returns:
- a SessionInfoif authentication was successful.
- Throws:
- LoginException- if authentication of the user fails.
- NoSuchWorkspaceException- if the specified- workspaceNameis not recognized.
- RepositoryException- if an error occurs.
 
 - 
impersonatepublic SessionInfo impersonate(SessionInfo sessionInfo, Credentials credentials) throws LoginException, RepositoryException This default implementation returns the session info returned by the call toobtain(Credentials, String)with the workspaceName taken from the passedsessionInfo.- Specified by:
- impersonatein interface- RepositoryService
- Returns:
- a SessionInfoif impersonate was successful.
- Throws:
- LoginException
- RepositoryException
- See Also:
- Session.impersonate(javax.jcr.Credentials)
 
 - 
disposepublic void dispose(SessionInfo sessionInfo) throws RepositoryException This default implementation does nothing.- Specified by:
- disposein interface- RepositoryService
- Throws:
- RepositoryException
 
 - 
getQNodeTypeDefinitionspublic Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo) throws RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo,- Specified by:
- getQNodeTypeDefinitionsin interface- RepositoryService
- Returns:
- Iterator of QNodeTypeDefinitions.
- Throws:
- RepositoryException
- See Also:
- Workspace.getNodeTypeManager(),- NodeTypeManager.getAllNodeTypes(),- NodeTypeManager.getMixinNodeTypes(),- NodeTypeManager.getPrimaryNodeTypes(),- NodeTypeManager.getNodeType(String)
 
 - 
getQNodeTypeDefinitionspublic Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then gathers theQNodeTypeDefinitions with the givennodetypeNames. If one of the nodetypeNames is not a valid node type definition then aRepositoryExceptionis thrown.- Specified by:
- getQNodeTypeDefinitionsin interface- RepositoryService
- nodetypeNames- names of node types to retrieve
- Returns:
- QNodeTypeDefinition
- Throws:
- NoSuchNodeTypeException- if for any of the given names no- QNodeTypeDefinitionexists.
- RepositoryException
- See Also:
- Workspace.getNodeTypeManager(),- NodeTypeManager.getAllNodeTypes(),- NodeTypeManager.getMixinNodeTypes(),- NodeTypeManager.getPrimaryNodeTypes(),- NodeTypeManager.getNodeType(String)
 
 - 
getNodeDefinitionpublic QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then lazily initializesrootNodeDefinitionifnodeIddenotes the root node; otherwise throws aUnsupportedRepositoryOperationException.- Specified by:
- getNodeDefinitionin interface- RepositoryService
- Returns:
- The node definition applicable to the Nodeidentified by the given id.
- Throws:
- RepositoryException
 
 - 
getPropertyDefinitionpublic 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 interface- RepositoryService
- Returns:
- The property definition applicable for the Propertyidentified by the given id.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
 
 - 
registerNodeTypespublic 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- InvalidNodeTypeDefinitionException- If any of the specified definitions is invalid.
- NodeTypeExistsException- If any of the specified definitions has the name of an already registered node type and- allowUpdateis- false.
- RepositoryException- If another error occurs.
- See Also:
- NodeTypeManager.registerNodeTypes(javax.jcr.nodetype.NodeTypeDefinition[], boolean)
 
 - 
unregisterNodeTypespublic void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException Description copied from interface:RepositoryServiceUnregisters the node types with the specifiednames.- Specified by:
- unregisterNodeTypesin interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchNodeTypeException- If any of the specified names has no corresponding registered node type.
- RepositoryException- If another error occurs.
- See Also:
- NodeTypeManager.unregisterNodeTypes(String[])
 
 - 
getRegisteredNamespacespublic Map<String,String> getRegisteredNamespaces(SessionInfo sessionInfo) throws RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then returns the prefix to namespace URL mapping that was provided in the constructor of this repository service.- Specified by:
- getRegisteredNamespacesin interface- RepositoryService
- Returns:
- Throws:
- RepositoryException
- See Also:
- Workspace.getNamespaceRegistry(),- NamespaceRegistry.getPrefixes(),- NamespaceRegistry.getURIs()
 
 - 
getNamespaceURIpublic String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then returns the namespace URI for the givenprefix.- Specified by:
- getNamespaceURIin interface- RepositoryService
- 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)
 
 - 
getNamespacePrefixpublic String getNamespacePrefix(SessionInfo sessionInfo, String uri) throws NamespaceException, RepositoryException This default implementation first callscheckSessionInfo(SessionInfo)with thesessionInfo, then return the namespace prefix for the givenuri.- Specified by:
- getNamespacePrefixin interface- RepositoryService
- 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)
 
 - 
createBatchpublic Batch createBatch(SessionInfo sessionInfo, ItemId itemId) throws RepositoryException 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 interface- RepositoryService
- itemId- Id of the Item that is a common ancestor of all- Items affected upon batch execution. This- Itemmight itself be modified within the scope of the- Batch.
- Returns:
- A Batch indicating the start of a set of transient modifications
 that will be execute at once upon RepositoryService.submit(Batch).
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
- See Also:
- Item.save(),- Session.save(),- Batch
 
 - 
submitpublic void submit(Batch batch) throws PathNotFoundException, ItemNotFoundException, NoSuchNodeTypeException, ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- PathNotFoundException
- ItemNotFoundException
- NoSuchNodeTypeException
- ValueFormatException
- VersionException
- LockException
- ConstraintViolationException
- AccessDeniedException
- RepositoryException
- See Also:
- Batch
 
 - 
createTreepublic 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 interface- RepositoryService
- Returns:
- a new Treeinstance.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
 
 - 
importXmlpublic void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- ItemExistsException
- PathNotFoundException
- VersionException
- ConstraintViolationException
- LockException
- AccessDeniedException
- RepositoryException
- See Also:
- Workspace.importXML(String, java.io.InputStream, int)
 
 - 
movepublic void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- ItemExistsException
- PathNotFoundException
- VersionException
- ConstraintViolationException
- LockException
- AccessDeniedException
- RepositoryException
- See Also:
- Workspace.move(String, String)
 
 - 
copypublic void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchWorkspaceException
- ConstraintViolationException
- VersionException
- AccessDeniedException
- PathNotFoundException
- ItemExistsException
- LockException
- RepositoryException
- See Also:
- Workspace.copy(String, String),- Workspace.copy(String, String, String)
 
 - 
updatepublic void update(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchWorkspaceException
- AccessDeniedException
- LockException
- InvalidItemStateException
- RepositoryException
- See Also:
- Node.update(String)
 
 - 
clonepublic void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchWorkspaceException
- ConstraintViolationException
- VersionException
- AccessDeniedException
- PathNotFoundException
- ItemExistsException
- LockException
- RepositoryException
- See Also:
- Workspace.clone(String, String, String, boolean)
 
 - 
lockpublic LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException Description copied from interface:RepositoryServiceCreate a lock on theNodeidentified by the given id.- Specified by:
- lockin interface- RepositoryService
- Returns:
- The LockInfoassociated with the new lock that has been created.
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException- If the Node identified by the given id cannot be locked due to an existing lock or due to missing mixin type.
- AccessDeniedException
- RepositoryException- If another error occurs.
- See Also:
- Node.lock(boolean, boolean)
 
 - 
lockpublic LockInfo lock(SessionInfo sessionInfo, NodeId nodeId, boolean deep, boolean sessionScoped, long timeoutHint, String ownerHint) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException Description copied from interface:RepositoryServiceCreate a lock on theNodeidentified by the given id.- Specified by:
- lockin interface- RepositoryService
- timeoutHint- long indicating the desired lock timeout in seconds. The implementation is free to ignore the hint.
- ownerHint- String indicating the desired lockOwner info. The implementation is free to ignore the hint.
- Returns:
- The LockInfoassociated with the new lock that has been created.
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException- If the Node identified by the given id cannot be locked due to an existing lock or due to missing mixin type.
- AccessDeniedException
- RepositoryException- If another error occurs.
- See Also:
- LockManager.lock(String, boolean, boolean, long, String)
 
 - 
getLockInfopublic LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId) throws AccessDeniedException, RepositoryException 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 interface- RepositoryService
- Returns:
- null.
- Throws:
- AccessDeniedException
- RepositoryException- If some other error occurs.
- See Also:
- Node.getLock()
 
 - 
refreshLockpublic void refreshLock(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException- If the Node identified by the given id is not locked (any more) or if the- SessionInfodoes not contain the token associated with the lock to be refreshed.
- AccessDeniedException
- RepositoryException- If another error occurs.
- See Also:
- Lock
 
 - 
unlockpublic void unlock(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException- If the Node identified by the given id is not locked or if the- SessionInfodoes not contain the token associated with the lock to be released.
- AccessDeniedException
- RepositoryException- If another error occurs.
- See Also:
- Node.unlock()
 
 - 
checkinpublic NodeId checkin(SessionInfo sessionInfo, NodeId nodeId) throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException Description copied from interface:RepositoryServicePerforms a checkin for theNodeidentified by the givenNodeId.- Specified by:
- checkinin interface- RepositoryService
- Returns:
- NodeIdof newly created version
- Throws:
- UnsupportedRepositoryOperationException- always.
- VersionException
- InvalidItemStateException
- LockException
- RepositoryException
- See Also:
- Node.checkin()
 
 - 
checkoutpublic void checkout(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException Description copied from interface:RepositoryServicePerforms a checkout for theNodeidentified by the givenNodeId. Same asRepositoryService.checkout(SessionInfo, NodeId, NodeId)where theactivityIdisnull.- Specified by:
- checkoutin interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException
- RepositoryException
- See Also:
- Node.checkout()
 
 - 
checkoutpublic void checkout(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, 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 interface- RepositoryService
- activityId- Id of the activity node set to the editing session or- nullif no activity is in effect.
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException
- RepositoryException
 
 - 
checkpointpublic NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, LockException, RepositoryException Description copied from interface:RepositoryServicePerforms a checkpoint for theNodeidentified by the givenNodeId.- Specified by:
- checkpointin interface- RepositoryService
- Returns:
- NodeIdof newly created version
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
- LockException
- See Also:
- VersionManager.checkpoint(String)
 
 - 
checkpointpublic NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId, NodeId activityId) throws UnsupportedRepositoryOperationException, LockException, 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 interface- RepositoryService
- activityId- Id of the activity node set to the editing session or- nullif no activity is in effect.
- Throws:
- UnsupportedRepositoryOperationException- always.
- LockException
- RepositoryException
 
 - 
removeVersionpublic void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException Description copied from interface:RepositoryServiceRemove the version identified by the specifiedversionId.- Specified by:
- removeVersionin interface- RepositoryService
- versionHistoryId-- NodeIdidentifying the version history the version identified by- versionIdbelongs to.
- Throws:
- UnsupportedRepositoryOperationException- always.
- ReferentialIntegrityException
- AccessDeniedException
- VersionException
- RepositoryException
- See Also:
- VersionHistory.removeVersion(String)
 
 - 
restorepublic void restore(SessionInfo sessionInfo, NodeId nodeId, NodeId versionId, boolean removeExisting) throws VersionException, PathNotFoundException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException Description copied from interface:RepositoryServiceRestores the node identified bynodeIdto the state defined by the version with the specifiedversionId.- Specified by:
- restorein interface- RepositoryService
- removeExisting- boolean flag indicating how to deal with an identifier collision that may occur if a node exists outside the subtree to be restored with the same identified as a node that would be introduces by the restore. If the- removeExistingis- truethe restored node takes precedence and the existing node is removed. Otherwise the restore fails.
- Throws:
- UnsupportedRepositoryOperationException- always.
- VersionException
- PathNotFoundException
- ItemExistsException
- 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)
 
 - 
restorepublic void restore(SessionInfo sessionInfo, NodeId[] versionIds, boolean removeExisting) throws ItemExistsException, UnsupportedRepositoryOperationException, VersionException, LockException, InvalidItemStateException, 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 interface- RepositoryService
- removeExisting- boolean flag indicating how to deal with an identifier collision that may occur if a node exists outside the subtrees to be restored with the same identified as any node that would be introduces by the restore. If the- removeExistingis- truethe node to be restored takes precedence and the existing node is removed. Otherwise the restore fails.
- Throws:
- UnsupportedRepositoryOperationException- always.
- ItemExistsException
- VersionException
- LockException
- InvalidItemStateException
- RepositoryException
- See Also:
- Workspace.restore(javax.jcr.version.Version[], boolean)
 
 - 
mergepublic Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, 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 interface- RepositoryService
- Returns:
- an Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation.
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchWorkspaceException
- AccessDeniedException
- MergeException
- LockException
- InvalidItemStateException
- RepositoryException
- See Also:
- Node.merge(String, boolean)
 
 - 
mergepublic Iterator<NodeId> merge(SessionInfo sessionInfo, NodeId nodeId, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, 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 interface- RepositoryService
- Returns:
- an Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation.
- Throws:
- UnsupportedRepositoryOperationException- always.
- NoSuchWorkspaceException
- AccessDeniedException
- MergeException
- LockException
- InvalidItemStateException
- RepositoryException
- See Also:
- VersionManager.merge(String, String, boolean, boolean)
 
 - 
resolveMergeConflictpublic void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceResolve an existing merge conflict present with the node identified by the givenNodeId.- Specified by:
- resolveMergeConflictin interface- RepositoryService
- mergeFailedIds- The- NodeIds remaining in the jcr:mergeFailed REFERENCE property. The version id(s) to be resolved were removed from the array and added to the predecessor ids in case of- Node.doneMerge(Version). In case of a- Node.cancelMerge(Version)the version id only gets removed from the list.
- predecessorIds- The complete set of predecessor id including those that have been added in order to resolve a merge conflict.
- Throws:
- UnsupportedRepositoryOperationException- always.
- VersionException
- InvalidItemStateException
- RepositoryException
- See Also:
- Node.cancelMerge(javax.jcr.version.Version),- Node.doneMerge(javax.jcr.version.Version)
 
 - 
addVersionLabelpublic void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws VersionException, RepositoryException Description copied from interface:RepositoryServiceAdd the given version label in the persistent layer.- Specified by:
- addVersionLabelin interface- RepositoryService
- versionHistoryId-- NodeIdidentifying the version history the version identified by- versionIdbelongs 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: If- truethe label already present gets moved to be now be a label of the version indicated by- versionId. If- falsethis method fails and the label remains with the original version.
- Throws:
- UnsupportedRepositoryOperationException- always.
- VersionException
- RepositoryException
- See Also:
- VersionHistory.addVersionLabel(String, String, boolean)
 
 - 
removeVersionLabelpublic void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException Description copied from interface:RepositoryServiceRemove the given version label in the persistent layer.- Specified by:
- removeVersionLabelin interface- RepositoryService
- versionHistoryId-- NodeIdidentifying the version history the version identified by- versionIdbelongs to.
- versionId-- NodeIdidentifying the version the label belongs to.
- label- The label to be removed.
- Throws:
- UnsupportedRepositoryOperationException- always.
- VersionException
- RepositoryException
- See Also:
- VersionHistory.removeVersionLabel(String)
 
 - 
createActivitypublic NodeId createActivity(SessionInfo sessionInfo, String title) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceCreate a new activity.- Specified by:
- createActivityin interface- RepositoryService
- Returns:
- the NodeIdof the new activity node.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
- See Also:
- VersionManager.createActivity(String)
 
 - 
removeActivitypublic void removeActivity(SessionInfo sessionInfo, NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException Description copied from interface:RepositoryServiceRemoves the activity identified by the specifiedactivityId.- Specified by:
- removeActivityin interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
- See Also:
- VersionManager.removeActivity(Node)
 
 - 
mergeActivitypublic 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 interface- RepositoryService
- Returns:
- an Iteratorover theNodeIds of all nodes that received a merge result of "fail" in the course of this operation.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
 
 - 
createConfigurationpublic NodeId createConfiguration(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException - Specified by:
- createConfigurationin interface- RepositoryService
- Returns:
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException
- See Also:
- VersionManager.createConfiguration(String)
 
 - 
createEventFilterpublic EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, String[] uuid, Name[] nodeTypeName, boolean noLocal) throws UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- 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- A- boolean.
- uuid- Array of jcr:uuid properties.
- nodeTypeName- Array of node type names.
- noLocal- A- boolean.
- Returns:
- the event filter instance with the given parameters.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs while creating the EventFilter.
- See Also:
- ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, String, boolean, String[], String[], boolean)
 
 - 
createSubscriptionpublic Subscription createSubscription(SessionInfo sessionInfo, EventFilter[] filters) throws UnsupportedRepositoryOperationException, 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 interface- RepositoryService
- Parameters:
- sessionInfo- the session info.
- filters- the initial event filters for the subscription.
- Returns:
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs while creating the Subscription.
 
 - 
updateEventFilterspublic void updateEventFilters(Subscription subscription, EventFilter[] filters) 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 interface- RepositoryService
- Parameters:
- subscription- the subscription where the event filters are applied.
- filters- the filters that are applied to the events as they occurred on the repository. An event is included in an event bundle if it is- accepted 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:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs while updating the event filters.
 
 - 
getEventspublic 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 interface- RepositoryService
- Parameters:
- subscription- a subscription.
- timeout- a timeout in milliseconds to wait at most for an event bundle. If- timeoutis up and no event occurred meanwhile an empty array is returned.
- Returns:
- an array of EventBundles representing the events that occurred.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs while retrieving the event bundles.
- InterruptedException- if the calling thread is interrupted while waiting for events within the specified- timeout.
 
 - 
getEventspublic 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 interface- RepositoryService
- Parameters:
- sessionInfo- the session info.
- filter- the event filter to apply. Please note: the- noLocalflag is ignored.
- after- retrieve events that occurred after the given timestamp.
- Returns:
- the event bundle.
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs.
 
 - 
disposepublic void dispose(Subscription subscription) throws RepositoryException 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 interface- RepositoryService
- Throws:
- UnsupportedRepositoryOperationException- always.
- RepositoryException- if an error occurs while the subscription is disposed.
 
 - 
registerNamespacepublic void registerNamespace(SessionInfo sessionInfo, String prefix, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException Description copied from interface:RepositoryServiceRegister a new namespace with the given prefix and uri.- Specified by:
- registerNamespacein interface- RepositoryService
- prefix- Prefix of the namespace to be registered.
- uri- Namespace URI to be registered.
- Throws:
- UnsupportedRepositoryOperationException- always.
- NamespaceException
- AccessDeniedException
- RepositoryException
- See Also:
- NamespaceRegistry.registerNamespace(String, String)
 
 - 
unregisterNamespacepublic void unregisterNamespace(SessionInfo sessionInfo, String uri) throws NamespaceException, UnsupportedRepositoryOperationException, AccessDeniedException, RepositoryException Description copied from interface:RepositoryServiceUnregister the namespace identified by the given uri- Specified by:
- unregisterNamespacein interface- RepositoryService
- uri- Namespace URI to be unregistered.
- Throws:
- UnsupportedRepositoryOperationException- always.
- NamespaceException
- AccessDeniedException
- RepositoryException
- See Also:
- NamespaceRegistry.unregisterNamespace(String)
 
 - 
createWorkspacepublic void createWorkspace(SessionInfo sessionInfo, String name, String srcWorkspaceName) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, 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 interface- RepositoryService
- name- The name of the new workspace.
- srcWorkspaceName- The name of the workspace from which the initial content of the new workspace will be 'cloned'.
- Throws:
- UnsupportedRepositoryOperationException- always.
- AccessDeniedException
- NoSuchWorkspaceException
- RepositoryException
- See Also:
- Workspace.createWorkspace(String),- Workspace.createWorkspace(String, String)
 
 - 
deleteWorkspacepublic void deleteWorkspace(SessionInfo sessionInfo, String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, NoSuchWorkspaceException, RepositoryException Description copied from interface:RepositoryServiceDeletes the workspace with the specifiedname.- Specified by:
- deleteWorkspacein interface- RepositoryService
- name- The name of the workspace to be deleted.
- Throws:
- UnsupportedRepositoryOperationException- always.
- AccessDeniedException
- NoSuchWorkspaceException
- RepositoryException
- See Also:
- Workspace.deleteWorkspace(String)
 
 - 
getSupportedQueryLanguagespublic String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException Description copied from interface:RepositoryServiceReturns a String array identifying all query languages supported by this SPI implementation.- Specified by:
- getSupportedQueryLanguagesin interface- RepositoryService
- Returns:
- String array identifying all query languages supported by this SPI implementation.
- Throws:
- RepositoryException
- See Also:
- QueryManager.getSupportedQueryLanguages()
 
 - 
checkQueryStatementpublic String[] checkQueryStatement(SessionInfo sessionInfo, String statement, String language, Map<String,String> namespaces) throws InvalidQueryException, RepositoryException Description 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 interface- RepositoryService
- 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 query- statement.
- 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)
 
 - 
executeQuerypublic 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: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 interface- RepositoryService
- 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 query- statement.
- namespaces- the locally re-mapped namespace which may be used in the query- statement.
- 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 to- Query.bindValue(String, javax.jcr.Value).
- Returns:
- The query info.
- Throws:
- RepositoryException- if an error occurs.
- See Also:
- Query.execute()
 
 
- 
 
-