Package org.apache.jackrabbit.api
Interface JackrabbitSession
- 
- All Superinterfaces:
 javax.jcr.Session
- All Known Subinterfaces:
 CRXSession
@ProviderType public interface JackrabbitSession extends javax.jcr.SessionJackrabbit specific extension of the JCRSessioninterface. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTION_ADD_PROPERTYA constant representing theadd_propertyaction string, used to determine if thisSessionhas permission to add a new property.static java.lang.StringACTION_LOCKINGA constant representing thelockingaction string, used to determine if thisSessionhas permission to lock or unlock a node.static java.lang.StringACTION_MODIFY_ACCESS_CONTROLA constant representing themodify_access_controlaction string, used to determine if thisSessionhas permission to modify access control content at the given path.static java.lang.StringACTION_MODIFY_PROPERTYA constant representing themodify_propertyaction string, used to determine if thisSessionhas permission to modify a property.static java.lang.StringACTION_NODE_TYPE_MANAGEMENTA constant representing thenode_type_managementaction string, used to determine if thisSessionhas permission to write node type information of a node.static java.lang.StringACTION_READ_ACCESS_CONTROLA constant representing theread_access_controlaction string, used to determine if thisSessionhas permission to read access control content at the given path.static java.lang.StringACTION_REMOVE_NODEA constant representing theremove_nodeaction string, used to determine if thisSessionhas permission to remove a node.static java.lang.StringACTION_REMOVE_PROPERTYA constant representing theremove_propertyaction string, used to determine if thisSessionhas permission to remove a property.static java.lang.StringACTION_USER_MANAGEMENTA constant representing theuser_managementaction string, used to determine if thisSessionhas permission to perform user management operations at the given path.static java.lang.StringACTION_VERSIONINGA constant representing theversioningaction string, used to determine if thisSessionhas permission to perform version operations on a node. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description javax.jcr.ItemgetItemOrNull(java.lang.String absPath)Returns the node at the specified absolute path in the workspace.javax.jcr.NodegetNodeOrNull(java.lang.String absPath)Returns the node at the specified absolute path in the workspace ornullif no such node exists.default @Nullable javax.jcr.NodegetParentOrNull(@NotNull javax.jcr.Item item)Returns the parent of the givenItemornullif no parent exists (either because the givenItemrepresents the root node or the current session does not have sufficient access to retrieve the parent).PrincipalManagergetPrincipalManager()Returns thePrincipalManagerfor the currentSession.javax.jcr.PropertygetPropertyOrNull(java.lang.String absPath)Returns the property at the specified absolute path in the workspace ornullif no such node exists.UserManagergetUserManager()Returns theUserManagerfor the currentSession.booleanhasPermission(@NotNull java.lang.String absPath, @NotNull java.lang.String... actions)Returnstrueif thisSessionhas permission to perform the specified actions at the specifiedabsPathandfalseotherwise.- 
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 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ACTION_ADD_PROPERTY
static final java.lang.String ACTION_ADD_PROPERTY
A constant representing theadd_propertyaction string, used to determine if thisSessionhas permission to add a new property. 
- 
ACTION_MODIFY_PROPERTY
static final java.lang.String ACTION_MODIFY_PROPERTY
A constant representing themodify_propertyaction string, used to determine if thisSessionhas permission to modify a property. 
- 
ACTION_REMOVE_PROPERTY
static final java.lang.String ACTION_REMOVE_PROPERTY
A constant representing theremove_propertyaction string, used to determine if thisSessionhas permission to remove a property. 
- 
ACTION_REMOVE_NODE
static final java.lang.String ACTION_REMOVE_NODE
A constant representing theremove_nodeaction string, used to determine if thisSessionhas permission to remove a node. 
- 
ACTION_NODE_TYPE_MANAGEMENT
static final java.lang.String ACTION_NODE_TYPE_MANAGEMENT
A constant representing thenode_type_managementaction string, used to determine if thisSessionhas permission to write node type information of a node. 
- 
ACTION_VERSIONING
static final java.lang.String ACTION_VERSIONING
A constant representing theversioningaction string, used to determine if thisSessionhas permission to perform version operations on a node. 
- 
ACTION_LOCKING
static final java.lang.String ACTION_LOCKING
A constant representing thelockingaction string, used to determine if thisSessionhas permission to lock or unlock a node. 
- 
ACTION_READ_ACCESS_CONTROL
static final java.lang.String ACTION_READ_ACCESS_CONTROL
A constant representing theread_access_controlaction string, used to determine if thisSessionhas permission to read access control content at the given path. 
- 
ACTION_MODIFY_ACCESS_CONTROL
static final java.lang.String ACTION_MODIFY_ACCESS_CONTROL
A constant representing themodify_access_controlaction string, used to determine if thisSessionhas permission to modify access control content at the given path. 
- 
ACTION_USER_MANAGEMENT
static final java.lang.String ACTION_USER_MANAGEMENT
A constant representing theuser_managementaction string, used to determine if thisSessionhas permission to perform user management operations at the given path. 
 - 
 
- 
Method Detail
- 
hasPermission
boolean hasPermission(@NotNull @NotNull java.lang.String absPath, @NotNull @NotNull java.lang.String... actions) throws javax.jcr.RepositoryExceptionReturnstrueif thisSessionhas permission to perform the specified actions at the specifiedabsPathandfalseotherwise.The
actionsparameter is a list of action strings. Apart from the actions defined onSession, this variant also allows to specify the following additional actions to provide better permission discovery:-  
{@code add_property}: IfhasPermission(path, "add_property")returnstrue, then thisSessionhas permission to add a new property atpath. -  
{@code modify_property}: IfhasPermission(path, "modify_property")returnstrue, then thisSessionhas permission to change a property atpath. -  
{@code remove_property}: IfhasPermission(path, "remove_property")returnstrue, then thisSessionhas permission to remove a property atpath. -  
{@code remove_node}: IfhasPermission(path, "remove_node")returnstrue, then thisSessionhas permission to remove a node atpath. -  
{@code node_type_management}: IfhasPermission(path, "node_type_management")returnstrue, then thisSessionhas permission to explicitly set or change the node type information associated with a node atpath. -  
{@code versioning}: IfhasPermission(path, "versioning")returnstrue, then thisSessionhas permission to perform version related operations on a node atpath. -  
{@code locking}: IfhasPermission(path, "locking")returnstrue, then thisSessionhas permission to lock and unlock a node atpath. -  
{@code read_access_control}: IfhasPermission(path, "read_access_control")returnstrue, then thisSessionhas permission to read access control content stored at an item atpath. -  
{@code modify_access_control}: IfhasPermission(path, "modify_access_control")returnstrue, then thisSessionhas permission to modify access control content at an item atpath. -  
{@code user_management}: IfhasPermission(path, "user_management")returnstrue, then thisSessionhas permission to perform user management operations at an item atpath. 
trueif thisSessionhas 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
hasPermissionmay indicate that a particularSessionmay add a property at/A/B/C, the node type of the node at/A/Bmay prevent the addition of a property calledC.- Parameters:
 absPath- an absolute path.actions- one or several actions.- Returns:
 trueif thisSessionhas permission to perform the specified actions at the specifiedabsPath.- 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 thePrincipalManagerfor the currentSession.- Returns:
 - the 
PrincipalManagerassociated with thisSession. - 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 theUserManagerfor the currentSession.- Returns:
 - the 
UserManagerassociated with thisSession. - 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(java.lang.String absPath) throws javax.jcr.RepositoryExceptionReturns 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 returnnull.- Parameters:
 absPath- An absolute path.- Returns:
 - the specified 
Itemornull. - Throws:
 javax.jcr.RepositoryException- if another error occurs.- Since:
 - 2.11.1
 
 
- 
getPropertyOrNull
javax.jcr.Property getPropertyOrNull(java.lang.String absPath) throws javax.jcr.RepositoryExceptionReturns the property at the specified absolute path in the workspace ornullif no such node exists.- Parameters:
 absPath- An absolute path.- Returns:
 - the specified 
Propertyornull. - Throws:
 javax.jcr.RepositoryException- if another error occurs.- Since:
 - 2.11.1
 
 
- 
getNodeOrNull
javax.jcr.Node getNodeOrNull(java.lang.String absPath) throws javax.jcr.RepositoryExceptionReturns the node at the specified absolute path in the workspace ornullif no such node exists.- Parameters:
 absPath- An absolute path.- Returns:
 - the specified 
Nodeornull. - Throws:
 javax.jcr.RepositoryException- If another error occurs.- Since:
 - 2.11.1
 
 
- 
getParentOrNull
@Nullable default @Nullable javax.jcr.Node getParentOrNull(@NotNull @NotNull javax.jcr.Item item) throws javax.jcr.RepositoryExceptionReturns the parent of the givenItemornullif no parent exists (either because the givenItemrepresents the root node or the current session does not have sufficient access to retrieve the parent).- Parameters:
 item- AnItemthat has been obtained by the current session.- Returns:
 - The parent node of the given 
Itemornull. - Throws:
 javax.jcr.RepositoryException- If another error occurs.- Since:
 - 1.42
 - See Also:
 Item.getParent()
 
 - 
 
 -