|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.module.bc.document.service.impl.LockServiceImpl
public class LockServiceImpl
This class implements the LockService interface LockServiceImpl consists of methods that manage the various locks used in the Budget module. Locks are needed to serialize user updates since a BC Edoc is potentially editable by many users simultaneously and the default Optimistic locking scheme used by KFS would produce an inconsistent set of data. Accountlock controls exclusive access to the BC Edoc Positionlock controls exclusive access to a BC Position Fundinglock controls shared funding access. An associated Positionlock must exist before attempting to get a Fundinglock. Accountlock and Fundinglock are mutex. Transactionlock controls exclusive access to serialize updates to the accounting lines in the BC Edoc. A Fundinglock must exist before creating a Transactionlock. The Transactionlock lifecycle is short, required only for the duration of the accounting line update.
Constructor Summary | |
---|---|
LockServiceImpl()
|
Method Summary | |
---|---|
boolean |
checkLockExists(BudgetConstructionLockSummary lockSummary)
Helper method to check if a lock exists for the given parameters. |
BCConstants.LockStatus |
doUnlock(BudgetConstructionLockSummary lockSummary)
Helper method to check the lock type and do the unlock with the lock summary fields. |
List<BudgetConstructionHeader> |
getAllAccountLocks(String lockUserId)
Retrieves all current account locks for the given user (or all locks if user is null/empty). |
List<PendingBudgetConstructionAppointmentFunding> |
getAllPositionFundingLocks(String lockUserId)
Retrieves all current position/funding locks for the given user (or all locks if user is null/empty). |
List<BudgetConstructionHeader> |
getAllTransactionLocks(String lockUserId)
Retrieves all current transaction locks for the given user (or all locks if user is null/empty). |
SortedSet<BudgetConstructionFundingLock> |
getFundingLocks(BudgetConstructionHeader bcHeader)
This returns the set of BCFundingLocks associated with a BCHeader. |
List<BudgetConstructionFundingLock> |
getOrphanedFundingLocks(String lockUserId)
Retrieves all funding locks that do not have a corresponding position lock for the given user (or all locks if user is null/empty). |
List<BudgetConstructionPosition> |
getOrphanedPositionLocks(String lockUserId)
Retrieves all current position locks without a funding lock for the given user (or all locks if user is null/empty). |
boolean |
isAccountLocked(BudgetConstructionHeader bcHeader)
This method checks the database for an accountlock. |
boolean |
isAccountLocked(PendingBudgetConstructionAppointmentFunding appointmentFunding)
This method checks the database for an accountlock according to the given appointment funding. |
boolean |
isAccountLockedByUser(BudgetConstructionHeader budgetConstructionHeader,
org.kuali.rice.kim.bo.Person person)
determine whether the account lock on the given budget document is held by the the specified user |
boolean |
isAccountLockedByUser(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
Checks the given user has an account lock for the given document. |
boolean |
isFundingLockedByUser(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
Checks if the given user has a funding lock for the given accounting key. |
boolean |
isPositionFundingLockedByUser(String positionNumber,
String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
Checks the given user has an position/funding lock for the given position number and accounting key. |
boolean |
isPositionLocked(String positionNumber,
Integer fiscalYear)
This checks the database for an existing positionlock |
boolean |
isPositionLockedByUser(String positionNumber,
Integer fiscalYear,
String principalId)
Checks the given user has an position lock for the given position number. |
boolean |
isTransactionLocked(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear)
This checks the database for an existing transactionlock for the BC EDoc (account). |
boolean |
isTransactionLockedByUser(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
Checks the given user has an transaction lock for the given document. |
BudgetConstructionLockStatus |
lockAccount(BudgetConstructionHeader bcHeader,
String principalId)
This method attempts to lock the given Account for the passed in uuid. |
BudgetConstructionLockStatus |
lockAccountAndCommit(BudgetConstructionHeader bcHeader,
String principalId)
Retrives an account lock (@see org.kuali.kfs.module.bc.document.service.LockService#lockAccount(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader, java.lang.String) and commits the lock. |
BudgetConstructionLockStatus |
lockFunding(BudgetConstructionHeader bcHeader,
String principalId)
This method sets a funding lock associated to the header. |
BudgetConstructionLockStatus |
lockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding,
org.kuali.rice.kim.bo.Person person)
acquire a lock for the given appointment funding |
List<PendingBudgetConstructionAppointmentFunding> |
lockPendingBudgetConstructionAppointmentFundingRecords(List<PendingBudgetConstructionAppointmentFunding> fundingRecords,
org.kuali.rice.kim.bo.Person user)
Retrieves account locks for funding records, for use in the payrate import process. |
BudgetConstructionLockStatus |
lockPosition(BudgetConstructionPosition position,
org.kuali.rice.kim.bo.Person person)
acquire a lock for the given budget position |
BudgetConstructionLockStatus |
lockPosition(String positionNumber,
Integer fiscalYear,
String principalId)
This locks the position, meaning it sets the position lock id field with the puid. |
BudgetConstructionLockStatus |
lockPositionAndActiveFunding(Integer universityFiscalYear,
String positionNumber,
String principalId)
Locks the position record for the given key if not already locked. |
BudgetConstructionLockStatus |
lockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding,
org.kuali.rice.kim.bo.Person person)
attemps to have a transaction lock based on the information provided by the given funding line |
BudgetConstructionLockStatus |
lockTransaction(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
This attempts a transactionlock on a BC Edoc for a pUId. |
void |
setBudgetConstructionDao(BudgetConstructionDao bcHeaderDao)
|
void |
setBudgetConstructionLockDao(BudgetConstructionLockDao budgetConstructionLockDao)
Sets the budgetConstructionLockDao attribute value. |
void |
setBudgetDocumentService(BudgetDocumentService budgetDocumentService)
Sets the budgetDocumentService attribute value. |
BCConstants.LockStatus |
unlockAccount(BudgetConstructionHeader bcHeader)
This method attempts to unlock the given BudgetConstructionHeader. |
void |
unlockFunding(List<PendingBudgetConstructionAppointmentFunding> lockedFundings,
org.kuali.rice.kim.bo.Person person)
release the locks for the given appointment fundings if any |
BCConstants.LockStatus |
unlockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding,
org.kuali.rice.kim.bo.Person person)
release the lock for the given appointment funding if any |
BCConstants.LockStatus |
unlockFunding(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear,
String principalId)
This removes the fundinglock for the account and user |
BCConstants.LockStatus |
unlockPosition(String positionNumber,
Integer fiscalYear)
This removes an existing positionlock |
BCConstants.LockStatus |
unlockPosition(String positionNumber,
Integer fiscalYear,
String principalId)
release the locks on a positions with the given information |
BCConstants.LockStatus |
unlockPositionAndActiveFunding(Integer universityFiscalYear,
String positionNumber,
String principalId)
Unlocks the position and all associated funding lines not marked as delete. |
BCConstants.LockStatus |
unlockPostion(BudgetConstructionPosition position,
org.kuali.rice.kim.bo.Person person)
release the lock for the given position if any |
void |
unlockPostion(List<BudgetConstructionPosition> lockedPositions,
org.kuali.rice.kim.bo.Person person)
release the locks for the given positions if any |
void |
unlockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding,
org.kuali.rice.kim.bo.Person person)
attemps to unlock a transaction based on the information provided by the given funding line |
BCConstants.LockStatus |
unlockTransaction(String chartOfAccountsCode,
String accountNumber,
String subAccountNumber,
Integer fiscalYear)
This removes an existing transactionlock for a BC EDoc (account). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockServiceImpl()
Method Detail |
---|
@Transactional public BudgetConstructionLockStatus lockAccount(BudgetConstructionHeader bcHeader, String principalId)
LockService
lockAccount
in interface LockService
LockService.lockAccount(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader,
java.lang.String)
@Transactional public boolean isAccountLocked(PendingBudgetConstructionAppointmentFunding appointmentFunding)
LockService
isAccountLocked
in interface LockService
appointmentFunding
- the given appointment funding
LockService.isAccountLocked(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding)
@Transactional public boolean isAccountLocked(BudgetConstructionHeader bcHeader)
LockService
isAccountLocked
in interface LockService
LockService.isAccountLocked(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)
@Transactional public boolean isAccountLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
isAccountLockedByUser
in interface LockService
chartOfAccountsCode
- - chart code of account lockaccountNumber
- - account number of account locksubAccountNumber
- - sub account number of account lockfiscalYear
- - fiscal year of account lockprincipalId
- - lock user id
LockService.isAccountLockedByUser(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BCConstants.LockStatus unlockAccount(BudgetConstructionHeader bcHeader)
LockService
unlockAccount
in interface LockService
LockService.unlockAccount(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)
@Transactional public SortedSet<BudgetConstructionFundingLock> getFundingLocks(BudgetConstructionHeader bcHeader)
LockService
getFundingLocks
in interface LockService
LockService.getFundingLocks(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)
@Transactional public BudgetConstructionLockStatus lockFunding(BudgetConstructionHeader bcHeader, String principalId)
LockService
lockFunding
in interface LockService
LockService.lockFunding(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader,
java.lang.String)
public BudgetConstructionLockStatus lockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
LockService
lockFunding
in interface LockService
appointmentFunding
- the given appointment fundingperson
- the specified user
LockService.lockFunding(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding,
org.kuali.rice.kim.bo.Person)
@Transactional public BCConstants.LockStatus unlockFunding(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
unlockFunding
in interface LockService
LockService.unlockFunding(java.lang.String, java.lang.String, java.lang.String,
java.lang.Integer, java.lang.String)
@Transactional public BCConstants.LockStatus unlockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
LockService
unlockFunding
in interface LockService
appointmentFunding
- the given appointment funding that could have lockperson
- the user who owns the lock on the given appointment fundingLockService.unlockFunding(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding,
org.kuali.rice.kim.bo.Person)
@Transactional public void unlockFunding(List<PendingBudgetConstructionAppointmentFunding> lockedFundings, org.kuali.rice.kim.bo.Person person)
LockService
unlockFunding
in interface LockService
lockedFundings
- the given appointment fundings that could have locksperson
- the user who owns the locks on the given appointment fundingsLockService.unlockFunding(java.util.List, org.kuali.rice.kim.bo.Person)
@Transactional public boolean isFundingLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
isFundingLockedByUser
in interface LockService
chartOfAccountsCode
- - chart code of funding lockaccountNumber
- - account number of funding locksubAccountNumber
- - sub account number of funding lockfiscalYear
- - fiscal year of funding lockprincipalId
- - lock user id
LockService.isFundingLockedByUser(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BudgetConstructionLockStatus lockPosition(String positionNumber, Integer fiscalYear, String principalId)
LockService
lockPosition
in interface LockService
LockService.lockPosition(java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BudgetConstructionLockStatus lockPosition(BudgetConstructionPosition position, org.kuali.rice.kim.bo.Person person)
LockService
lockPosition
in interface LockService
position
- the given positionperson
- the specified user
LockService.lockPosition(org.kuali.kfs.module.bc.businessobject.BudgetConstructionPosition,
org.kuali.rice.kim.bo.Person)
@Transactional public boolean isPositionLocked(String positionNumber, Integer fiscalYear)
LockService
isPositionLocked
in interface LockService
LockService.isPositionLocked(java.lang.String, java.lang.Integer)
@Transactional public boolean isPositionLockedByUser(String positionNumber, Integer fiscalYear, String principalId)
LockService
isPositionLockedByUser
in interface LockService
positionNumber
- - position number of position recordfiscalYear
- - fiscal year of position recordprincipalId
- - lock user id
LockService.isPositionLockedByUser(java.lang.String, java.lang.Integer,
java.lang.String)
@Transactional public boolean isPositionFundingLockedByUser(String positionNumber, String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
isPositionFundingLockedByUser
in interface LockService
positionNumber
- - position number of position recordchartOfAccountsCode
- - chart code of funding lockaccountNumber
- - account number of funding locksubAccountNumber
- - sub account number of funding lockfiscalYear
- - fiscal year of position and funding recordprincipalId
- - lock user id
LockService.isPositionFundingLockedByUser(java.lang.String, java.lang.String,
java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BCConstants.LockStatus unlockPosition(String positionNumber, Integer fiscalYear)
LockService
unlockPosition
in interface LockService
LockService.unlockPosition(java.lang.String, java.lang.Integer)
@Transactional public BCConstants.LockStatus unlockPosition(String positionNumber, Integer fiscalYear, String principalId)
LockService
unlockPosition
in interface LockService
positionNumber
- the given position number of a positionfiscalYear
- the given fiscal year of a position
LockService.unlockPosition(java.lang.String, java.lang.Integer,
java.lang.String)
@Transactional public BCConstants.LockStatus unlockPostion(BudgetConstructionPosition position, org.kuali.rice.kim.bo.Person person)
LockService
unlockPostion
in interface LockService
position
- the given budget construction position that could have locksperson
- the specified user who owns the lock on the given positionLockService.unlockPostion(org.kuali.kfs.module.bc.businessobject.BudgetConstructionPosition,
org.kuali.rice.kim.bo.Person)
@Transactional public void unlockPostion(List<BudgetConstructionPosition> lockedPositions, org.kuali.rice.kim.bo.Person person)
LockService
unlockPostion
in interface LockService
lockedPositions
- the given budget construction positions that could have locksperson
- the specified user who owns the locks on the given positionsLockService.unlockPostion(java.util.List, org.kuali.rice.kim.bo.Person)
@Transactional public BudgetConstructionLockStatus lockTransaction(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
lockTransaction
in interface LockService
LockService.lockTransaction(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BudgetConstructionLockStatus lockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
LockService
lockTransaction
in interface LockService
appointmentFunding
- the given appointment fundingperson
- the specified userLockService.lockTransaction(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding,
org.kuali.rice.kim.bo.Person)
@Transactional public boolean isTransactionLocked(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear)
LockService
isTransactionLocked
in interface LockService
LockService.isTransactionLocked(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer)
@Transactional public boolean isTransactionLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
LockService
isTransactionLockedByUser
in interface LockService
chartOfAccountsCode
- - chart code of transaction lockaccountNumber
- - account number of transaction locksubAccountNumber
- - sub account number of transaction lockfiscalYear
- - fiscal year of transaction lockprincipalId
- - lock user id
LockService.isTransactionLockedByUser(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer, java.lang.String)
@Transactional public BCConstants.LockStatus unlockTransaction(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear)
LockService
unlockTransaction
in interface LockService
LockService.unlockTransaction(java.lang.String, java.lang.String,
java.lang.String, java.lang.Integer)
@Transactional public void unlockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
LockService
unlockTransaction
in interface LockService
appointmentFunding
- the given appointment fundingperson
- the specified userLockService.unlockTransaction(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding,
org.kuali.rice.kim.bo.Person)
@Transactional public List<BudgetConstructionHeader> getAllAccountLocks(String lockUserId)
LockService
getAllAccountLocks
in interface LockService
lockUserId
- - universal id that will be used in lock query
LockService.getAllAccountLocks(String lockUserId)
@Transactional public List<BudgetConstructionFundingLock> getOrphanedFundingLocks(String lockUserId)
LockService
getOrphanedFundingLocks
in interface LockService
lockUserId
- - universal id that will be used in lock query
org.kuali.kfs.module.bc.document.service.LockService#getAllFundLocks(String lockUserId)
@Transactional public List<BudgetConstructionPosition> getOrphanedPositionLocks(String lockUserId)
LockService
getOrphanedPositionLocks
in interface LockService
lockUserId
- universal id that will be used in lock query
LockService.getOrphanedPositionLocks(String lockUserId)
@Transactional public List<BudgetConstructionHeader> getAllTransactionLocks(String lockUserId)
LockService
getAllTransactionLocks
in interface LockService
lockUserId
- - universal id that will be used in lock query
LockService.getAllTransactionLocks(String lockUserId)
@Transactional public List<PendingBudgetConstructionAppointmentFunding> getAllPositionFundingLocks(String lockUserId)
LockService
getAllPositionFundingLocks
in interface LockService
lockUserId
- - universal id that will be used in lock query
LockService.getAllPositionFundingLocks(java.lang.String)
@Transactional public boolean checkLockExists(BudgetConstructionLockSummary lockSummary)
LockService
checkLockExists
in interface LockService
lockSummary
- - contains information about the record to unlock
LockService.checkLockExists(org.kuali.kfs.module.bc.businessobject.BudgetConstructionLockSummary)
@Transactional public BCConstants.LockStatus doUnlock(BudgetConstructionLockSummary lockSummary)
LockService
doUnlock
in interface LockService
lockSummary
- - contains information about the record to unlock
LockService.doUnlock(org.kuali.kfs.module.bc.businessobject.BudgetConstructionLockSummary)
@Transactional public boolean isAccountLockedByUser(BudgetConstructionHeader budgetConstructionHeader, org.kuali.rice.kim.bo.Person person)
LockService
isAccountLockedByUser
in interface LockService
budgetConstructionHeader
- the given budget documentperson
- the specified user
LockService.isAccountLockedByUser(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader,
org.kuali.rice.kim.bo.Person)
public void setBudgetConstructionDao(BudgetConstructionDao bcHeaderDao)
public void setBudgetConstructionLockDao(BudgetConstructionLockDao budgetConstructionLockDao)
budgetConstructionLockDao
- The budgetConstructionLockDao to set.public void setBudgetDocumentService(BudgetDocumentService budgetDocumentService)
budgetDocumentService
- The budgetDocumentService to set.@Transactional(propagation=REQUIRES_NEW) public List<PendingBudgetConstructionAppointmentFunding> lockPendingBudgetConstructionAppointmentFundingRecords(List<PendingBudgetConstructionAppointmentFunding> fundingRecords, org.kuali.rice.kim.bo.Person user) throws BudgetConstructionLockUnavailableException
LockService
lockPendingBudgetConstructionAppointmentFundingRecords
in interface LockService
BudgetConstructionLockUnavailableException
LockService.lockPendingBudgetConstructionAppointmentFundingRecords(java.util.List,
org.kuali.rice.kim.bo.Person)
@Transactional(propagation=REQUIRES_NEW) public BudgetConstructionLockStatus lockAccountAndCommit(BudgetConstructionHeader bcHeader, String principalId)
LockService
lockAccountAndCommit
in interface LockService
LockService.lockAccountAndCommit(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader,
java.lang.String)
@Transactional(propagation=REQUIRES_NEW) public BudgetConstructionLockStatus lockPositionAndActiveFunding(Integer universityFiscalYear, String positionNumber, String principalId)
LockService
lockPositionAndActiveFunding
in interface LockService
universityFiscalYear
- budget fiscal year, primary key field for position recordpositionNumber
- position number, primary key field for position recordprincipalId
- current user requesting the lock
BudgetConstructionLockStatus
indicating the status of the lock attempt. Success is returned if all lock attempts were successful, else one of the Failure status codes are returnedLockService.lockPositionAndActiveFunding(java.lang.Integer, java.lang.String,
java.lang.String)
@Transactional(propagation=REQUIRES_NEW) public BCConstants.LockStatus unlockPositionAndActiveFunding(Integer universityFiscalYear, String positionNumber, String principalId)
LockService
unlockPositionAndActiveFunding
in interface LockService
universityFiscalYear
- budget fiscal year, primary key field for position recordpositionNumber
- position number, primary key field for position recordprincipalId
- current user requesting the unlock
LockStatus
indicating the status of the unlock attempt.LockService.unlockPositionAndActiveFunding(java.lang.Integer, java.lang.String,
java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |