Class LockTokenMapper
- java.lang.Object
-
- org.apache.jackrabbit.webdav.jcr.lock.LockTokenMapper
-
public class LockTokenMapper extends Object
Maps between WebDAV lock tokens and JCR lock tokens.The following notations are used:
urn:uuid:UUID of mapping opaquelocktoken:OPENSCOPED:JCRLOCKTOKEN
The first format is used if the JCR lock does not reveal a lock token, such as when it is a session-scoped lock (where SESSIONSCOPED is a constant UUID defined below, and NODEIDENTIFIER is the suitably escaped JCR Node identifier).The second format is used for open-scoped locks (where OPENSCOPED is another constant UUID defined below, and JCRLOCKTOKEN is the suitably escaped JCR lock token).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDavLocktoken(Lock lock)Generate a WebDAV lock token from a JCRLock.static StringgetJcrLockToken(String token)Map from a WebDAV lock token to JCR lock token (requires an open scoped lock).static booleanisForSessionScopedLock(String token)static voidreleaseSessionScopedToken(String nodeIdentifier)Discards the DAV lock token mapping recorded for the given node, if present.
-
-
-
Method Detail
-
getDavLocktoken
public static String getDavLocktoken(Lock lock) throws RepositoryException
Generate a WebDAV lock token from a JCRLock.- Throws:
RepositoryException
-
getJcrLockToken
public static String getJcrLockToken(String token) throws RepositoryException
Map from a WebDAV lock token to JCR lock token (requires an open scoped lock).- Throws:
RepositoryException
-
releaseSessionScopedToken
public static void releaseSessionScopedToken(String nodeIdentifier)
Discards the DAV lock token mapping recorded for the given node, if present. This is called when a lock is removed or newly created, so that the token of an earlier lock on the same node can never be reused against a later one.- Parameters:
nodeIdentifier- the identifier of the lock holding node.
-
isForSessionScopedLock
public static boolean isForSessionScopedLock(String token)
-
-