Interface RepositoryService

  • All Known Implementing Classes:
    AbstractReadableRepositoryService, AbstractRepositoryService, RepositoryServiceLogger

    public interface RepositoryService
    The RepositoryService interface defines methods used to retrieve information from the persistent layer of the repository as well as the methods that modify its persistent state. The implementation of this interface is intended to hold only the state of the persistent layer, no session-related state should be held. Consequently, each method that alters persistent state always includes all the information necessary to fully specify and authorize a change.

    For example, consider the method

        void RepositoryService.copy(SessionInfo sessionInfo,
                                    String srcWorkspaceName,
                                    NodeId srcNodeId, NodeId destParentNodeId,
                                    Name destName)
     
    This method performs an immediate persistent copy of the node identified by srcNodeId and that node's subtree to a position as child of the node identified by destParentNodeId and assigns the newly copied node the name destName.
    The SessionInfo object provides user and workspace identification as well as eventual lock tokens required to execute the copy.
    If srcWorkspaceName differs from the workspace name present with the SessionInfo, the copy is corresponds to a copy across workspaces. The source and destination of the copy operation are specified by NodeIds. The Name holds the new name. Taken together, this information is sufficient to completely specify and authorize the copy operations.

    The RepositoryService in addition allows to create and submit Batch objects, that cover lists of operations that have to be applied to the persistent layer at once.

    • Method Detail

      • getIdFactory

        IdFactory getIdFactory()
                        throws javax.jcr.RepositoryException
        Return the IdFactory.
        Returns:
        The IdFactory.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getNameFactory

        NameFactory getNameFactory()
                            throws javax.jcr.RepositoryException
        Return the NameFactory.
        Returns:
        The NameFactory.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getPathFactory

        PathFactory getPathFactory()
                            throws javax.jcr.RepositoryException
        Return the PathFactory.
        Returns:
        The PathFactory.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getQValueFactory

        QValueFactory getQValueFactory()
                                throws javax.jcr.RepositoryException
        Return the QValueFactory defined with this SPI implementation.
        Returns:
        The QValueFactory.
        Throws:
        javax.jcr.RepositoryException - If an error occurs.
      • getItemInfoCache

        ItemInfoCache getItemInfoCache​(SessionInfo sessionInfo)
                                throws javax.jcr.RepositoryException
        Returns a ItemInfoCache for the given SessionInfo.
        Parameters:
        sessionInfo -
        Returns:
        Throws:
        javax.jcr.RepositoryException
      • getRepositoryDescriptors

        java.util.Map<java.lang.String,​QValue[]> getRepositoryDescriptors()
                                                                         throws javax.jcr.RepositoryException
        Returns all property descriptors that can be exposed with the Repository implementation built on top of this RepositoryService.
        Returns:
        key-value pairs for repository descriptor keys and values.
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Repository.getDescriptorKeys(), Repository.getDescriptor(String)
      • obtain

        SessionInfo obtain​(javax.jcr.Credentials credentials,
                           java.lang.String workspaceName)
                    throws javax.jcr.LoginException,
                           javax.jcr.NoSuchWorkspaceException,
                           javax.jcr.RepositoryException
        Returns a SessionInfo that will be used by other methods on the RepositoryService. An implementation may choose to authenticate the user using the supplied credentials.
        Parameters:
        credentials - the credentials of the user.
        workspaceName - the name of the workspace the SessionInfo should be built for. If the specified workspaceName is null the implementation should select a default workspace.
        Returns:
        a SessionInfo if authentication was successful.
        Throws:
        javax.jcr.LoginException - if authentication of the user fails.
        javax.jcr.NoSuchWorkspaceException - if the specified workspaceName is not recognized.
        javax.jcr.RepositoryException - if an error occurs.
      • obtain

        SessionInfo obtain​(SessionInfo sessionInfo,
                           java.lang.String workspaceName)
                    throws javax.jcr.LoginException,
                           javax.jcr.NoSuchWorkspaceException,
                           javax.jcr.RepositoryException
        Returns a new SessionInfo for the given workspace name that will be used by other methods on the RepositoryService.
        Parameters:
        sessionInfo - for another workspace
        workspaceName - the name of the workspace the new SessionInfo should be built for. If the specified workspaceName is null the implementation should select a default workspace.
        Returns:
        a SessionInfo if authentication was successful.
        Throws:
        javax.jcr.LoginException - if authentication of the user fails.
        javax.jcr.NoSuchWorkspaceException - if the specified workspaceName is not recognized.
        javax.jcr.RepositoryException - if an error occurs.
      • impersonate

        SessionInfo impersonate​(SessionInfo sessionInfo,
                                javax.jcr.Credentials credentials)
                         throws javax.jcr.LoginException,
                                javax.jcr.RepositoryException
        Returns a SessionInfo that will be used by other methods on the RepositoryService.
        Parameters:
        sessionInfo -
        credentials -
        Returns:
        a SessionInfo if impersonate was successful.
        Throws:
        javax.jcr.LoginException
        javax.jcr.RepositoryException
        See Also:
        Session.impersonate(javax.jcr.Credentials)
      • dispose

        void dispose​(SessionInfo sessionInfo)
              throws javax.jcr.RepositoryException
        Indicates to the RepositoryService, that the given SessionInfo will not be used any more.
        Parameters:
        sessionInfo -
        Throws:
        javax.jcr.RepositoryException
      • getWorkspaceNames

        java.lang.String[] getWorkspaceNames​(SessionInfo sessionInfo)
                                      throws javax.jcr.RepositoryException
        Return all workspace names available for the given SessionInfo.
        Parameters:
        sessionInfo -
        Returns:
        An array of workspace names.
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Workspace.getAccessibleWorkspaceNames(), Workspace.getName()
      • isGranted

        boolean isGranted​(SessionInfo sessionInfo,
                          ItemId itemId,
                          java.lang.String[] actions)
                   throws javax.jcr.RepositoryException
        Returns true if all actions defined in the specified array are granted to given SessionInfo. False otherwise.
        Parameters:
        sessionInfo -
        itemId -
        actions -
        Returns:
        true if the session with the given SessionInfo has the specified rights for the given item.
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Session.checkPermission(String, String), Session.hasPermission(String, String)
      • getPrivilegeDefinitions

        PrivilegeDefinition[] getPrivilegeDefinitions​(SessionInfo sessionInfo)
                                               throws javax.jcr.RepositoryException
        TODO
        Parameters:
        sessionInfo -
        Returns:
        Throws:
        javax.jcr.RepositoryException
      • getPrivilegeNames

        Name[] getPrivilegeNames​(SessionInfo sessionInfo,
                                 NodeId id)
                          throws javax.jcr.RepositoryException
        TODO
        Parameters:
        sessionInfo -
        id -
        Returns:
        Throws:
        javax.jcr.RepositoryException
      • getSupportedPrivileges

        PrivilegeDefinition[] getSupportedPrivileges​(SessionInfo sessionInfo,
                                                     NodeId nodeId)
                                              throws javax.jcr.RepositoryException
        TODO
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        Throws:
        javax.jcr.RepositoryException
      • getNodeDefinition

        QNodeDefinition getNodeDefinition​(SessionInfo sessionInfo,
                                          NodeId nodeId)
                                   throws javax.jcr.RepositoryException
        Returns the QNodeDefinition for the Node identified by the given id. This method should only be used if the caller is not able to unambiguously determine the applicable definition from the parent node type definition or if no parent exists (i.e. for the root).
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        The node definition applicable to the Node identified by the given id.
        Throws:
        javax.jcr.RepositoryException
      • getPropertyDefinition

        QPropertyDefinition getPropertyDefinition​(SessionInfo sessionInfo,
                                                  PropertyId propertyId)
                                           throws javax.jcr.RepositoryException
        Returns the QPropertyDefinition for the Property identified by the given id. This method should only be used if the caller is not able to unambiguously determine the applicable definition from the parent node type definition.
        Parameters:
        sessionInfo -
        propertyId -
        Returns:
        The property definition applicable for the Property identified by the given id.
        Throws:
        javax.jcr.RepositoryException
      • getNodeInfo

        NodeInfo getNodeInfo​(SessionInfo sessionInfo,
                             NodeId nodeId)
                      throws javax.jcr.ItemNotFoundException,
                             javax.jcr.RepositoryException
        Retrieve the NodeInfo for the node identified by the given NodeId. See getItemInfos(SessionInfo, ItemId) for a similar method that in addition may return ItemInfos of children Items.
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        The NodeInfo for the node identified by the given id.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
        See Also:
        Session.getItem(String), Node.getNode(String), VersionHistory.getAllVersions(), VersionHistory.getVersion(String), VersionHistory.getVersionByLabel(String), VersionHistory.getRootVersion(), Node.getBaseVersion(), Node.getVersionHistory(), Version.getContainingHistory()
      • getItemInfos

        java.util.Iterator<? extends ItemInfo> getItemInfos​(SessionInfo sessionInfo,
                                                            ItemId itemId)
                                                     throws javax.jcr.ItemNotFoundException,
                                                            javax.jcr.RepositoryException
        Method used to 'batch-read' from the persistent storage. It returns the ItemInfo for the given ItemId as the first element in the Iterator. In addition the iterator may contain arbitrary ItemInfos.
        Parameters:
        sessionInfo -
        itemId -
        Returns:
        An Iterator of ItemInfos containing at least a single element: the ItemInfo that represents the Item identified by the given ItemId. If the Iterator contains multiple elements, the first is expected to represent the Item identified by the given ItemId.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
        See Also:
        Session.getItem(String), Node.getNode(String), VersionHistory.getAllVersions(), VersionHistory.getVersion(String), VersionHistory.getVersionByLabel(String), VersionHistory.getRootVersion(), Node.getBaseVersion(), Node.getVersionHistory(), Version.getContainingHistory()
      • getChildInfos

        java.util.Iterator<ChildInfo> getChildInfos​(SessionInfo sessionInfo,
                                                    NodeId parentId)
                                             throws javax.jcr.ItemNotFoundException,
                                                    javax.jcr.RepositoryException
        Returns an Iterator of ChildInfos present on the Node represented by the given parentId.
        Parameters:
        sessionInfo -
        parentId -
        Returns:
        An Iterator of ChildInfos present on the Node represented by the given parentId.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
      • getReferences

        java.util.Iterator<PropertyId> getReferences​(SessionInfo sessionInfo,
                                                     NodeId nodeId,
                                                     Name propertyName,
                                                     boolean weakReferences)
                                              throws javax.jcr.ItemNotFoundException,
                                                     javax.jcr.RepositoryException
        Returns the Ids of the properties that are referencing the node identified by the given nodeId. If weakReferences is true the ids of WEAKREFERENCE properties are returned, otherwise the property must be of type REFERENCE.
        Parameters:
        sessionInfo -
        nodeId -
        propertyName - name filter of referring properties to be returned; if null then all references are returned.
        weakReferences - If true the properties must be of type PropertyType.WEAKREFERENCE, otherwise of type PropertyType.REFERENCE.
        Returns:
        An Iterator of Ids of the properties that are referencing the node identified by the given nodeId or an empty iterator if the node is not referenceable or no references exist.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        PropertyInfo.getId()
      • getPropertyInfo

        PropertyInfo getPropertyInfo​(SessionInfo sessionInfo,
                                     PropertyId propertyId)
                              throws javax.jcr.ItemNotFoundException,
                                     javax.jcr.RepositoryException
        Returns the PropertyInfo for the Property identified by the given id.
        Parameters:
        sessionInfo -
        propertyId -
        Returns:
        The PropertyInfo for the Property identified by the given id.
        Throws:
        javax.jcr.ItemNotFoundException
        javax.jcr.RepositoryException
        See Also:
        Session.getItem(String), Node.getProperty(String)
      • createBatch

        Batch createBatch​(SessionInfo sessionInfo,
                          ItemId itemId)
                   throws javax.jcr.RepositoryException
        Indicates the start of a set of operations that cause modifications on the underlying persistence layer. All modification called on the Batch must be executed at once or non must be executed upon calling submit(Batch).
        Parameters:
        sessionInfo -
        itemId - Id of the Item that is a common ancestor of all Items affected upon batch execution. This Item might 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 submit(Batch).
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Item.save(), Session.save(), Batch
      • submit

        void submit​(Batch batch)
             throws javax.jcr.PathNotFoundException,
                    javax.jcr.ItemNotFoundException,
                    javax.jcr.nodetype.NoSuchNodeTypeException,
                    javax.jcr.ValueFormatException,
                    javax.jcr.version.VersionException,
                    javax.jcr.lock.LockException,
                    javax.jcr.nodetype.ConstraintViolationException,
                    javax.jcr.AccessDeniedException,
                    javax.jcr.UnsupportedRepositoryOperationException,
                    javax.jcr.RepositoryException
        Completes the given Batch or discard all the previous modifications. See createBatch(SessionInfo,ItemId) for additional information regarding batch creation.
        Parameters:
        batch -
        Throws:
        javax.jcr.PathNotFoundException
        javax.jcr.ItemNotFoundException
        javax.jcr.nodetype.NoSuchNodeTypeException
        javax.jcr.ValueFormatException
        javax.jcr.version.VersionException
        javax.jcr.lock.LockException
        javax.jcr.nodetype.ConstraintViolationException
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Batch
      • createTree

        Tree createTree​(SessionInfo sessionInfo,
                        Batch batch,
                        Name nodeName,
                        Name primaryTypeName,
                        java.lang.String uniqueId)
                 throws javax.jcr.RepositoryException
        Creates a new Tree that can be populated and later on be applied to the specified Batch by calling #setTree.
        Parameters:
        nodeName -
        primaryTypeName -
        uniqueId -
        Returns:
        a new Tree instance.
        Throws:
        javax.jcr.RepositoryException
      • importXml

        void importXml​(SessionInfo sessionInfo,
                       NodeId parentId,
                       java.io.InputStream xmlStream,
                       int uuidBehaviour)
                throws javax.jcr.ItemExistsException,
                       javax.jcr.PathNotFoundException,
                       javax.jcr.version.VersionException,
                       javax.jcr.nodetype.ConstraintViolationException,
                       javax.jcr.lock.LockException,
                       javax.jcr.AccessDeniedException,
                       javax.jcr.UnsupportedRepositoryOperationException,
                       javax.jcr.RepositoryException
        Imports the data present in the given InputStream into the persistent layer. Note, that the implementation is responsible for validating the data presented and for the integrity of the repository upon completion.
        Parameters:
        sessionInfo -
        parentId -
        xmlStream -
        uuidBehaviour -
        Throws:
        javax.jcr.ItemExistsException
        javax.jcr.PathNotFoundException
        javax.jcr.version.VersionException
        javax.jcr.nodetype.ConstraintViolationException
        javax.jcr.lock.LockException
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Workspace.importXML(String, java.io.InputStream, int)
      • move

        void move​(SessionInfo sessionInfo,
                  NodeId srcNodeId,
                  NodeId destParentNodeId,
                  Name destName)
           throws javax.jcr.ItemExistsException,
                  javax.jcr.PathNotFoundException,
                  javax.jcr.version.VersionException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.RepositoryException
        Moves the node identified by the given srcNodeId (and its entire subtree) to the new location defined by destParentNodeId and a new name (destName).
        Parameters:
        sessionInfo -
        srcNodeId -
        destParentNodeId -
        destName -
        Throws:
        javax.jcr.ItemExistsException
        javax.jcr.PathNotFoundException
        javax.jcr.version.VersionException
        javax.jcr.nodetype.ConstraintViolationException
        javax.jcr.lock.LockException
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Workspace.move(String, String)
      • copy

        void copy​(SessionInfo sessionInfo,
                  java.lang.String srcWorkspaceName,
                  NodeId srcNodeId,
                  NodeId destParentNodeId,
                  Name destName)
           throws javax.jcr.NoSuchWorkspaceException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.PathNotFoundException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.lock.LockException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.RepositoryException
        Clone the subtree identified by the given srcNodeId in workspace named srcWorkspaceName to the destination in the workspace specified by the given SessionInfo. The destination is composed by the given parent id and the new name as indicated by destName.

        Note, that srcWorkspaceName may be the same as the one specified within the SessionInfo. In this case the copy corresponds to a copy within a single workspace.

        Parameters:
        sessionInfo -
        srcWorkspaceName -
        srcNodeId -
        destParentNodeId -
        destName -
        Throws:
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.nodetype.ConstraintViolationException
        javax.jcr.version.VersionException
        javax.jcr.AccessDeniedException
        javax.jcr.PathNotFoundException
        javax.jcr.ItemExistsException
        javax.jcr.lock.LockException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Workspace.copy(String, String), Workspace.copy(String, String, String)
      • update

        void update​(SessionInfo sessionInfo,
                    NodeId nodeId,
                    java.lang.String srcWorkspaceName)
             throws javax.jcr.NoSuchWorkspaceException,
                    javax.jcr.AccessDeniedException,
                    javax.jcr.lock.LockException,
                    javax.jcr.InvalidItemStateException,
                    javax.jcr.RepositoryException
        Updates the node identified by the given NodeId replacing it (an the complete subtree) with a clone of its corresponding node present in the workspace with the given srcWorkspaceName.
        Parameters:
        sessionInfo -
        nodeId -
        srcWorkspaceName -
        Throws:
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.AccessDeniedException
        javax.jcr.lock.LockException
        javax.jcr.InvalidItemStateException
        javax.jcr.RepositoryException
        See Also:
        Node.update(String)
      • clone

        void clone​(SessionInfo sessionInfo,
                   java.lang.String srcWorkspaceName,
                   NodeId srcNodeId,
                   NodeId destParentNodeId,
                   Name destName,
                   boolean removeExisting)
            throws javax.jcr.NoSuchWorkspaceException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.version.VersionException,
                   javax.jcr.AccessDeniedException,
                   javax.jcr.PathNotFoundException,
                   javax.jcr.ItemExistsException,
                   javax.jcr.lock.LockException,
                   javax.jcr.UnsupportedRepositoryOperationException,
                   javax.jcr.RepositoryException
        Clone the subtree identified by the given srcNodeId in workspace named srcWorkspaceName to the destination in the workspace specified by the given SessionInfo. The destination is composed by the given parent id and the new name as indicated by destName.
        Parameters:
        sessionInfo -
        srcWorkspaceName -
        srcNodeId -
        destParentNodeId -
        destName -
        removeExisting -
        Throws:
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.nodetype.ConstraintViolationException
        javax.jcr.version.VersionException
        javax.jcr.AccessDeniedException
        javax.jcr.PathNotFoundException
        javax.jcr.ItemExistsException
        javax.jcr.lock.LockException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Workspace.clone(String, String, String, boolean)
      • getLockInfo

        LockInfo getLockInfo​(SessionInfo sessionInfo,
                             NodeId nodeId)
                      throws javax.jcr.AccessDeniedException,
                             javax.jcr.RepositoryException
        Returns the lock information that applies to Node identified by the given NodeId or null. If the implementation does not support locking at all, this method always returns null.
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        The lock information for the Node identified by the given nodeId or null if no lock applies to that Node.
        Throws:
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException - If some other error occurs.
        See Also:
        Node.getLock()
      • lock

        LockInfo lock​(SessionInfo sessionInfo,
                      NodeId nodeId,
                      boolean deep,
                      boolean sessionScoped)
               throws javax.jcr.UnsupportedRepositoryOperationException,
                      javax.jcr.lock.LockException,
                      javax.jcr.AccessDeniedException,
                      javax.jcr.RepositoryException
        Create a lock on the Node identified by the given id.
        Parameters:
        sessionInfo -
        nodeId -
        deep -
        sessionScoped -
        Returns:
        The LockInfo associated with the new lock that has been created.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - If this SPI implementation does not support locking at all.
        javax.jcr.lock.LockException - If the Node identified by the given id cannot be locked due to an existing lock or due to missing mixin type.
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        Node.lock(boolean, boolean)
      • lock

        LockInfo lock​(SessionInfo sessionInfo,
                      NodeId nodeId,
                      boolean deep,
                      boolean sessionScoped,
                      long timeoutHint,
                      java.lang.String ownerHint)
               throws javax.jcr.UnsupportedRepositoryOperationException,
                      javax.jcr.lock.LockException,
                      javax.jcr.AccessDeniedException,
                      javax.jcr.RepositoryException
        Create a lock on the Node identified by the given id.
        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 LockInfo associated with the new lock that has been created.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - If this SPI implementation does not support locking at all.
        javax.jcr.lock.LockException - If the Node identified by the given id cannot be locked due to an existing lock or due to missing mixin type.
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException - If another error occurs.
        Since:
        JCR 2.0
        See Also:
        LockManager.lock(String, boolean, boolean, long, String)
      • refreshLock

        void refreshLock​(SessionInfo sessionInfo,
                         NodeId nodeId)
                  throws javax.jcr.UnsupportedRepositoryOperationException,
                         javax.jcr.lock.LockException,
                         javax.jcr.AccessDeniedException,
                         javax.jcr.RepositoryException
        Explicit refresh of an existing lock. Existing locks should be refreshed implicitly with all read and write methods listed here.
        Parameters:
        sessionInfo -
        nodeId -
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - If this SPI implementation does not support locking at all.
        javax.jcr.lock.LockException - If the Node identified by the given id is not locked (any more) or if the SessionInfo does not contain the token associated with the lock to be refreshed.
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        Lock
      • unlock

        void unlock​(SessionInfo sessionInfo,
                    NodeId nodeId)
             throws javax.jcr.UnsupportedRepositoryOperationException,
                    javax.jcr.lock.LockException,
                    javax.jcr.AccessDeniedException,
                    javax.jcr.RepositoryException
        Releases the lock on the Node identified by the given NodeId.

        Please note, that on logout all session-scoped locks must be released by calling unlock.

        Parameters:
        sessionInfo -
        nodeId -
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - If this SPI implementation does not support locking at all.
        javax.jcr.lock.LockException - If the Node identified by the given id is not locked or if the SessionInfo does not contain the token associated with the lock to be released.
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        Node.unlock()
      • checkin

        NodeId checkin​(SessionInfo sessionInfo,
                       NodeId nodeId)
                throws javax.jcr.version.VersionException,
                       javax.jcr.UnsupportedRepositoryOperationException,
                       javax.jcr.InvalidItemStateException,
                       javax.jcr.lock.LockException,
                       javax.jcr.RepositoryException
        Performs a checkin for the Node identified by the given NodeId.
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        NodeId of newly created version
        Throws:
        javax.jcr.version.VersionException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.InvalidItemStateException
        javax.jcr.lock.LockException
        javax.jcr.RepositoryException
        See Also:
        Node.checkin()
      • checkout

        void checkout​(SessionInfo sessionInfo,
                      NodeId nodeId)
               throws javax.jcr.UnsupportedRepositoryOperationException,
                      javax.jcr.lock.LockException,
                      javax.jcr.RepositoryException
        Performs a checkout for the Node identified by the given NodeId. Same as checkout(SessionInfo, NodeId, NodeId) where the activityId is null.
        Parameters:
        sessionInfo -
        nodeId -
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.lock.LockException
        javax.jcr.RepositoryException
        See Also:
        Node.checkout()
      • checkout

        void checkout​(SessionInfo sessionInfo,
                      NodeId nodeId,
                      NodeId activityId)
               throws javax.jcr.UnsupportedRepositoryOperationException,
                      javax.jcr.lock.LockException,
                      javax.jcr.RepositoryException
        Performs a checkout for the Node identified by the given NodeId and for activity identified by the specified activityId. If the activityId is null this corresponds to checkout(SessionInfo, NodeId)
        Parameters:
        sessionInfo -
        nodeId -
        activityId - Id of the activity node set to the editing session or null if no activity is in effect.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.lock.LockException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
      • checkpoint

        NodeId checkpoint​(SessionInfo sessionInfo,
                          NodeId nodeId)
                   throws javax.jcr.UnsupportedRepositoryOperationException,
                          javax.jcr.RepositoryException
        Performs a checkpoint for the Node identified by the given NodeId.
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        NodeId of newly created version
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        VersionManager.checkpoint(String)
      • checkpoint

        NodeId checkpoint​(SessionInfo sessionInfo,
                          NodeId nodeId,
                          NodeId activityId)
                   throws javax.jcr.UnsupportedRepositoryOperationException,
                          javax.jcr.RepositoryException
        Performs a checkpoint for the Node identified by the given NodeId. For the checkout part the specified activityId is taken into account as specified in checkout(SessionInfo, NodeId, NodeId).
        Parameters:
        sessionInfo -
        nodeId -
        activityId - Id of the activity node set to the editing session or null if no activity is in effect.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.lock.LockException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
      • removeVersion

        void removeVersion​(SessionInfo sessionInfo,
                           NodeId versionHistoryId,
                           NodeId versionId)
                    throws javax.jcr.ReferentialIntegrityException,
                           javax.jcr.AccessDeniedException,
                           javax.jcr.UnsupportedRepositoryOperationException,
                           javax.jcr.version.VersionException,
                           javax.jcr.RepositoryException
        Remove the version identified by the specified versionId.
        Parameters:
        sessionInfo -
        versionHistoryId - NodeId identifying the version history the version identified by versionId belongs to.
        versionId -
        Throws:
        javax.jcr.ReferentialIntegrityException
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.version.VersionException
        javax.jcr.RepositoryException
        See Also:
        VersionHistory.removeVersion(String)
      • restore

        void restore​(SessionInfo sessionInfo,
                     NodeId nodeId,
                     NodeId versionId,
                     boolean removeExisting)
              throws javax.jcr.version.VersionException,
                     javax.jcr.PathNotFoundException,
                     javax.jcr.ItemExistsException,
                     javax.jcr.UnsupportedRepositoryOperationException,
                     javax.jcr.lock.LockException,
                     javax.jcr.InvalidItemStateException,
                     javax.jcr.RepositoryException
        Restores the node identified by nodeId to the state defined by the version with the specified versionId.
        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 the removeExisting is true the restored node takes precedence and the existing node is removed. Otherwise the restore fails.
        Throws:
        javax.jcr.version.VersionException
        javax.jcr.PathNotFoundException
        javax.jcr.ItemExistsException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.lock.LockException
        javax.jcr.InvalidItemStateException
        javax.jcr.RepositoryException
        See Also:
        Node.restore(String, boolean), Node.restore(javax.jcr.version.Version, boolean), Node.restore(javax.jcr.version.Version, String, boolean), Node.restoreByLabel(String, boolean)
      • restore

        void restore​(SessionInfo sessionInfo,
                     NodeId[] versionIds,
                     boolean removeExisting)
              throws javax.jcr.ItemExistsException,
                     javax.jcr.UnsupportedRepositoryOperationException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.InvalidItemStateException,
                     javax.jcr.RepositoryException
        Restore multiple versions at once. The versions to be restored are identified by the given array of NodeIds.
        Parameters:
        sessionInfo -
        versionIds -
        removeExisting - boolean flag indicating how to deal with an identifier collision that may occur if a node exists outside the subtrees to be restored with the same identified as any node that would be introduces by the restore. If the removeExisting is true the node to be restored takes precedence and the existing node is removed. Otherwise the restore fails.
        Throws:
        javax.jcr.ItemExistsException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.version.VersionException
        javax.jcr.lock.LockException
        javax.jcr.InvalidItemStateException
        javax.jcr.RepositoryException
        See Also:
        Workspace.restore(javax.jcr.version.Version[], boolean)
      • merge

        java.util.Iterator<NodeId> merge​(SessionInfo sessionInfo,
                                         NodeId nodeId,
                                         java.lang.String srcWorkspaceName,
                                         boolean bestEffort)
                                  throws javax.jcr.NoSuchWorkspaceException,
                                         javax.jcr.AccessDeniedException,
                                         javax.jcr.MergeException,
                                         javax.jcr.lock.LockException,
                                         javax.jcr.InvalidItemStateException,
                                         javax.jcr.RepositoryException
        Merge the node identified by the given NodeId and its subtree with the corresponding node present in the workspace with the name of srcWorkspaceName.
        Parameters:
        sessionInfo -
        nodeId -
        srcWorkspaceName -
        bestEffort -
        Returns:
        an Iterator over the NodeIds of all nodes that received a merge result of "fail" in the course of this operation.
        Throws:
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.AccessDeniedException
        javax.jcr.MergeException
        javax.jcr.lock.LockException
        javax.jcr.InvalidItemStateException
        javax.jcr.RepositoryException
        See Also:
        Node.merge(String, boolean)
      • merge

        java.util.Iterator<NodeId> merge​(SessionInfo sessionInfo,
                                         NodeId nodeId,
                                         java.lang.String srcWorkspaceName,
                                         boolean bestEffort,
                                         boolean isShallow)
                                  throws javax.jcr.NoSuchWorkspaceException,
                                         javax.jcr.AccessDeniedException,
                                         javax.jcr.MergeException,
                                         javax.jcr.lock.LockException,
                                         javax.jcr.InvalidItemStateException,
                                         javax.jcr.RepositoryException
        Merge the node identified by the given NodeId and its subtree with the corresponding node present in the workspace with the name of srcWorkspaceName.
        Parameters:
        sessionInfo -
        nodeId -
        srcWorkspaceName -
        bestEffort -
        Returns:
        an Iterator over the NodeIds of all nodes that received a merge result of "fail" in the course of this operation.
        Throws:
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.AccessDeniedException
        javax.jcr.MergeException
        javax.jcr.lock.LockException
        javax.jcr.InvalidItemStateException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        VersionManager.merge(String, String, boolean, boolean)
      • resolveMergeConflict

        void resolveMergeConflict​(SessionInfo sessionInfo,
                                  NodeId nodeId,
                                  NodeId[] mergeFailedIds,
                                  NodeId[] predecessorIds)
                           throws javax.jcr.version.VersionException,
                                  javax.jcr.InvalidItemStateException,
                                  javax.jcr.UnsupportedRepositoryOperationException,
                                  javax.jcr.RepositoryException
        Resolve an existing merge conflict present with the node identified by the given NodeId.
        Parameters:
        sessionInfo -
        nodeId -
        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:
        javax.jcr.version.VersionException
        javax.jcr.InvalidItemStateException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        Node.cancelMerge(javax.jcr.version.Version), Node.doneMerge(javax.jcr.version.Version)
      • addVersionLabel

        void addVersionLabel​(SessionInfo sessionInfo,
                             NodeId versionHistoryId,
                             NodeId versionId,
                             Name label,
                             boolean moveLabel)
                      throws javax.jcr.version.VersionException,
                             javax.jcr.RepositoryException
        Add the given version label in the persistent layer.
        Parameters:
        sessionInfo -
        versionHistoryId - NodeId identifying the version history the version identified by versionId belongs to.
        versionId - NodeId identifying the version the label belongs to.
        label - The label to be added.
        moveLabel - If the label is already assigned to a version within the same version history this parameter has the following effect: If true the label already present gets moved to be now be a label of the version indicated by versionId. If false this method fails and the label remains with the original version.
        Throws:
        javax.jcr.version.VersionException
        javax.jcr.RepositoryException
        See Also:
        VersionHistory.addVersionLabel(String, String, boolean)
      • removeVersionLabel

        void removeVersionLabel​(SessionInfo sessionInfo,
                                NodeId versionHistoryId,
                                NodeId versionId,
                                Name label)
                         throws javax.jcr.version.VersionException,
                                javax.jcr.RepositoryException
        Remove the given version label in the persistent layer.
        Parameters:
        sessionInfo -
        versionHistoryId - NodeId identifying the version history the version identified by versionId belongs to.
        versionId - NodeId identifying the version the label belongs to.
        label - The label to be removed.
        Throws:
        javax.jcr.version.VersionException
        javax.jcr.RepositoryException
        See Also:
        VersionHistory.removeVersionLabel(String)
      • createActivity

        NodeId createActivity​(SessionInfo sessionInfo,
                              java.lang.String title)
                       throws javax.jcr.UnsupportedRepositoryOperationException,
                              javax.jcr.RepositoryException
        Create a new activity.
        Parameters:
        sessionInfo -
        title -
        Returns:
        the NodeId of the new activity node.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        VersionManager.createActivity(String)
      • removeActivity

        void removeActivity​(SessionInfo sessionInfo,
                            NodeId activityId)
                     throws javax.jcr.UnsupportedRepositoryOperationException,
                            javax.jcr.RepositoryException
        Removes the activity identified by the specified activityId.
        Parameters:
        sessionInfo -
        activityId -
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        VersionManager.removeActivity(Node)
      • mergeActivity

        java.util.Iterator<NodeId> mergeActivity​(SessionInfo sessionInfo,
                                                 NodeId activityId)
                                          throws javax.jcr.UnsupportedRepositoryOperationException,
                                                 javax.jcr.RepositoryException
        Merges the activity identified by the given activityId into the workspace the specified sessionInfo has been created for.
        Parameters:
        sessionInfo -
        activityId -
        Returns:
        an Iterator over the NodeIds of all nodes that received a merge result of "fail" in the course of this operation.
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
      • createConfiguration

        NodeId createConfiguration​(SessionInfo sessionInfo,
                                   NodeId nodeId)
                            throws javax.jcr.UnsupportedRepositoryOperationException,
                                   javax.jcr.RepositoryException
        Parameters:
        sessionInfo -
        nodeId -
        Returns:
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.RepositoryException
        See Also:
        VersionManager.createConfiguration(String)
      • getSupportedQueryLanguages

        java.lang.String[] getSupportedQueryLanguages​(SessionInfo sessionInfo)
                                               throws javax.jcr.RepositoryException
        Returns a String array identifying all query languages supported by this SPI implementation.
        Parameters:
        sessionInfo -
        Returns:
        String array identifying all query languages supported by this SPI implementation.
        Throws:
        javax.jcr.RepositoryException
        See Also:
        QueryManager.getSupportedQueryLanguages()
      • checkQueryStatement

        java.lang.String[] checkQueryStatement​(SessionInfo sessionInfo,
                                               java.lang.String statement,
                                               java.lang.String language,
                                               java.util.Map<java.lang.String,​java.lang.String> namespaces)
                                        throws javax.jcr.query.InvalidQueryException,
                                               javax.jcr.RepositoryException
        Checks if the query statement is valid according to the specified query language and returns the bind variable names found in the query statement.
        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:
        javax.jcr.query.InvalidQueryException - if the query statement is invalid or the language is not supported.
        javax.jcr.RepositoryException - if an error occurs while checking the statement.
        See Also:
        QueryManager.createQuery(String, String)
      • executeQuery

        QueryInfo executeQuery​(SessionInfo sessionInfo,
                               java.lang.String statement,
                               java.lang.String language,
                               java.util.Map<java.lang.String,​java.lang.String> namespaces,
                               long limit,
                               long offset,
                               java.util.Map<java.lang.String,​QValue> values)
                        throws javax.jcr.RepositoryException
        Execute the given query statement with the specified query language. The additional namespaces parameter provides a mapping of prefix to namespace uri in order to be able to properly resolve prefix:localname patterns present within the query statement.
        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 -1 is no maximum is set.
        offset - The offset in the total result set or -1 is no offset is set.
        values - A Map of name/value pairs collected upon calls to Query.bindValue(String, javax.jcr.Value).
        Returns:
        The query info.
        Throws:
        javax.jcr.RepositoryException - if an error occurs.
        See Also:
        Query.execute()
      • createEventFilter

        EventFilter createEventFilter​(SessionInfo sessionInfo,
                                      int eventTypes,
                                      Path absPath,
                                      boolean isDeep,
                                      java.lang.String[] uuid,
                                      Name[] nodeTypeName,
                                      boolean noLocal)
                               throws javax.jcr.UnsupportedRepositoryOperationException,
                                      javax.jcr.RepositoryException
        Creates an event filter. If the repository supports observation, the filter created is based on the parameters available in ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, java.lang.String, boolean, java.lang.String[], java.lang.String[], boolean).

        Note, that an SPI implementation may support observation even if the corresponding repository descriptor does not return 'true'.

        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:
        javax.jcr.UnsupportedRepositoryOperationException - if this SPI implementation does not allow to create event filters.
        javax.jcr.RepositoryException - if an error occurs while creating the EventFilter.
        See Also:
        ObservationManager.addEventListener(javax.jcr.observation.EventListener, int, String, boolean, String[], String[], boolean)
      • createSubscription

        Subscription createSubscription​(SessionInfo sessionInfo,
                                        EventFilter[] filters)
                                 throws javax.jcr.UnsupportedRepositoryOperationException,
                                        javax.jcr.RepositoryException
        Creates a new Subscription for events with an initial set of EventFilters. The returned subscription must provide events from the time when the subscription was created. If an empty array of filters is passed no events will be available through the created subscription unless the filters are later updated by calling updateEventFilters(Subscription, EventFilter[]).
        Parameters:
        sessionInfo - the session info.
        filters - the initial event filters for the subscription.
        Returns:
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - if this SPI implementation does not support observation.
        javax.jcr.RepositoryException - if an error occurs while creating the Subscription.
      • updateEventFilters

        void updateEventFilters​(Subscription subscription,
                                EventFilter[] filters)
                         throws javax.jcr.RepositoryException
        Updates events filters on the subscription. When this method returns all events that go through the passed subscription and have been generated after this method call must be filtered using the passed filters.

        An implementation is required to accept at least event filter instances created by 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 getEvents(Subscription, long) using the same subscription instance as a parameter.

        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:
        javax.jcr.RepositoryException - if an error occurs while updating the event filters.
      • getEvents

        EventBundle[] getEvents​(Subscription subscription,
                                long timeout)
                         throws javax.jcr.RepositoryException,
                                java.lang.InterruptedException
        Retrieves the events that occurred since the last call to this method for the passed subscription.

        Note, that an SPI implementation may support observation even if the corresponding repository descriptor does return 'false'.

        An implementation should un-block a calling thread and let it return if the associated subscription is disposed by another thread.

        Parameters:
        subscription - a subscription.
        timeout - a timeout in milliseconds to wait at most for an event bundle. If timeout is up and no event occurred meanwhile an empty array is returned.
        Returns:
        an array of EventBundles representing the events that occurred.
        Throws:
        javax.jcr.RepositoryException - if an error occurs while retrieving the event bundles.
        java.lang.InterruptedException - if the calling thread is interrupted while waiting for events within the specified timeout.
      • getEvents

        EventBundle getEvents​(SessionInfo sessionInfo,
                              EventFilter filter,
                              long after)
                       throws javax.jcr.RepositoryException,
                              javax.jcr.UnsupportedRepositoryOperationException
        Returns events from the EventJournal after a given point in time. The returned event bundle may only contain events up to a given time. In order to retrieve more events a client must call this method again with the timestamp from the last event bundle. An empty bundle indicates that there are no more events.
        Parameters:
        sessionInfo - the session info.
        filter - the event filter to apply. Please note: the noLocal flag is ignored.
        after - retrieve events that occurred after the given timestamp.
        Returns:
        the event bundle.
        Throws:
        javax.jcr.RepositoryException - if an error occurs.
        javax.jcr.UnsupportedRepositoryOperationException - if the underlying implementation does not support event journaling.
      • dispose

        void dispose​(Subscription subscription)
              throws javax.jcr.RepositoryException
        Indicates that the passed subscription is no longer needed.

        Note on thread-safety: it is permissible to call this methods while another thread is blocked in calling getEvents(Subscription, long) using the same subscription instance as a parameter.

        Throws:
        javax.jcr.RepositoryException - if an error occurs while the subscription is disposed.
      • getRegisteredNamespaces

        java.util.Map<java.lang.String,​java.lang.String> getRegisteredNamespaces​(SessionInfo sessionInfo)
                                                                                throws javax.jcr.RepositoryException
        Retrieve all registered namespaces. The namespace to prefix mapping is done using the prefix as key and the namespace as value in the Map.
        Parameters:
        sessionInfo -
        Returns:
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Workspace.getNamespaceRegistry(), NamespaceRegistry.getPrefixes(), NamespaceRegistry.getURIs()
      • getNamespaceURI

        java.lang.String getNamespaceURI​(SessionInfo sessionInfo,
                                         java.lang.String prefix)
                                  throws javax.jcr.NamespaceException,
                                         javax.jcr.RepositoryException
        Returns the namespace URI for the given namespace prefix.
        Parameters:
        sessionInfo - the session info.
        prefix - a namespace prefix to resolve.
        Returns:
        the namespace URI for the given namespace prefix.
        Throws:
        javax.jcr.NamespaceException - if prefix is not mapped to a namespace URI.
        javax.jcr.RepositoryException - if another error occurs.
        See Also:
        NamespaceRegistry.getURI(String)
      • getNamespacePrefix

        java.lang.String getNamespacePrefix​(SessionInfo sessionInfo,
                                            java.lang.String uri)
                                     throws javax.jcr.NamespaceException,
                                            javax.jcr.RepositoryException
        Returns the namespace prefix for the given namespace uri.
        Parameters:
        sessionInfo - the session info.
        uri - the namespace URI.
        Returns:
        the namespace prefix.
        Throws:
        javax.jcr.NamespaceException - if the URI unknown.
        javax.jcr.RepositoryException - if another error occurs.
        See Also:
        NamespaceRegistry.getPrefix(String)
      • registerNamespace

        void registerNamespace​(SessionInfo sessionInfo,
                               java.lang.String prefix,
                               java.lang.String uri)
                        throws javax.jcr.NamespaceException,
                               javax.jcr.UnsupportedRepositoryOperationException,
                               javax.jcr.AccessDeniedException,
                               javax.jcr.RepositoryException
        Register a new namespace with the given prefix and uri.
        Parameters:
        sessionInfo -
        prefix - Prefix of the namespace to be registered.
        uri - Namespace URI to be registered.
        Throws:
        javax.jcr.NamespaceException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException
        See Also:
        NamespaceRegistry.registerNamespace(String, String)
      • unregisterNamespace

        void unregisterNamespace​(SessionInfo sessionInfo,
                                 java.lang.String uri)
                          throws javax.jcr.NamespaceException,
                                 javax.jcr.UnsupportedRepositoryOperationException,
                                 javax.jcr.AccessDeniedException,
                                 javax.jcr.RepositoryException
        Unregister the namespace identified by the given uri
        Parameters:
        sessionInfo -
        uri - Namespace URI to be unregistered.
        Throws:
        javax.jcr.NamespaceException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.AccessDeniedException
        javax.jcr.RepositoryException
        See Also:
        NamespaceRegistry.unregisterNamespace(String)
      • getQNodeTypeDefinitions

        java.util.Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions​(SessionInfo sessionInfo)
                                                                 throws javax.jcr.RepositoryException
        Retrieve the QNodeTypeDefinitions of all registered nodetypes.
        Parameters:
        sessionInfo -
        Returns:
        Iterator of QNodeTypeDefinitions.
        Throws:
        javax.jcr.RepositoryException
        See Also:
        Workspace.getNodeTypeManager(), NodeTypeManager.getAllNodeTypes(), NodeTypeManager.getMixinNodeTypes(), NodeTypeManager.getPrimaryNodeTypes(), NodeTypeManager.getNodeType(String)
      • getQNodeTypeDefinitions

        java.util.Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions​(SessionInfo sessionInfo,
                                                                        Name[] nodetypeNames)
                                                                 throws javax.jcr.RepositoryException
        Retrieve QNodeTypeDefinitions 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 additional QNodeTypeDefinitions present in the Iterator irrespective whether they have been loaded before or not.
        Parameters:
        sessionInfo -
        nodetypeNames - names of node types to retrieve
        Returns:
        QNodeTypeDefinition
        Throws:
        javax.jcr.nodetype.NoSuchNodeTypeException - if for any of the given names no QNodeTypeDefinition exists.
        javax.jcr.RepositoryException
        See Also:
        Workspace.getNodeTypeManager(), NodeTypeManager.getAllNodeTypes(), NodeTypeManager.getMixinNodeTypes(), NodeTypeManager.getPrimaryNodeTypes(), NodeTypeManager.getNodeType(String)
      • registerNodeTypes

        void registerNodeTypes​(SessionInfo sessionInfo,
                               QNodeTypeDefinition[] nodeTypeDefinitions,
                               boolean allowUpdate)
                        throws javax.jcr.nodetype.InvalidNodeTypeDefinitionException,
                               javax.jcr.nodetype.NodeTypeExistsException,
                               javax.jcr.UnsupportedRepositoryOperationException,
                               javax.jcr.RepositoryException
        Registers the node types with the specified QNodeTypeDefinitions. If allowUpdate is true this method may also be used to reregister existing node types with a modified definition, otherwise this method will fail with NodeTypeExistsException if any of the specified definition has the name of an already registered node type.
        Parameters:
        sessionInfo -
        nodeTypeDefinitions -
        allowUpdate -
        Throws:
        javax.jcr.nodetype.InvalidNodeTypeDefinitionException - If any of the specified definitions is invalid.
        javax.jcr.nodetype.NodeTypeExistsException - If any of the specified definitions has the name of an already registered node type and allowUpdate is false.
        javax.jcr.UnsupportedRepositoryOperationException - If registering node types is not supported.
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        NodeTypeManager.registerNodeTypes(javax.jcr.nodetype.NodeTypeDefinition[], boolean)
      • unregisterNodeTypes

        void unregisterNodeTypes​(SessionInfo sessionInfo,
                                 Name[] nodeTypeNames)
                          throws javax.jcr.UnsupportedRepositoryOperationException,
                                 javax.jcr.nodetype.NoSuchNodeTypeException,
                                 javax.jcr.RepositoryException
        Unregisters the node types with the specified names.
        Parameters:
        sessionInfo -
        nodeTypeNames -
        Throws:
        javax.jcr.UnsupportedRepositoryOperationException - If unregistering node types is not supported.
        javax.jcr.nodetype.NoSuchNodeTypeException - If any of the specified names has no corresponding registered node type.
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        NodeTypeManager.unregisterNodeTypes(String[])
      • createWorkspace

        void createWorkspace​(SessionInfo sessionInfo,
                             java.lang.String name,
                             java.lang.String srcWorkspaceName)
                      throws javax.jcr.AccessDeniedException,
                             javax.jcr.UnsupportedRepositoryOperationException,
                             javax.jcr.NoSuchWorkspaceException,
                             javax.jcr.RepositoryException
        Create a new workspace with the specified name. If srcWorkspaceName isn't null the content of that workspace is 'cloned' to the new workspace as inital content, otherwise an empty workspace will be created.
        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:
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        Workspace.createWorkspace(String), Workspace.createWorkspace(String, String)
      • deleteWorkspace

        void deleteWorkspace​(SessionInfo sessionInfo,
                             java.lang.String name)
                      throws javax.jcr.AccessDeniedException,
                             javax.jcr.UnsupportedRepositoryOperationException,
                             javax.jcr.NoSuchWorkspaceException,
                             javax.jcr.RepositoryException
        Deletes the workspace with the specified name.
        Parameters:
        sessionInfo -
        name - The name of the workspace to be deleted.
        Throws:
        javax.jcr.AccessDeniedException
        javax.jcr.UnsupportedRepositoryOperationException
        javax.jcr.NoSuchWorkspaceException
        javax.jcr.RepositoryException
        Since:
        JCR 2.0
        See Also:
        Workspace.deleteWorkspace(String)