|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILockHelper
Helper class that stores, retrieves, and removes lock tokens. In section 8.4.7 of the JSR-170 specification, it states, "the user must additionally ensure that a reference to the lock token is preserved separately so that it can later be attached to another session." This manual step is necessary when using open-scoped locks and this implementation uses open-scoped locks exclusively.
Method Summary | |
---|---|
void |
addLockTokenToSessionIfNecessary(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
Serializable fileId)
Adds the lock token associated with the file with the given file id if the file is locked. |
boolean |
canUnlock(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
javax.jcr.lock.Lock lock)
Returns true if user represented by session can potentially unlock the given lock. |
void |
lockFile(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
Serializable fileId,
String lockMessage)
Locks a file. |
void |
removeLockToken(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
javax.jcr.lock.Lock lock)
Removes a lock token so that it can never be associated with anyone's session again. |
void |
removeLockTokenFromSessionIfNecessary(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
Serializable fileId)
Removes the lock token associated with the file with the given file id |
void |
unlockFile(javax.jcr.Session session,
PentahoJcrConstants pentahoJcrConstants,
Serializable fileId)
Unlocks a file. |
Method Detail |
---|
void removeLockToken(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.lock.Lock lock) throws javax.jcr.RepositoryException
session
- sessionpentahoJcrConstants
- constantslock
- lock
javax.jcr.RepositoryException
- if anything goes wrongboolean canUnlock(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, javax.jcr.lock.Lock lock) throws javax.jcr.RepositoryException
true
if user represented by session can potentially unlock the given lock. This can be a function
of access control or some other mechanism.
session
- sessionpentahoJcrConstants
- constantslock
- lock
javax.jcr.RepositoryException
- if anything goes wrongvoid lockFile(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId, String lockMessage) throws javax.jcr.RepositoryException
session
- sessionpentahoJcrConstants
- constantsfileId
- file idlockMessage
- lock message
javax.jcr.RepositoryException
- if anything goes wrongvoid unlockFile(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId) throws javax.jcr.RepositoryException
session
- sessionpentahoJcrConstants
- constantsfileId
- file id
javax.jcr.RepositoryException
- if anything goes wrongvoid addLockTokenToSessionIfNecessary(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId) throws javax.jcr.RepositoryException
session
- sessionpentahoJcrConstants
- constantsfileId
- file id
javax.jcr.RepositoryException
- if anything goes wrongvoid removeLockTokenFromSessionIfNecessary(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId) throws javax.jcr.RepositoryException
session
- sessionpentahoJcrConstants
- constantsfileId
- file id
javax.jcr.RepositoryException
- if anything goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |