Interface JackrabbitSession

  • All Superinterfaces:
    Session
    All Known Implementing Classes:
    SessionImpl

    @ProviderType
    public interface JackrabbitSession
    extends Session
    Jackrabbit specific extension of the JCR Session interface.
    • Method Detail

      • hasPermission

        boolean hasPermission​(@NotNull
                              @NotNull String absPath,
                              @NotNull
                              @NotNull String... actions)
                       throws RepositoryException
        Returns true if this Session has permission to perform the specified actions at the specified absPath and false otherwise.

        The actions parameter is a list of action strings. Apart from the actions defined on Session, this variant also allows to specify the following additional actions to provide better permission discovery:

        • {@code add_property}: If hasPermission(path, "add_property") returns true, then this Session has permission to add a new property at path.
        • {@code modify_property}: If hasPermission(path, "modify_property") returns true, then this Session has permission to change a property at path.
        • {@code remove_property}: If hasPermission(path, "remove_property") returns true, then this Session has permission to remove a property at path.
        • {@code remove_node}: If hasPermission(path, "remove_node") returns true, then this Session has permission to remove a node at path.
        • {@code node_type_management}: If hasPermission(path, "node_type_management") returns true, then this Session has permission to explicitly set or change the node type information associated with a node at path.
        • {@code versioning}: If hasPermission(path, "versioning") returns true, then this Session has permission to perform version related operations on a node at path.
        • {@code locking}: If hasPermission(path, "locking") returns true, then this Session has permission to lock and unlock a node at path.
        • {@code read_access_control}: If hasPermission(path, "read_access_control") returns true, then this Session has permission to read access control content stored at an item at path.
        • {@code modify_access_control}: If hasPermission(path, "modify_access_control") returns true, then this Session has permission to modify access control content at an item at path.
        • {@code user_management}: If hasPermission(path, "user_management") returns true, then this Session has permission to perform user management operations at an item at path.
        When more than one action is specified, this method will only return true if this Session has permission to perform all of the listed actions at the specified path.

        The information returned through this method will only reflect the permission status (both JCR defined and implementation-specific) and not other restrictions that may exist, such as node type or other implementation enforced constraints. For example, even though hasPermission may indicate that a particular Session may add a property at /A/B/C, the node type of the node at /A/B may prevent the addition of a property called C.

        Parameters:
        absPath - an absolute path.
        actions - one or several actions.
        Returns:
        true if this Session has permission to perform the specified actions at the specified absPath.
        Throws:
        RepositoryException - if an error occurs.
        See Also:
        Session.hasPermission(String, String)
      • getItemOrNull

        Item getItemOrNull​(String absPath)
                    throws RepositoryException
        Returns the node at the specified absolute path in the workspace. If no such node exists, then it returns the property at the specified path. If no such property exists, then it return null.
        Parameters:
        absPath - An absolute path.
        Returns:
        the specified Item or null.
        Throws:
        RepositoryException - if another error occurs.
        Since:
        2.11.1
      • getPropertyOrNull

        Property getPropertyOrNull​(String absPath)
                            throws RepositoryException
        Returns the property at the specified absolute path in the workspace or null if no such node exists.
        Parameters:
        absPath - An absolute path.
        Returns:
        the specified Property or null.
        Throws:
        RepositoryException - if another error occurs.
        Since:
        2.11.1
      • getNodeOrNull

        Node getNodeOrNull​(String absPath)
                    throws RepositoryException
        Returns the node at the specified absolute path in the workspace or null if no such node exists.
        Parameters:
        absPath - An absolute path.
        Returns:
        the specified Node or null.
        Throws:
        RepositoryException - If another error occurs.
        Since:
        2.11.1
      • getParentOrNull

        @Nullable
        default @Nullable Node getParentOrNull​(@NotNull
                                               @NotNull Item item)
                                        throws RepositoryException
        Returns the parent of the given Item or null if no parent exists (either because the given Item represents the root node or the current session does not have sufficient access to retrieve the parent).
        Parameters:
        item - An Item that has been obtained by the current session.
        Returns:
        The parent node of the given Item or null.
        Throws:
        RepositoryException - If another error occurs.
        Since:
        1.42
        See Also:
        Item.getParent()