View Javadoc
1   /*
2    * Copyright 2009 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.coa.dataaccess;
17  
18  import java.sql.Date;
19  import java.util.Iterator;
20  
21  import org.kuali.ole.coa.businessobject.AccountDelegate;
22  
23  
24  public interface AccountDelegateDao {
25  
26      /**
27       * Retrieves the Document Number of any AccountDelegate locking this record.
28       * 
29       * @param lockingRepresentation String representation of the MaintanceLock to check against.
30       * @param documentNumber the document number being checked against.
31       * @return the document number of the Document locking this record.
32       */
33  
34      public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber);
35  
36      /**
37       * Retrieves all active account delegates which reference the given user
38       * 
39       * @param principalId a principal ID of the person to find account delegations for
40       * @param primary whether the account delegates returned should be primary or not
41       * @return a Collection, presumably of AccountDelegates
42       */
43      public abstract Iterator<AccountDelegate> getAccountDelegationsForPerson(String principalId, boolean primary);
44  
45      /**
46       * Determines if the given principal is an active delegate for any non-closed account
47       * 
48       * @param principalId the principal ID to check primary account delegations for
49       * @param currentSqlDate
50       * @return true if the principal is a primary account delegate, false otherwise
51       */
52      public abstract boolean isPrincipalInAnyWayShapeOrFormPrimaryAccountDelegate(String principalId, Date currentSqlDate);
53  
54      /**
55       * Determines if the given principal is an active delegate for any non-closed account
56       * 
57       * @param principalId the principal ID to check secondary account delegations for
58       * @param currentSqlDate current Sql date
59       * @return true if the principal is a secondary account delegate, false otherwise
60       */
61      public abstract boolean isPrincipalInAnyWayShapeOrFormSecondaryAccountDelegate(String principalId, Date currentSqlDate);
62  }