View Javadoc
1   /*
2    * Copyright 2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.integration.cam;
17  
18  import java.util.List;
19  
20  import org.kuali.ole.sys.document.AccountingDocument;
21  import org.kuali.rice.krad.document.Document;
22  
23  public interface CapitalAssetManagementModuleService {
24      /**
25       * FP document eligible for asset lock when any of its accounting line is taken into CAB during CAB batch.
26       * 
27       * @param accountingDocument
28       * @return
29       */
30      boolean isFpDocumentEligibleForAssetLock(AccountingDocument accountingDocument, String documentType);
31  
32      /**
33       * Check and store AssetLocks if they are not locked by other blocking documents. Either store all of the asset locks or none of
34       * them being stored in case of dead lock. If any of the asset is blocked, the error message will be built including link(s) to
35       * the blocking document(s).
36       * 
37       * @param capitalAssetNumbers
38       * @param documentNumber
39       * @param documentType
40       * @param additionalInformation
41       * @return return true if all of the asset locks can be granted.
42       */
43      boolean storeAssetLocks(List<Long> capitalAssetNumbers, String documentNumber, String documentType, String lockingInformation);
44  
45      /**
46       * Delete AssetLocks by document number and lockingInfomation for PurAp doc only.
47       * 
48       * @param documentNumber
49       * @param lockingInformation
50       */
51      void deleteAssetLocks(String documentNumber, String lockingInformation);
52  
53  
54      /**
55       * Check if the given document hold any asset locks.
56       * 
57       * @param documentNumber
58       * @param lockingInformation
59       * @return
60       */
61      boolean isAssetLockedByCurrentDocument(String blockingDocumentNumber, String lockingInformation);
62  
63      /**
64       * Check if the given asset Numbers are locked by other documents already.
65       * 
66       * @param assetNumbers
67       * @param documentTypeName
68       * @param excludingDocumentNumber
69       * @return
70       */
71      boolean isAssetLocked(List<Long> assetNumbers, String documentTypeName, String excludingDocumentNumber);
72  
73  
74      /**
75       * Creates the locks for each asset on a documents
76       * 
77       * @param document
78       */
79      public void generateCapitalAssetLock(Document document, String documentTypeNames);
80  
81      /**
82       * Deletes the asset locks associated with a particular document
83       * 
84       * @param document
85       */
86      public void deleteDocumentAssetLocks(Document document);
87  
88  }