org.kuali.kfs.module.bc.document.service.impl
Class LockServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.bc.document.service.impl.LockServiceImpl
All Implemented Interfaces:
LockService

public class LockServiceImpl
extends Object
implements LockService

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

LockServiceImpl

public LockServiceImpl()
Method Detail

lockAccount

@Transactional
public BudgetConstructionLockStatus lockAccount(BudgetConstructionHeader bcHeader,
                                                              String principalId)
Description copied from interface: LockService
This method attempts to lock the given Account for the passed in uuid. Finding an exising account lock for the uuid returns success without having to relock After setting an accountlock, if any funding locks are found, it releases the accountlock and sets BCLockStatus with LockStatus.FLOCK_FOUND. Accountlocks and Fundinglocks are mutex

Specified by:
lockAccount in interface LockService
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, OPTIMISTIC_EX (lost optimistic lock), FLOCK_FOUND (also sets fundingLocks), BY_OTHER (also sets accountLockOwner), NO_DOOR (null bcHeader)
See Also:
LockService.lockAccount(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader, java.lang.String)

isAccountLocked

@Transactional
public boolean isAccountLocked(PendingBudgetConstructionAppointmentFunding appointmentFunding)
Description copied from interface: LockService
This method checks the database for an accountlock according to the given appointment funding. It assumes a valid appointmentFunding parameter

Specified by:
isAccountLocked in interface LockService
Parameters:
appointmentFunding - the given appointment funding
Returns:
Returns true if locked, false if not locked or not found in the database
See Also:
LockService.isAccountLocked(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding)

isAccountLocked

@Transactional
public boolean isAccountLocked(BudgetConstructionHeader bcHeader)
Description copied from interface: LockService
This method checks the database for an accountlock. It assumes a valid bcHeader parameter

Specified by:
isAccountLocked in interface LockService
Returns:
Returns true if locked, false if not locked or not found in the database
See Also:
LockService.isAccountLocked(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)

isAccountLockedByUser

@Transactional
public boolean isAccountLockedByUser(String chartOfAccountsCode,
                                                   String accountNumber,
                                                   String subAccountNumber,
                                                   Integer fiscalYear,
                                                   String principalId)
Description copied from interface: LockService
Checks the given user has an account lock for the given document.

Specified by:
isAccountLockedByUser in interface LockService
Parameters:
chartOfAccountsCode - - chart code of account lock
accountNumber - - account number of account lock
subAccountNumber - - sub account number of account lock
fiscalYear - - fiscal year of account lock
principalId - - lock user id
Returns:
true if locked, false if not locked or not found in the database
See Also:
LockService.isAccountLockedByUser(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

unlockAccount

@Transactional
public BCConstants.LockStatus unlockAccount(BudgetConstructionHeader bcHeader)
Description copied from interface: LockService
This method attempts to unlock the given BudgetConstructionHeader.

Specified by:
unlockAccount in interface LockService
Returns:
LockStatus.SUCCESS, NO_DOOR (not found), OPTIMISTIC_EX (lost optimistic lock)
See Also:
LockService.unlockAccount(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)

getFundingLocks

@Transactional
public SortedSet<BudgetConstructionFundingLock> getFundingLocks(BudgetConstructionHeader bcHeader)
Description copied from interface: LockService
This returns the set of BCFundingLocks associated with a BCHeader. The set is sorted by the Person name

Specified by:
getFundingLocks in interface LockService
Returns:
SortedSet
See Also:
LockService.getFundingLocks(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader)

lockFunding

@Transactional
public BudgetConstructionLockStatus lockFunding(BudgetConstructionHeader bcHeader,
                                                              String principalId)
Description copied from interface: LockService
This method sets a funding lock associated to the header. It tests for an accountlock before/after to ensure there is no locking conflict. Finding an accountlock after setting a fundinglock causes the fundinglock to be released. account locks and funding locks are mutex. Finding a funding lock for the passed in uuid returns success without having to relock

Specified by:
lockFunding in interface LockService
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, BY_OTHER (accountlock found)
See Also:
LockService.lockFunding(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader, java.lang.String)

lockFunding

public BudgetConstructionLockStatus lockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding,
                                                org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
acquire a lock for the given appointment funding

Specified by:
lockFunding in interface LockService
Parameters:
appointmentFunding - the given appointment funding
person - the specified user
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, BY_OTHER (accountlock found)
See Also:
LockService.lockFunding(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding, org.kuali.rice.kim.bo.Person)

unlockFunding

@Transactional
public BCConstants.LockStatus unlockFunding(String chartOfAccountsCode,
                                                          String accountNumber,
                                                          String subAccountNumber,
                                                          Integer fiscalYear,
                                                          String principalId)
Description copied from interface: LockService
This removes the fundinglock for the account and user

Specified by:
unlockFunding in interface LockService
Returns:
LockStatus.SUCCESS, NO_DOOR (no fundinglock found)
See Also:
LockService.unlockFunding(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

unlockFunding

@Transactional
public BCConstants.LockStatus unlockFunding(PendingBudgetConstructionAppointmentFunding appointmentFunding,
                                                          org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
release the lock for the given appointment funding if any

Specified by:
unlockFunding in interface LockService
Parameters:
appointmentFunding - the given appointment funding that could have lock
person - the user who owns the lock on the given appointment funding
See Also:
LockService.unlockFunding(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding, org.kuali.rice.kim.bo.Person)

unlockFunding

@Transactional
public void unlockFunding(List<PendingBudgetConstructionAppointmentFunding> lockedFundings,
                                        org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
release the locks for the given appointment fundings if any

Specified by:
unlockFunding in interface LockService
Parameters:
lockedFundings - the given appointment fundings that could have locks
person - the user who owns the locks on the given appointment fundings
See Also:
LockService.unlockFunding(java.util.List, org.kuali.rice.kim.bo.Person)

isFundingLockedByUser

@Transactional
public boolean isFundingLockedByUser(String chartOfAccountsCode,
                                                   String accountNumber,
                                                   String subAccountNumber,
                                                   Integer fiscalYear,
                                                   String principalId)
Description copied from interface: LockService
Checks if the given user has a funding lock for the given accounting key.

Specified by:
isFundingLockedByUser in interface LockService
Parameters:
chartOfAccountsCode - - chart code of funding lock
accountNumber - - account number of funding lock
subAccountNumber - - sub account number of funding lock
fiscalYear - - fiscal year of funding lock
principalId - - lock user id
Returns:
true if locked, false if not locked or not found in the database
See Also:
LockService.isFundingLockedByUser(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

lockPosition

@Transactional
public BudgetConstructionLockStatus lockPosition(String positionNumber,
                                                               Integer fiscalYear,
                                                               String principalId)
Description copied from interface: LockService
This locks the position, meaning it sets the position lock id field with the puid. Finding the position already locked by the same user simply returns success.

Specified by:
lockPosition in interface LockService
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, OPTIMISTIC_EX (lost optimistic lock), BY_OTHER (also sets positionLockOwner), NO_DOOR (BudgetConstructionPosition found)
See Also:
LockService.lockPosition(java.lang.String, java.lang.Integer, java.lang.String)

lockPosition

@Transactional
public BudgetConstructionLockStatus lockPosition(BudgetConstructionPosition position,
                                                               org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
acquire a lock for the given budget position

Specified by:
lockPosition in interface LockService
Parameters:
position - the given position
person - the specified user
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, OPTIMISTIC_EX (lost optimistic lock), BY_OTHER (also sets positionLockOwner), NO_DOOR (BudgetConstructionPosition found)
See Also:
LockService.lockPosition(org.kuali.kfs.module.bc.businessobject.BudgetConstructionPosition, org.kuali.rice.kim.bo.Person)

isPositionLocked

@Transactional
public boolean isPositionLocked(String positionNumber,
                                              Integer fiscalYear)
Description copied from interface: LockService
This checks the database for an existing positionlock

Specified by:
isPositionLocked in interface LockService
Returns:
true or false (not locked or BudgetConstructionPosition not found)
See Also:
LockService.isPositionLocked(java.lang.String, java.lang.Integer)

isPositionLockedByUser

@Transactional
public boolean isPositionLockedByUser(String positionNumber,
                                                    Integer fiscalYear,
                                                    String principalId)
Description copied from interface: LockService
Checks the given user has an position lock for the given position number.

Specified by:
isPositionLockedByUser in interface LockService
Parameters:
positionNumber - - position number of position record
fiscalYear - - fiscal year of position record
principalId - - lock user id
Returns:
true if locked, false if not locked or not found in the database
See Also:
LockService.isPositionLockedByUser(java.lang.String, java.lang.Integer, java.lang.String)

isPositionFundingLockedByUser

@Transactional
public boolean isPositionFundingLockedByUser(String positionNumber,
                                                           String chartOfAccountsCode,
                                                           String accountNumber,
                                                           String subAccountNumber,
                                                           Integer fiscalYear,
                                                           String principalId)
Description copied from interface: LockService
Checks the given user has an position/funding lock for the given position number and accounting key.

Specified by:
isPositionFundingLockedByUser in interface LockService
Parameters:
positionNumber - - position number of position record
chartOfAccountsCode - - chart code of funding lock
accountNumber - - account number of funding lock
subAccountNumber - - sub account number of funding lock
fiscalYear - - fiscal year of position and funding record
principalId - - lock user id
Returns:
true if locked, false if not locked or not found in the database
See Also:
LockService.isPositionFundingLockedByUser(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

unlockPosition

@Transactional
public BCConstants.LockStatus unlockPosition(String positionNumber,
                                                           Integer fiscalYear)
Description copied from interface: LockService
This removes an existing positionlock

Specified by:
unlockPosition in interface LockService
Returns:
LockStatus.SUCCESS (success or already unlocked), OPTIMISTIC_EX (lost optimistic lock - unlikely), NO_DOOR (BudgetConstructionPosition not found)
See Also:
LockService.unlockPosition(java.lang.String, java.lang.Integer)

unlockPosition

@Transactional
public BCConstants.LockStatus unlockPosition(String positionNumber,
                                                           Integer fiscalYear,
                                                           String principalId)
Description copied from interface: LockService
release the locks on a positions with the given information

Specified by:
unlockPosition in interface LockService
Parameters:
positionNumber - the given position number of a position
fiscalYear - the given fiscal year of a position
Returns:
LockStatus.SUCCESS (success or already unlocked), OPTIMISTIC_EX (lost optimistic lock - unlikely), NO_DOOR (BudgetConstructionPosition not found)
See Also:
LockService.unlockPosition(java.lang.String, java.lang.Integer, java.lang.String)

unlockPostion

@Transactional
public BCConstants.LockStatus unlockPostion(BudgetConstructionPosition position,
                                                          org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
release the lock for the given position if any

Specified by:
unlockPostion in interface LockService
Parameters:
position - the given budget construction position that could have locks
person - the specified user who owns the lock on the given position
See Also:
LockService.unlockPostion(org.kuali.kfs.module.bc.businessobject.BudgetConstructionPosition, org.kuali.rice.kim.bo.Person)

unlockPostion

@Transactional
public void unlockPostion(List<BudgetConstructionPosition> lockedPositions,
                                        org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
release the locks for the given positions if any

Specified by:
unlockPostion in interface LockService
Parameters:
lockedPositions - the given budget construction positions that could have locks
person - the specified user who owns the locks on the given positions
See Also:
LockService.unlockPostion(java.util.List, org.kuali.rice.kim.bo.Person)

lockTransaction

@Transactional
public BudgetConstructionLockStatus lockTransaction(String chartOfAccountsCode,
                                                                  String accountNumber,
                                                                  String subAccountNumber,
                                                                  Integer fiscalYear,
                                                                  String principalId)
Description copied from interface: LockService
This attempts a transactionlock on a BC Edoc for a pUId. It retries based on the setting of BCConstants.maxLockRetry.

Specified by:
lockTransaction in interface LockService
Returns:
BudgetConstructionLockStatus with lockStatus.SUCCESS, OPTIMISTIC_EX (lost optimistic lock - unlikely) BY_OTHER (retries exhausted, also sets transactionLockOwner), NO_DOOR (BudgetConstructionHeader not found)
See Also:
LockService.lockTransaction(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

lockTransaction

@Transactional
public BudgetConstructionLockStatus lockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding,
                                                                  org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
attemps to have a transaction lock based on the information provided by the given funding line

Specified by:
lockTransaction in interface LockService
Parameters:
appointmentFunding - the given appointment funding
person - the specified user
See Also:
LockService.lockTransaction(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding, org.kuali.rice.kim.bo.Person)

isTransactionLocked

@Transactional
public boolean isTransactionLocked(String chartOfAccountsCode,
                                                 String accountNumber,
                                                 String subAccountNumber,
                                                 Integer fiscalYear)
Description copied from interface: LockService
This checks the database for an existing transactionlock for the BC EDoc (account).

Specified by:
isTransactionLocked in interface LockService
Returns:
true or false (not locked or BudgetConstructionHeader not found)
See Also:
LockService.isTransactionLocked(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer)

isTransactionLockedByUser

@Transactional
public boolean isTransactionLockedByUser(String chartOfAccountsCode,
                                                       String accountNumber,
                                                       String subAccountNumber,
                                                       Integer fiscalYear,
                                                       String principalId)
Description copied from interface: LockService
Checks the given user has an transaction lock for the given document.

Specified by:
isTransactionLockedByUser in interface LockService
Parameters:
chartOfAccountsCode - - chart code of transaction lock
accountNumber - - account number of transaction lock
subAccountNumber - - sub account number of transaction lock
fiscalYear - - fiscal year of transaction lock
principalId - - lock user id
Returns:
true if locked, false if not locked or not found in the database
See Also:
LockService.isTransactionLockedByUser(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String)

unlockTransaction

@Transactional
public BCConstants.LockStatus unlockTransaction(String chartOfAccountsCode,
                                                              String accountNumber,
                                                              String subAccountNumber,
                                                              Integer fiscalYear)
Description copied from interface: LockService
This removes an existing transactionlock for a BC EDoc (account).

Specified by:
unlockTransaction in interface LockService
Returns:
LockStatus.SUCCESS (success or already unlocked), OPTIMISTIC_EX (lost optimistic lock - unlikely), NO_DOOR (BudgetConstructionHeader not found)
See Also:
LockService.unlockTransaction(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer)

unlockTransaction

@Transactional
public void unlockTransaction(PendingBudgetConstructionAppointmentFunding appointmentFunding,
                                            org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
attemps to unlock a transaction based on the information provided by the given funding line

Specified by:
unlockTransaction in interface LockService
Parameters:
appointmentFunding - the given appointment funding
person - the specified user
See Also:
LockService.unlockTransaction(org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding, org.kuali.rice.kim.bo.Person)

getAllAccountLocks

@Transactional
public List<BudgetConstructionHeader> getAllAccountLocks(String lockUserId)
Description copied from interface: LockService
Retrieves all current account locks for the given user (or all locks if user is null/empty).

Specified by:
getAllAccountLocks in interface LockService
Parameters:
lockUserId - - universal id that will be used in lock query
Returns:
budget headers that are locked
See Also:
LockService.getAllAccountLocks(String lockUserId)

getOrphanedFundingLocks

@Transactional
public List<BudgetConstructionFundingLock> getOrphanedFundingLocks(String lockUserId)
Description copied from interface: LockService
Retrieves all funding locks that do not have a corresponding position lock for the given user (or all locks if user is null/empty).

Specified by:
getOrphanedFundingLocks in interface LockService
Parameters:
lockUserId - - universal id that will be used in lock query
Returns:
funding locks records
See Also:
org.kuali.kfs.module.bc.document.service.LockService#getAllFundLocks(String lockUserId)

getOrphanedPositionLocks

@Transactional
public List<BudgetConstructionPosition> getOrphanedPositionLocks(String lockUserId)
Description copied from interface: LockService
Retrieves all current position locks without a funding lock for the given user (or all locks if user is null/empty).

Specified by:
getOrphanedPositionLocks in interface LockService
Parameters:
lockUserId - universal id that will be used in lock query
Returns:
positions that are locked.
See Also:
LockService.getOrphanedPositionLocks(String lockUserId)

getAllTransactionLocks

@Transactional
public List<BudgetConstructionHeader> getAllTransactionLocks(String lockUserId)
Description copied from interface: LockService
Retrieves all current transaction locks for the given user (or all locks if user is null/empty).

Specified by:
getAllTransactionLocks in interface LockService
Parameters:
lockUserId - - universal id that will be used in lock query
Returns:
budget headers that are locked
See Also:
LockService.getAllTransactionLocks(String lockUserId)

getAllPositionFundingLocks

@Transactional
public List<PendingBudgetConstructionAppointmentFunding> getAllPositionFundingLocks(String lockUserId)
Description copied from interface: LockService
Retrieves all current position/funding locks for the given user (or all locks if user is null/empty).

Specified by:
getAllPositionFundingLocks in interface LockService
Parameters:
lockUserId - - universal id that will be used in lock query
Returns:
position/funding records that are locked.
See Also:
LockService.getAllPositionFundingLocks(java.lang.String)

checkLockExists

@Transactional
public boolean checkLockExists(BudgetConstructionLockSummary lockSummary)
Description copied from interface: LockService
Helper method to check if a lock exists for the given parameters.

Specified by:
checkLockExists in interface LockService
Parameters:
lockSummary - - contains information about the record to unlock
Returns:
boolean true if lock exists, false otherwise
See Also:
LockService.checkLockExists(org.kuali.kfs.module.bc.businessobject.BudgetConstructionLockSummary)

doUnlock

@Transactional
public BCConstants.LockStatus doUnlock(BudgetConstructionLockSummary lockSummary)
Description copied from interface: LockService
Helper method to check the lock type and do the unlock with the lock summary fields.

Specified by:
doUnlock in interface LockService
Parameters:
lockSummary - - contains information about the record to unlock
Returns:
LockStatus.SUCCESS, NO_DOOR (not found), OPTIMISTIC_EX (lost optimistic lock)
See Also:
LockService.doUnlock(org.kuali.kfs.module.bc.businessobject.BudgetConstructionLockSummary)

isAccountLockedByUser

@Transactional
public boolean isAccountLockedByUser(BudgetConstructionHeader budgetConstructionHeader,
                                                   org.kuali.rice.kim.bo.Person person)
Description copied from interface: LockService
determine whether the account lock on the given budget document is held by the the specified user

Specified by:
isAccountLockedByUser in interface LockService
Parameters:
budgetConstructionHeader - the given budget document
person - the specified user
Returns:
true if the account lock on the given budget document is held by the the specified user; otherwise, false
See Also:
LockService.isAccountLockedByUser(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader, org.kuali.rice.kim.bo.Person)

setBudgetConstructionDao

public void setBudgetConstructionDao(BudgetConstructionDao bcHeaderDao)

setBudgetConstructionLockDao

public void setBudgetConstructionLockDao(BudgetConstructionLockDao budgetConstructionLockDao)
Sets the budgetConstructionLockDao attribute value.

Parameters:
budgetConstructionLockDao - The budgetConstructionLockDao to set.

setBudgetDocumentService

public void setBudgetDocumentService(BudgetDocumentService budgetDocumentService)
Sets the budgetDocumentService attribute value.

Parameters:
budgetDocumentService - The budgetDocumentService to set.

lockPendingBudgetConstructionAppointmentFundingRecords

@Transactional(propagation=REQUIRES_NEW)
public List<PendingBudgetConstructionAppointmentFunding> lockPendingBudgetConstructionAppointmentFundingRecords(List<PendingBudgetConstructionAppointmentFunding> fundingRecords,
                                                                                                                              org.kuali.rice.kim.bo.Person user)
                                                                                                         throws BudgetConstructionLockUnavailableException
Description copied from interface: LockService
Retrieves account locks for funding records, for use in the payrate import process. Throws BudgetConstructionLockUnavailableException if new account lock is unavailable

Specified by:
lockPendingBudgetConstructionAppointmentFundingRecords in interface LockService
Returns:
Throws:
BudgetConstructionLockUnavailableException
See Also:
LockService.lockPendingBudgetConstructionAppointmentFundingRecords(java.util.List, org.kuali.rice.kim.bo.Person)

lockAccountAndCommit

@Transactional(propagation=REQUIRES_NEW)
public BudgetConstructionLockStatus lockAccountAndCommit(BudgetConstructionHeader bcHeader,
                                                                       String principalId)
Description copied from interface: LockService
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. Used by the request import process.

Specified by:
lockAccountAndCommit in interface LockService
Returns:
See Also:
LockService.lockAccountAndCommit(org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader, java.lang.String)

lockPositionAndActiveFunding

@Transactional(propagation=REQUIRES_NEW)
public BudgetConstructionLockStatus lockPositionAndActiveFunding(Integer universityFiscalYear,
                                                                               String positionNumber,
                                                                               String principalId)
Description copied from interface: LockService
Locks the position record for the given key if not already locked. Then retrieves all active funding lines for the position that are not marked as delete and attempts to lock each one.

Specified by:
lockPositionAndActiveFunding in interface LockService
Parameters:
universityFiscalYear - budget fiscal year, primary key field for position record
positionNumber - position number, primary key field for position record
principalId - current user requesting the lock
Returns:
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 returned
See Also:
LockService.lockPositionAndActiveFunding(java.lang.Integer, java.lang.String, java.lang.String)

unlockPositionAndActiveFunding

@Transactional(propagation=REQUIRES_NEW)
public BCConstants.LockStatus unlockPositionAndActiveFunding(Integer universityFiscalYear,
                                                                           String positionNumber,
                                                                           String principalId)
Description copied from interface: LockService
Unlocks the position and all associated funding lines not marked as delete.

Specified by:
unlockPositionAndActiveFunding in interface LockService
Parameters:
universityFiscalYear - budget fiscal year, primary key field for position record
positionNumber - position number, primary key field for position record
principalId - current user requesting the unlock
Returns:
LockStatus indicating the status of the unlock attempt.
See Also:
LockService.unlockPositionAndActiveFunding(java.lang.Integer, java.lang.String, java.lang.String)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.