001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.coa.dataaccess;
017    
018    import java.util.Iterator;
019    
020    import org.kuali.kfs.coa.businessobject.AccountDelegate;
021    import org.kuali.rice.kim.bo.Person;
022    
023    
024    public interface AccountDelegateDao {
025    
026        /**
027         * Retrieves the Document Number of any AccountDelegate locking this record.
028         * 
029         * @param lockingRepresentation String representation of the MaintanceLock to check against.
030         * @param documentNumber the document number being checked against.
031         * 
032         * @return the document number of the Document locking this record.
033         */
034        
035        public String getLockingDocumentNumber(String lockingRepresentation, String documentNumber);
036        
037        /**
038         * Retrieves all active account delegates which reference the given user
039         * @param principalId a principal ID of the person to find account delegations for
040         * @param primary whether the account delegates returned should be primary or not
041         * @return a Collection, presumably of AccountDelegates
042         */
043        public abstract Iterator<AccountDelegate> getAccountDelegationsForPerson(String principalId, boolean primary);
044        
045        /**
046         * Determines if the given principal is an active delegate for any non-closed account
047         * @param principalId the principal ID to check primary account delegations for
048         * @return true if the principal is a primary account delegate, false otherwise
049         */
050        public abstract boolean isPrincipalInAnyWayShapeOrFormPrimaryAccountDelegate(String principalId);
051        
052        /**
053         * 
054         * Determines if the given principal is an active delegate for any non-closed account
055         * @param principalId the principal ID to check secondary account delegations for
056         * @return true if the principal is a secondary account delegate, false otherwise
057         */
058        public abstract boolean isPrincipalInAnyWayShapeOrFormSecondaryAccountDelegate(String principalId);
059    }