public interface PessimisticLockService
Modifier and Type | Method and Description |
---|---|
void |
delete(String id)
This method deletes the given lock object
|
Map |
establishLocks(Document document,
Map editMode,
Person user)
Deprecated.
For KRAD, use @{code establishPessimisticLocks} to generate locks and
calculatePessimisticLockEditModes to get the edit modes based on the current locks |
boolean |
establishPessimisticLocks(Document document,
Person user,
boolean canEdit)
Establishes pessimistic locks for
user on the document based whether the user can edit
the document. |
void |
establishWorkflowPessimisticLocking(Document document) |
PessimisticLock |
generateNewLock(String documentNumber)
This method will generate a new
PessimisticLock object with a 'document'
lock descriptor |
PessimisticLock |
generateNewLock(String documentNumber,
Person user)
This method will generate a new
PessimisticLock object with a 'document'
lock descriptor |
PessimisticLock |
generateNewLock(String documentNumber,
String lockDescriptor)
This method will generate a new
PessimisticLock object with a lock descriptor of
the given parameter |
PessimisticLock |
generateNewLock(String documentNumber,
String lockDescriptor,
Person user)
This method will generate a new
PessimisticLock object with a lock descriptor of
the given parameter |
Set |
getDocumentActions(Document document,
Person user,
Set<String> documentActions)
Deprecated.
KRAD has integrated this functionality into
TransactionalDocumentAuthorizerBase |
List<PessimisticLock> |
getPessimisticLocksForDocument(String documentNumber)
This method gets all locks associated with the given document number
|
List<PessimisticLock> |
getPessimisticLocksForSession(String sessionId)
Return all locks associated with the given session id
|
boolean |
isPessimisticLockAdminUser(Person user)
This method is used to identify who is an admin user for
PessimisticLock objects |
void |
releaseAllLocksForUser(List<PessimisticLock> locks,
Person user)
This method will release all locks in the given list that are owned by the given user
|
void |
releaseAllLocksForUser(List<PessimisticLock> locks,
Person user,
String lockDescriptor)
This method will release all locks in the given list that are owned by the given user that have a matching lock
descriptor value
|
void |
releaseWorkflowPessimisticLocking(Document document) |
PessimisticLock |
save(PessimisticLock lock)
This method saves the given lock object
|
void delete(String id)
id
- - the id of the lock to deletePessimisticLock generateNewLock(String documentNumber)
PessimisticLock
object with a 'document'
lock descriptordocumentNumber
- - the document number of the document associated with the new lockPessimisticLock
PessimisticLock generateNewLock(String documentNumber, String lockDescriptor)
PessimisticLock
object with a lock descriptor of
the given parameterdocumentNumber
- - the document number of the document associated with the new locklockDescriptor
- - the lock descriptor the new PessimisticLock object should containPessimisticLock
containing the given lockDescriptorPessimisticLock generateNewLock(String documentNumber, Person user)
PessimisticLock
object with a 'document'
lock descriptordocumentNumber
- - the document number of the document associated with the new lockuser
- - the user to set on the new lock being generatedPessimisticLock
PessimisticLock generateNewLock(String documentNumber, String lockDescriptor, Person user)
PessimisticLock
object with a lock descriptor of
the given parameterdocumentNumber
- - the document number of the document associated with the new locklockDescriptor
- - the lock descriptor the new PessimisticLock object should containuser
- - the user to set on the new lock being generatedPessimisticLock
containing the given lockDescriptorList<PessimisticLock> getPessimisticLocksForDocument(String documentNumber)
documentNumber
- - the document number of the document requiring locksPessimisticLock
objects
found for the given documentNumberList<PessimisticLock> getPessimisticLocksForSession(String sessionId)
sessionId
- - the session idPessimisticLock
objects
found for the given sessionIdboolean isPessimisticLockAdminUser(Person user)
PessimisticLock
objectsuser
- - user to verify as adminvoid releaseAllLocksForUser(List<PessimisticLock> locks, Person user)
locks
- - locks to release if owned by given useruser
- - user to check for lock ownershipvoid releaseAllLocksForUser(List<PessimisticLock> locks, Person user, String lockDescriptor)
locks
- - locks to release if owned by given useruser
- - user to check for lock ownershiplockDescriptor
- - lock descriptor value to match locks againstPessimisticLock save(PessimisticLock lock)
boolean establishPessimisticLocks(Document document, Person user, boolean canEdit)
user
on the document
based whether the user
can edit
the document.
Will only establish a new pessimistic lock if one doesn't exist for the user
and one can be created based
on other pessimistic locks in the system and whether user
can edit the document. Will return true
if either a new pessimistic lock was established or one already exists for the user
.
document
- the document on which the locks will be establisheduser
- the user for which the locks are being establishedcanEdit
- whether the user currently can edit the document@Deprecated Map establishLocks(Document document, Map editMode, Person user)
calculatePessimisticLockEditModes
to get the edit modes based on the current locksdocument
- - the document locks are to be established against or byeditMode
- - the editModeuser
- - the user locks are being established forvoid establishWorkflowPessimisticLocking(Document document)
document
- - the document to create the lock against and add the lock tovoid releaseWorkflowPessimisticLocking(Document document)
document
- - document to release locks from@Deprecated Set getDocumentActions(Document document, Person user, Set<String> documentActions)
TransactionalDocumentAuthorizerBase
document
- user
- Copyright © 2005–2016 The Kuali Foundation. All rights reserved.