Interface JackrabbitSession

  • All Superinterfaces:
    javax.jcr.Session

    public interface JackrabbitSession
    extends javax.jcr.Session
    Jackrabbit specific extension of the JCR Session interface.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ACTION_ADD_PROPERTY
      A constant representing the add_property action string, used to determine if this Session has permission to add a new property.
      static String ACTION_LOCKING
      A constant representing the locking action string, used to determine if this Session has permission to lock or unlock a node.
      static String ACTION_MODIFY_ACCESS_CONTROL
      A constant representing the modify_access_control action string, used to determine if this Session has permission to modify access control content at the given path.
      static String ACTION_MODIFY_PROPERTY
      A constant representing the modify_property action string, used to determine if this Session has permission to modify a property.
      static String ACTION_NODE_TYPE_MANAGEMENT
      A constant representing the node_type_management action string, used to determine if this Session has permission to write node type information of a node.
      static String ACTION_READ_ACCESS_CONTROL
      A constant representing the read_access_control action string, used to determine if this Session has permission to read access control content at the given path.
      static String ACTION_REMOVE_NODE
      A constant representing the remove_node action string, used to determine if this Session has permission to remove a node.
      static String ACTION_REMOVE_PROPERTY
      A constant representing the remove_property action string, used to determine if this Session has permission to remove a property.
      static String ACTION_USER_MANAGEMENT
      A constant representing the user_management action string, used to determine if this Session has permission to perform user management operations at the given path.
      static String ACTION_VERSIONING
      A constant representing the versioning action string, used to determine if this Session has permission to perform version operations on a node.
      • Fields inherited from interface javax.jcr.Session

        ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.jcr.Item getItemOrNull​(String absPath)
      Returns the node at the specified absolute path in the workspace.
      javax.jcr.Node getNodeOrNull​(String absPath)
      Returns the node at the specified absolute path in the workspace or null if no such node exists.
      PrincipalManager getPrincipalManager()
      Returns the PrincipalManager for the current Session.
      javax.jcr.Property getPropertyOrNull​(String absPath)
      Returns the property at the specified absolute path in the workspace or null if no such node exists.
      UserManager getUserManager()
      Returns the UserManager for the current Session.
      boolean hasPermission​(@NotNull String absPath, @NotNull String... actions)
      Returns true if this Session has permission to perform the specified actions at the specified absPath and false otherwise.
      • Methods inherited from interface javax.jcr.Session

        addLockToken, checkPermission, exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getAccessControlManager, getAttribute, getAttributeNames, getImportContentHandler, getItem, getLockTokens, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getNode, getNodeByIdentifier, getNodeByUUID, getProperty, getRepository, getRetentionManager, getRootNode, getUserID, getValueFactory, getWorkspace, hasCapability, hasPendingChanges, hasPermission, impersonate, importXML, isLive, itemExists, logout, move, nodeExists, propertyExists, refresh, removeItem, removeLockToken, save, setNamespacePrefix
    • Method Detail

      • hasPermission

        boolean hasPermission​(@NotNull
                              @NotNull String absPath,
                              @NotNull
                              @NotNull String... actions)
                       throws javax.jcr.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:
        javax.jcr.RepositoryException - if an error occurs.
        See Also:
        Session.hasPermission(String, String)
      • getPrincipalManager

        PrincipalManager getPrincipalManager()
                                      throws javax.jcr.AccessDeniedException,
                                             javax.jcr.UnsupportedRepositoryOperationException,
                                             javax.jcr.RepositoryException
        Returns the PrincipalManager for the current Session.
        Returns:
        the PrincipalManager associated with this Session.
        Throws:
        javax.jcr.AccessDeniedException - If the session lacks privileges to access the principal manager or principals in general.
        javax.jcr.UnsupportedRepositoryOperationException - If principal management is not supported.
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        PrincipalManager
      • getUserManager

        UserManager getUserManager()
                            throws javax.jcr.AccessDeniedException,
                                   javax.jcr.UnsupportedRepositoryOperationException,
                                   javax.jcr.RepositoryException
        Returns the UserManager for the current Session.
        Returns:
        the UserManager associated with this Session.
        Throws:
        javax.jcr.AccessDeniedException - If this session is not allowed to to access user data.
        javax.jcr.UnsupportedRepositoryOperationException - If user management is not supported.
        javax.jcr.RepositoryException - If another error occurs.
        See Also:
        UserManager
      • getItemOrNull

        javax.jcr.Item getItemOrNull​(String absPath)
                              throws javax.jcr.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:
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        2.11.1
      • getPropertyOrNull

        javax.jcr.Property getPropertyOrNull​(String absPath)
                                      throws javax.jcr.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:
        javax.jcr.RepositoryException - if another error occurs.
        Since:
        2.11.1
      • getNodeOrNull

        javax.jcr.Node getNodeOrNull​(String absPath)
                              throws javax.jcr.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:
        javax.jcr.RepositoryException - If another error occurs.
        Since:
        2.11.1