|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LockService
This interface defines the methods that a LockService must provide. 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.
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 lockUnivId)
Retrieves all current account locks for the given user (or all locks if user is null/empty). |
List<PendingBudgetConstructionAppointmentFunding> |
getAllPositionFundingLocks(String lockUnivId)
Retrieves all current position/funding locks for the given user (or all locks if user is null/empty). |
List<BudgetConstructionHeader> |
getAllTransactionLocks(String lockUnivId)
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 lockUnivId)
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 lockUnivId)
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. |
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). |
Method Detail |
---|
BudgetConstructionLockStatus lockAccount(BudgetConstructionHeader bcHeader, String principalId)
bcHeader
- principalId
-
boolean isAccountLocked(BudgetConstructionHeader bcHeader)
bcHeader
-
boolean isAccountLocked(PendingBudgetConstructionAppointmentFunding appointmentFunding)
appointmentFunding
- the given appointment funding
boolean isAccountLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
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
BCConstants.LockStatus unlockAccount(BudgetConstructionHeader bcHeader)
bcHeader
-
SortedSet<BudgetConstructionFundingLock> getFundingLocks(BudgetConstructionHeader bcHeader)
bcHeader
-
BudgetConstructionLockStatus lockFunding(BudgetConstructionHeader bcHeader, String principalId)
bcHeader
- principalId
-
BudgetConstructionLockStatus lockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
appointmentFunding
- the given appointment fundingperson
- the specified user
BCConstants.LockStatus unlockFunding(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
chartOfAccountsCode
- accountNumber
- subAccountNumber
- fiscalYear
- principalId
-
BCConstants.LockStatus unlockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
appointmentFunding
- the given appointment funding that could have lockperson
- the user who owns the lock on the given appointment fundingvoid unlockFunding(List<PendingBudgetConstructionAppointmentFunding> lockedFundings, org.kuali.rice.kim.bo.Person person)
lockedFundings
- the given appointment fundings that could have locksperson
- the user who owns the locks on the given appointment fundingsboolean isFundingLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
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
BudgetConstructionLockStatus lockPosition(String positionNumber, Integer fiscalYear, String principalId)
positionNumber
- fiscalYear
- principalId
-
BudgetConstructionLockStatus lockPosition(BudgetConstructionPosition position, org.kuali.rice.kim.bo.Person person)
position
- the given positionperson
- the specified user
boolean isPositionLocked(String positionNumber, Integer fiscalYear)
positionNumber
- fiscalYear
-
boolean isPositionLockedByUser(String positionNumber, Integer fiscalYear, String principalId)
positionNumber
- - position number of position recordfiscalYear
- - fiscal year of position recordprincipalId
- - lock user id
boolean isPositionFundingLockedByUser(String positionNumber, String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
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
BCConstants.LockStatus unlockPosition(String positionNumber, Integer fiscalYear)
positionNumber
- fiscalYear
-
BCConstants.LockStatus unlockPosition(String positionNumber, Integer fiscalYear, String principalId)
positionNumber
- the given position number of a positionfiscalYear
- the given fiscal year of a positionperson
- the specified user who owns the locks on the position
BCConstants.LockStatus unlockPostion(BudgetConstructionPosition position, org.kuali.rice.kim.bo.Person person)
position
- the given budget construction position that could have locksperson
- the specified user who owns the lock on the given positionvoid unlockPostion(List<BudgetConstructionPosition> lockedPositions, org.kuali.rice.kim.bo.Person person)
lockedPositions
- the given budget construction positions that could have locksperson
- the specified user who owns the locks on the given positionsBudgetConstructionLockStatus lockTransaction(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
chartOfAccountsCode
- accountNumber
- subAccountNumber
- fiscalYear
- principalId
-
BudgetConstructionLockStatus lockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
appointmentFunding
- the given appointment fundingperson
- the specified userboolean isTransactionLocked(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear)
chartOfAccountsCode
- accountNumber
- subAccountNumber
- fiscalYear
-
boolean isTransactionLockedByUser(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear, String principalId)
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
BCConstants.LockStatus unlockTransaction(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear)
chartOfAccountsCode
- accountNumber
- subAccountNumber
- fiscalYear
-
void unlockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding, org.kuali.rice.kim.bo.Person person)
appointmentFunding
- the given appointment fundingperson
- the specified userList<BudgetConstructionHeader> getAllAccountLocks(String lockUnivId)
lockUnivId
- - universal id that will be used in lock query
List<BudgetConstructionHeader> getAllTransactionLocks(String lockUnivId)
lockUnivId
- - universal id that will be used in lock query
List<BudgetConstructionFundingLock> getOrphanedFundingLocks(String lockUnivId)
lockUnivId
- - universal id that will be used in lock query
List<PendingBudgetConstructionAppointmentFunding> getAllPositionFundingLocks(String lockUnivId)
lockUnivId
- - universal id that will be used in lock query
List<BudgetConstructionPosition> getOrphanedPositionLocks(String lockUnivId)
lockUnivId
- universal id that will be used in lock query
boolean checkLockExists(BudgetConstructionLockSummary lockSummary)
lockSummary
- - contains information about the record to unlock
BCConstants.LockStatus doUnlock(BudgetConstructionLockSummary lockSummary)
lockSummary
- - contains information about the record to unlock
boolean isAccountLockedByUser(BudgetConstructionHeader budgetConstructionHeader, org.kuali.rice.kim.bo.Person person)
budgetConstructionHeader
- the given budget documentperson
- the specified user
List<PendingBudgetConstructionAppointmentFunding> lockPendingBudgetConstructionAppointmentFundingRecords(List<PendingBudgetConstructionAppointmentFunding> fundingRecords, org.kuali.rice.kim.bo.Person user) throws BudgetConstructionLockUnavailableException
fundingRecords
- user
-
BudgetConstructionLockUnavailableException
BudgetConstructionLockStatus lockAccountAndCommit(BudgetConstructionHeader bcHeader, String principalId)
bcHeader
- principalId
-
BudgetConstructionLockStatus lockPositionAndActiveFunding(Integer universityFiscalYear, String positionNumber, String principalId)
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 returnedBCConstants.LockStatus unlockPositionAndActiveFunding(Integer universityFiscalYear, String positionNumber, String principalId)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |