@Transactional public class PessimisticLockServiceImpl extends Object implements PessimisticLockService
| Constructor and Description |
|---|
PessimisticLockServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected PessimisticLock |
createNewPessimisticLock(Document document,
Map editMode,
org.kuali.rice.kim.api.identity.Person user)
This method creates a new
PessimisticLock object using the given document and user. |
void |
delete(String id) |
Map |
establishLocks(Document document,
Map editMode,
org.kuali.rice.kim.api.identity.Person user)
This implementation will check the given document, editMode map, and user object to verify Pessimistic Locking.
|
void |
establishWorkflowPessimisticLocking(Document document)
This method creates a new
PessimisticLock when Workflow processing requires one |
PessimisticLock |
generateNewLock(String documentNumber) |
PessimisticLock |
generateNewLock(String documentNumber,
org.kuali.rice.kim.api.identity.Person user) |
PessimisticLock |
generateNewLock(String documentNumber,
String lockDescriptor) |
PessimisticLock |
generateNewLock(String documentNumber,
String lockDescriptor,
org.kuali.rice.kim.api.identity.Person user) |
BusinessObjectService |
getBusinessObjectService() |
DataDictionaryService |
getDataDictionaryService() |
Set |
getDocumentActions(Document document,
org.kuali.rice.kim.api.identity.Person user,
Set<String> documentActions) |
protected Map |
getEditModeWithEditableModesRemoved(Map currentEditMode)
This method is used to remove edit modes from the given map that allow the user to edit data on the document.
|
protected Map |
getEntryEditModeReplacementMode(Map.Entry entry)
This method is used to return values needed to replace the given 'entry type' edit mode
Map.Entry with one that will not allow the user to enter data on the document |
org.kuali.rice.kim.api.permission.PermissionService |
getPermissionService() |
org.kuali.rice.kim.api.identity.PersonService |
getPersonService() |
List<PessimisticLock> |
getPessimisticLocksForDocument(String documentNumber) |
List<PessimisticLock> |
getPessimisticLocksForSession(String sessionId) |
protected org.kuali.rice.kim.api.identity.Person |
getWorkflowPessimisticLockOwnerUser()
This method identifies the user that should be used to create and clear
PessimisticLock objects required by
Workflow.The default is the Kuali system user defined by RiceConstants#SYSTEM_USER. |
protected boolean |
hasPreRouteEditAuthorization(Document document,
org.kuali.rice.kim.api.identity.Person user)
This method checks to see that the given user has a lock on the document and return true if one is found.
|
protected boolean |
isEntryEditMode(Map.Entry entry)
This method is used to check if the given
Map.Entry is an 'entry type' edit mode and that the value is set to
signify that this user has that edit mode available to them |
protected boolean |
isLockRequiredByUser(Document document,
Map editMode,
org.kuali.rice.kim.api.identity.Person user)
This method is used to check if the given parameters warrant a new lock to be created for the given user.
|
boolean |
isPessimisticLockAdminUser(org.kuali.rice.kim.api.identity.Person user) |
void |
releaseAllLocksForUser(List<PessimisticLock> locks,
org.kuali.rice.kim.api.identity.Person user) |
void |
releaseAllLocksForUser(List<PessimisticLock> locks,
org.kuali.rice.kim.api.identity.Person user,
String lockDescriptor) |
void |
releaseWorkflowPessimisticLocking(Document document)
This method releases locks created via the
establishWorkflowPessimisticLocking(Document) method for the given document |
PessimisticLock |
save(PessimisticLock lock) |
void |
setBusinessObjectService(BusinessObjectService businessObjectService) |
protected boolean |
usesPessimisticLocking(Document document) |
public PessimisticLockServiceImpl()
public void delete(String id)
delete in interface PessimisticLockServicePessimisticLockService.delete(java.lang.String)public PessimisticLock generateNewLock(String documentNumber)
generateNewLock in interface PessimisticLockServicePessimisticLockService.generateNewLock(String)public PessimisticLock generateNewLock(String documentNumber, String lockDescriptor)
generateNewLock in interface PessimisticLockServicePessimisticLockService.generateNewLock(java.lang.String)public PessimisticLock generateNewLock(String documentNumber, org.kuali.rice.kim.api.identity.Person user)
generateNewLock in interface PessimisticLockServicePessimisticLockService.generateNewLock(java.lang.String, org.kuali.rice.kim.api.identity.Person)public PessimisticLock generateNewLock(String documentNumber, String lockDescriptor, org.kuali.rice.kim.api.identity.Person user)
generateNewLock in interface PessimisticLockServicePessimisticLockService.generateNewLock(java.lang.String, java.lang.String, org.kuali.rice.kim.api.identity.Person)public List<PessimisticLock> getPessimisticLocksForDocument(String documentNumber)
getPessimisticLocksForDocument in interface PessimisticLockServicePessimisticLockService.getPessimisticLocksForDocument(java.lang.String)public List<PessimisticLock> getPessimisticLocksForSession(String sessionId)
getPessimisticLocksForSession in interface PessimisticLockServicePessimisticLockService.getPessimisticLocksForSession(java.lang.String)public boolean isPessimisticLockAdminUser(org.kuali.rice.kim.api.identity.Person user)
isPessimisticLockAdminUser in interface PessimisticLockServicePessimisticLockService.isPessimisticLockAdminUser(org.kuali.rice.kim.api.identity.Person)public void releaseAllLocksForUser(List<PessimisticLock> locks, org.kuali.rice.kim.api.identity.Person user)
releaseAllLocksForUser in interface PessimisticLockServicePessimisticLockService.releaseAllLocksForUser(java.util.List, org.kuali.rice.kim.api.identity.Person)public void releaseAllLocksForUser(List<PessimisticLock> locks, org.kuali.rice.kim.api.identity.Person user, String lockDescriptor)
public PessimisticLock save(PessimisticLock lock)
save in interface PessimisticLockServicePessimisticLockService.save(org.kuali.rice.krad.document.authorization.PessimisticLock)public BusinessObjectService getBusinessObjectService()
public void setBusinessObjectService(BusinessObjectService businessObjectService)
public Set getDocumentActions(Document document, org.kuali.rice.kim.api.identity.Person user, Set<String> documentActions)
getDocumentActions in interface PessimisticLockServicedocument - user - protected boolean hasPreRouteEditAuthorization(Document document, org.kuali.rice.kim.api.identity.Person user)
document - - document to checkuser - - current user#hasInitiateAuthorization(Document, Person)), and the document has a lock owned by the given
user. If the document is not using Pessimistic Locking the value returned will be that returned by
#hasInitiateAuthorization(Document, Person).protected boolean usesPessimisticLocking(Document document)
public void establishWorkflowPessimisticLocking(Document document)
PessimisticLock when Workflow processing requires oneestablishWorkflowPessimisticLocking in interface PessimisticLockServicedocument - - the document to create the lock against and add the lock toorg.kuali.rice.kns.document.authorization.DocumentAuthorizer#establishWorkflowPessimisticLocking(org.kuali.rice.krad.document.Document)public void releaseWorkflowPessimisticLocking(Document document)
establishWorkflowPessimisticLocking(Document) method for the given documentreleaseWorkflowPessimisticLocking in interface PessimisticLockServicedocument - - document to release locks fromorg.kuali.rice.kns.document.authorization.DocumentAuthorizer#releaseWorkflowPessimisticLocking(org.kuali.rice.krad.document.Document)protected org.kuali.rice.kim.api.identity.Person getWorkflowPessimisticLockOwnerUser()
PessimisticLock objects required by
Workflow.RiceConstants#SYSTEM_USER. This method can be overriden by
implementing documents if another user is needed.Person objectpublic Map establishLocks(Document document, Map editMode, org.kuali.rice.kim.api.identity.Person user)
PessimisticLock object will be created and set on the document for the given user.establishLocks in interface PessimisticLockServiceorg.kuali.rice.kns.document.authorization.DocumentAuthorizer#establishLocks(org.kuali.rice.krad.document.Document,
java.util.Map, org.kuali.rice.kim.api.identity.Person)protected boolean isLockRequiredByUser(Document document, Map editMode, org.kuali.rice.kim.api.identity.Person user)
isEntryEditMode(java.util.Map.Entry) method.document - -
document to verify lock creation againsteditMode - -
edit modes list to check for 'entry type' edit modesuser - -
user the lock will be 'owned' byprotected Map getEditModeWithEditableModesRemoved(Map currentEditMode)
isEntryEditMode(java.util.Map.Entry) method to identify if an edit mode is defined as an
'entry type' edit mode. It also uses the getEntryEditModeReplacementMode(java.util.Map.Entry) method to replace
any 'entry type' edit modes it finds.currentEditMode - -
current set of edit modes the user has assigned to themgetEntryEditModeReplacementMode(java.util.Map.Entry) methodprotected boolean isEntryEditMode(Map.Entry entry)
Map.Entry is an 'entry type' edit mode and that the value is set to
signify that this user has that edit mode available to thementry - -
the Map.Entry object that contains an edit mode such as the ones returned but
#getEditMode(Document, Person)#EDIT_MODE_DEFAULT_TRUE_VALUE... false if notprotected Map getEntryEditModeReplacementMode(Map.Entry entry)
Map.Entry with one that will not allow the user to enter data on the documententry - - the current 'entry type' edit mode to replaceprotected PessimisticLock createNewPessimisticLock(Document document, Map editMode, org.kuali.rice.kim.api.identity.Person user)
PessimisticLock object using the given document and user. If the document's
useCustomLockDescriptors() method returns true then the new lock will also have a custom lock descriptor
value set to the return value of the document's getCustomLockDescriptor(Person) method.document - -
document to place the lock oneditMode - -
current edit modes for given useruser - -
user who will 'own' the new lock objectpublic org.kuali.rice.kim.api.identity.PersonService getPersonService()
public DataDictionaryService getDataDictionaryService()
public org.kuali.rice.kim.api.permission.PermissionService getPermissionService()
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.