org.kuali.kfs.module.cam.service.impl
Class AssetLockServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.cam.service.impl.AssetLockServiceImpl
All Implemented Interfaces:
AssetLockService

@Transactional
public class AssetLockServiceImpl
extends Object
implements AssetLockService


Constructor Summary
AssetLockServiceImpl()
           
 
Method Summary
protected  void addBlockingDocumentErrorMessage(Collection<String> blockingDocuments, String documentTypeName)
          Generating error messages and doc links for blocking documents.
 List<AssetLock> buildAssetLockHelper(List<Long> assetNumbers, String documentNumber, String documentType, String lockingInformation)
          Helper method to generate AssetLock instances.
 boolean checkAndSetAssetLocks(List<AssetLock> assetLocks)
          Check and Lock for AssetLock.
 void deleteAssetLocks(String documentNumber, String lockingInformation)
          Delete all locks holding by documentNumber.
 List<String> getAssetLockingDocuments(List<Long> assetNumbers, String documentTypeName, String excludingDocumentNumber)
           
protected  Collection getBlockingDocumentTypes(String documentTypeName)
          To get blocking document types for given document type.
protected  org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 CapitalAssetLockDao getCapitalAssetLockDao()
          Gets the capitalAssetLockDao attribute.
 boolean isAssetLocked(List<Long> assetNumbers, String documentTypeName, String excludingDocumentNumber)
          Based on the given documentTypeName, it decides what document types could block it.
 boolean isAssetLockedByCurrentDocument(String documentNumber, String lockingInformation)
          Check if document has any asset locks
protected  boolean isPurApDocument(String documentTypeName)
           
 void setCapitalAssetLockDao(CapitalAssetLockDao capitalAssetLockDao)
          Sets the capitalAssetLockDao attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetLockServiceImpl

public AssetLockServiceImpl()
Method Detail

isPurApDocument

protected boolean isPurApDocument(String documentTypeName)

getCapitalAssetLockDao

public CapitalAssetLockDao getCapitalAssetLockDao()
Gets the capitalAssetLockDao attribute.

Returns:
Returns the capitalAssetLockDao.

setCapitalAssetLockDao

public void setCapitalAssetLockDao(CapitalAssetLockDao capitalAssetLockDao)
Sets the capitalAssetLockDao attribute value.

Parameters:
capitalAssetLockDao - The capitalAssetLockDao to set.

checkAndSetAssetLocks

public boolean checkAndSetAssetLocks(List<AssetLock> assetLocks)
Description copied from interface: AssetLockService
Check and Lock for AssetLock.

Specified by:
checkAndSetAssetLocks in interface AssetLockService
Parameters:
assetLocks - must be from the same documentNumber and have the same documentTypeName
Returns:
Return false without any of the asset being locked. Return true when all assets can be locked.
See Also:
org.kuali.kfs.integration.cab.CapitalAssetBuilderModuleService#checkAndLockForDocument(java.util.Collection)

getBlockingDocumentTypes

protected Collection getBlockingDocumentTypes(String documentTypeName)
To get blocking document types for given document type. If given document type is FP, blocking documents will be CAMS payment change documents. If given document type is CAMs maintain related, the blocking documents are all CAMs doc excluding FP and PURAP. For other cases, returning null which will block all other documents.

Parameters:
documentTypeName -
Returns:

deleteAssetLocks

public void deleteAssetLocks(String documentNumber,
                             String lockingInformation)
Description copied from interface: AssetLockService
Delete all locks holding by documentNumber.

Specified by:
deleteAssetLocks in interface AssetLockService
See Also:
org.kuali.kfs.integration.cab.CapitalAssetBuilderModuleService#deleteLocks(java.lang.String, java.lang.String)

buildAssetLockHelper

public List<AssetLock> buildAssetLockHelper(List<Long> assetNumbers,
                                            String documentNumber,
                                            String documentType,
                                            String lockingInformation)
Description copied from interface: AssetLockService
Helper method to generate AssetLock instances.

Specified by:
buildAssetLockHelper in interface AssetLockService
Returns:
See Also:
org.kuali.kfs.integration.cab.CapitalAssetBuilderModuleService#generateAssetLocks(java.util.Collection, java.lang.String, java.lang.String, java.lang.String)

addBlockingDocumentErrorMessage

protected void addBlockingDocumentErrorMessage(Collection<String> blockingDocuments,
                                               String documentTypeName)
Generating error messages and doc links for blocking documents.

Parameters:
blockingDocuments -

getBusinessObjectService

protected org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

isAssetLockedByCurrentDocument

public boolean isAssetLockedByCurrentDocument(String documentNumber,
                                              String lockingInformation)
Description copied from interface: AssetLockService
Check if document has any asset locks

Specified by:
isAssetLockedByCurrentDocument in interface AssetLockService
Returns:
See Also:
org.kuali.kfs.module.cam.service.AssetLockService#isAssetLockedByDocument(java.lang.String, java.lang.String)

isAssetLocked

public boolean isAssetLocked(List<Long> assetNumbers,
                             String documentTypeName,
                             String excludingDocumentNumber)
Based on the given documentTypeName, it decides what document types could block it.

Specified by:
isAssetLocked in interface AssetLockService
Returns:
See Also:
AssetLockService.isAssetLocked(java.util.List, java.lang.String, java.lang.String)

getAssetLockingDocuments

public List<String> getAssetLockingDocuments(List<Long> assetNumbers,
                                             String documentTypeName,
                                             String excludingDocumentNumber)
Specified by:
getAssetLockingDocuments in interface AssetLockService
See Also:
AssetLockService.getAssetLockingDocuments(java.util.List, java.lang.String, java.lang.String)


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