1 /* 2 * Copyright 2007-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.sys.service; 17 18 import org.kuali.ole.sys.OLEConstants; 19 import org.kuali.ole.sys.businessobject.Bank; 20 21 /** 22 * This service interface defines methods that a BankService implementation must provide. 23 */ 24 public interface BankService { 25 public static final String[] PERMANENT_BANK_SPECIFICATION_ENABLED_DOCUMENT_TYPES = {OLEConstants.FinancialDocumentTypeCodes.ADVANCE_DEPOSIT, OLEConstants.FinancialDocumentTypeCodes.CASH_MANAGEMENT, OLEConstants.FinancialDocumentTypeCodes.NON_CHECK_DISBURSEMENT}; 26 27 /** 28 * Retrieves a bank object who's primary id matches the values provided. 29 * 30 * @param bankCode The bank code to be looked up by. 31 * @return A Bank object with a matching primary id. 32 */ 33 public Bank getByPrimaryId(String bankCode); 34 35 /** 36 * Retrieves the default bank code for the given document type from system parameter. 37 * . 38 * @param documentClass <code>Class</code> for the document type 39 * @return <code>Bank</code> object retrieved by default bank code 40 */ 41 public Bank getDefaultBankByDocType(Class<?> documentClass); 42 43 /** 44 * Retrieves the default bank code for the given document type from system parameter. 45 * . 46 * @param documentTypeCode the document type code 47 * @return <code>Bank</code> object retrieved by default bank code 48 */ 49 public Bank getDefaultBankByDocType(String documentTypeCode); 50 51 /** 52 * Determines if the bank specification is enabled in the system by system parameter. 53 * 54 * @return true if specification is enabled 55 */ 56 public boolean isBankSpecificationEnabled(); 57 58 /** 59 * Determines if the bank specification is enabled for the given document by a) the document being one of the permanent 60 * bank code documents (AD's, CMD's, and ND's) or by the document being listed in the KFS-SYS / Bank / BANK_CODE_DOCUMENT_TYPES parameter 61 * @param documentClass the class of the document to determine if it has bank specifications enabled 62 * @return true if specification is enabled, false if specification is disabled 63 */ 64 public boolean isBankSpecificationEnabledForDocument(Class<?> documentClass); 65 }