Class SessionImpl
java.lang.Object
org.apache.jackrabbit.oak.jcr.session.SessionImpl
- All Implemented Interfaces:
Session,JackrabbitSession
TODO document
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.api.JackrabbitSession
ACTION_ADD_PROPERTY, ACTION_LOCKING, ACTION_MODIFY_ACCESS_CONTROL, ACTION_MODIFY_PROPERTY, ACTION_NODE_TYPE_MANAGEMENT, ACTION_READ_ACCESS_CONTROL, ACTION_REMOVE_NODE, ACTION_REMOVE_PROPERTY, ACTION_USER_MANAGEMENT, ACTION_VERSIONINGFields inherited from interface javax.jcr.Session
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLockToken(String lt) voidcheckPermission(String absPath, String actions) voidexportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) voidexportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) voidexportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) voidexportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) @NotNull AccessControlManagergetAttribute(String name) String[]Returns the set of principals associated with this session.@NotNull StringgetExpandedName(@NotNull Item item) Returns the expanded name of the givenItem.@NotNull StringgetExpandedPath(@NotNull Item item) Returns the expanded path of the givenItem.@NotNull ContentHandlergetImportContentHandler(String parentAbsPath, int uuidBehavior) @Nullable ItemgetItemOrNull(String absPath) Returns the node at the specified absolute path in the workspace.@NotNull String[]getNamespacePrefix(String uri) String[]getNamespaceURI(String prefix) @NotNull Node@NotNull NodegetNodeByUUID(String uuid) @Nullable NodegetNodeOrNull(String absPath) Returns the node at the specified absolute path in the workspace ornullif no such node exists.@Nullable NodegetParentOrNull(@NotNull 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).@NotNull PrincipalManagerReturns thePrincipalManagerfor the currentSession.getProperty(String absPath) @Nullable PropertygetPropertyOrNull(String absPath) Returns the property at the specified absolute path in the workspace ornullif no such node exists.@NotNull Repository@NotNull RetentionManager@NotNull Node@NotNull UserManagerReturns theUserManagerfor the currentSession.@NotNull ValueFactory@NotNull WorkspacebooleanhasCapability(String methodName, Object target, Object[] arguments) booleanbooleanhasPermission(@NotNull String absPath, @NotNull String... actions) Returnstrueif thisSessionhas permission to perform the specified actions at the specifiedabsPathandfalseotherwise.booleanhasPermission(String absPath, String actions) @NotNull Sessionimpersonate(Credentials credentials) voidimportXML(String parentAbsPath, InputStream in, int uuidBehavior) booleanisLive()booleanitemExists(String absPath) voidlogout()voidbooleannodeExists(String absPath) booleanpropertyExists(String absPath) voidrefresh(boolean keepChanges) voidremoveItem(String absPath) voidvoidsave()voidsetNamespacePrefix(String prefix, String uri) toString()
-
Constructor Details
-
SessionImpl
-
-
Method Details
-
getNodeOrNull
Description copied from interface:JackrabbitSessionReturns the node at the specified absolute path in the workspace ornullif no such node exists.- Specified by:
getNodeOrNullin interfaceJackrabbitSession- Parameters:
absPath- An absolute path.- Returns:
- the specified
Nodeornull. - Throws:
RepositoryException- If another error occurs.
-
getPropertyOrNull
Description copied from interface:JackrabbitSessionReturns the property at the specified absolute path in the workspace ornullif no such node exists.- Specified by:
getPropertyOrNullin interfaceJackrabbitSession- Parameters:
absPath- An absolute path.- Returns:
- the specified
Propertyornull. - Throws:
RepositoryException- if another error occurs.
-
getItemOrNull
Description copied from interface:JackrabbitSessionReturns 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.- Specified by:
getItemOrNullin interfaceJackrabbitSession- Parameters:
absPath- An absolute path.- Returns:
- the specified
Itemornull. - Throws:
RepositoryException- if another error occurs.
-
getParentOrNull
@Nullable public @Nullable Node getParentOrNull(@NotNull @NotNull Item item) throws RepositoryException Description copied from interface:JackrabbitSessionReturns 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).- Specified by:
getParentOrNullin interfaceJackrabbitSession- Parameters:
item- AnItemthat has been obtained by the current session.- Returns:
- The parent node of the given
Itemornull. - Throws:
RepositoryException- If another error occurs.- See Also:
-
getRepository
- Specified by:
getRepositoryin interfaceSession
-
getUserID
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceSession
-
getAttribute
- Specified by:
getAttributein interfaceSession
-
getWorkspace
- Specified by:
getWorkspacein interfaceSession
-
impersonate
- Specified by:
impersonatein interfaceSession- Throws:
RepositoryException
-
getValueFactory
- Specified by:
getValueFactoryin interfaceSession- Throws:
RepositoryException
-
getRootNode
- Specified by:
getRootNodein interfaceSession- Throws:
RepositoryException
-
getNode
- Specified by:
getNodein interfaceSession- Throws:
RepositoryException
-
nodeExists
- Specified by:
nodeExistsin interfaceSession- Throws:
RepositoryException
-
getNodeByUUID
- Specified by:
getNodeByUUIDin interfaceSession- Throws:
RepositoryException
-
getNodeByIdentifier
- Specified by:
getNodeByIdentifierin interfaceSession- Throws:
RepositoryException
-
getProperty
- Specified by:
getPropertyin interfaceSession- Throws:
RepositoryException
-
propertyExists
- Specified by:
propertyExistsin interfaceSession- Throws:
RepositoryException
-
getItem
- Specified by:
getItemin interfaceSession- Throws:
RepositoryException
-
itemExists
- Specified by:
itemExistsin interfaceSession- Throws:
RepositoryException
-
move
- Specified by:
movein interfaceSession- Throws:
RepositoryException
-
removeItem
- Specified by:
removeItemin interfaceSession- Throws:
RepositoryException
-
save
- Specified by:
savein interfaceSession- Throws:
RepositoryException
-
refresh
- Specified by:
refreshin interfaceSession- Throws:
RepositoryException
-
hasPendingChanges
- Specified by:
hasPendingChangesin interfaceSession- Throws:
RepositoryException
-
isLive
public boolean isLive() -
logout
public void logout() -
getImportContentHandler
@NotNull public @NotNull ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws RepositoryException - Specified by:
getImportContentHandlerin interfaceSession- Throws:
RepositoryException
-
importXML
public void importXML(String parentAbsPath, InputStream in, int uuidBehavior) throws IOException, RepositoryException - Specified by:
importXMLin interfaceSession- Throws:
IOExceptionRepositoryException
-
exportSystemView
public void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException - Specified by:
exportSystemViewin interfaceSession- Throws:
SAXExceptionRepositoryException
-
exportSystemView
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException - Specified by:
exportSystemViewin interfaceSession- Throws:
IOExceptionRepositoryException
-
exportDocumentView
public void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws SAXException, RepositoryException - Specified by:
exportDocumentViewin interfaceSession- Throws:
SAXExceptionRepositoryException
-
exportDocumentView
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException - Specified by:
exportDocumentViewin interfaceSession- Throws:
IOExceptionRepositoryException
-
addLockToken
- Specified by:
addLockTokenin interfaceSession
-
getLockTokens
- Specified by:
getLockTokensin interfaceSession
-
removeLockToken
- Specified by:
removeLockTokenin interfaceSession
-
hasPermission
- Specified by:
hasPermissionin interfaceSession- Throws:
RepositoryException
-
checkPermission
- Specified by:
checkPermissionin interfaceSession- Throws:
RepositoryException
-
hasCapability
public boolean hasCapability(String methodName, Object target, Object[] arguments) throws RepositoryException - Specified by:
hasCapabilityin interfaceSession- Throws:
RepositoryException
-
getAccessControlManager
- Specified by:
getAccessControlManagerin interfaceSession- Throws:
RepositoryException
-
getRetentionManager
- Specified by:
getRetentionManagerin interfaceSession- Throws:
RepositoryException- See Also:
-
setNamespacePrefix
- Specified by:
setNamespacePrefixin interfaceSession- Throws:
RepositoryException
-
getNamespacePrefixes
- Specified by:
getNamespacePrefixesin interfaceSession- Throws:
RepositoryException
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceSession- Throws:
RepositoryException
-
getNamespacePrefix
- Specified by:
getNamespacePrefixin interfaceSession- Throws:
RepositoryException
-
hasPermission
public boolean hasPermission(@NotNull @NotNull String absPath, @NotNull @NotNull String... actions) throws RepositoryException Description copied from interface:JackrabbitSessionReturnstrueif 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:-
: Ifadd_propertyhasPermission(path, "add_property")returnstrue, then thisSessionhas permission to add a new property atpath. -
: Ifmodify_propertyhasPermission(path, "modify_property")returnstrue, then thisSessionhas permission to change a property atpath. -
: Ifremove_propertyhasPermission(path, "remove_property")returnstrue, then thisSessionhas permission to remove a property atpath. -
: Ifremove_nodehasPermission(path, "remove_node")returnstrue, then thisSessionhas permission to remove a node atpath. -
: Ifnode_type_managementhasPermission(path, "node_type_management")returnstrue, then thisSessionhas permission to explicitly set or change the node type information associated with a node atpath. -
: IfversioninghasPermission(path, "versioning")returnstrue, then thisSessionhas permission to perform version related operations on a node atpath. -
: IflockinghasPermission(path, "locking")returnstrue, then thisSessionhas permission to lock and unlock a node atpath. -
: Ifread_access_controlhasPermission(path, "read_access_control")returnstrue, then thisSessionhas permission to read access control content stored at an item atpath. -
: Ifmodify_access_controlhasPermission(path, "modify_access_control")returnstrue, then thisSessionhas permission to modify access control content at an item atpath. -
: Ifuser_managementhasPermission(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.- Specified by:
hasPermissionin interfaceJackrabbitSession- Parameters:
absPath- an absolute path.actions- one or several actions.- Returns:
trueif thisSessionhas permission to perform the specified actions at the specifiedabsPath.- Throws:
RepositoryException- if an error occurs.- See Also:
-
-
getPrincipalManager
Description copied from interface:JackrabbitSessionReturns thePrincipalManagerfor the currentSession.- Specified by:
getPrincipalManagerin interfaceJackrabbitSession- Returns:
- the
PrincipalManagerassociated with thisSession. - Throws:
AccessDeniedException- If the session lacks privileges to access the principal manager or principals in general.UnsupportedRepositoryOperationException- If principal management is not supported.RepositoryException- If another error occurs.- See Also:
-
getUserManager
Description copied from interface:JackrabbitSessionReturns theUserManagerfor the currentSession.- Specified by:
getUserManagerin interfaceJackrabbitSession- Returns:
- the
UserManagerassociated with thisSession. - Throws:
AccessDeniedException- If this session is not allowed to to access user data.UnsupportedRepositoryOperationException- If user management is not supported.RepositoryException- If another error occurs.- See Also:
-
getBoundPrincipals
Description copied from interface:JackrabbitSessionReturns the set of principals associated with this session.- Specified by:
getBoundPrincipalsin interfaceJackrabbitSession- Returns:
- the set of principals associated with this session. Usually this set is unmodifiable.
- Throws:
RepositoryException- in case principal information cannot be retrieved.
-
toString
-
getExpandedName
@NotNull public @NotNull String getExpandedName(@NotNull @NotNull Item item) throws RepositoryException Description copied from interface:JackrabbitSessionReturns the expanded name of the givenItem.- Specified by:
getExpandedNamein interfaceJackrabbitSession- Parameters:
item- the item for which to retrieve the name- Returns:
- the name of the item in expanded form.
- Throws:
NamespaceException- when no expanded name can be determined (for instance, if the registered namespace (name) is invalid)RepositoryException- if another error occurs- See Also:
-
getExpandedPath
@NotNull public @NotNull String getExpandedPath(@NotNull @NotNull Item item) throws RepositoryException Description copied from interface:JackrabbitSessionReturns the expanded path of the givenItem.- Specified by:
getExpandedPathin interfaceJackrabbitSession- Parameters:
item- the item for which to retrieve the name- Returns:
- the path of the item in expanded form.
- Throws:
NamespaceException- when no expanded name can be determined (for instance, if the registered namespace (name) is invalid)RepositoryException- if another error occurs.- See Also:
-