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.service;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.coa.businessobject.ObjectCode;
021    
022    /**
023     * This interface defines methods that an ObjectCode Service must provide.
024     */
025    public interface ObjectCodeService {
026    
027        /**
028         * @param universityFiscalYear - University Fiscal Year
029         * @param chartOfAccountsCode - Chart of Accounts Code
030         * @param financialObjectCode - Financial Object Code
031         * @return ObjectCode Retrieves an ObjectCode object based on primary key.
032         */
033        public ObjectCode getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String financialObjectCode);
034    
035        /**
036         * @param universityFiscalYear - University Fiscal Year
037         * @param chartOfAccountsCode - Chart of Accounts Code
038         * @param financialObjectCode - Financial Object Code
039         * @return ObjectCode Retrieves an ObjectCode object based on primary key.
040         */
041        public ObjectCode getByPrimaryIdWithCaching(Integer universityFiscalYear, String chartOfAccountsCode, String financialObjectCode);
042    
043        /**
044         * This method returns an financial object code for the current fiscal year.
045         * 
046         * @param chartOfAccountsCode chart of accounts code for object code
047         * @param financialObjectCode financial object code
048         * @return the object code specified
049         */
050        public ObjectCode getByPrimaryIdForCurrentYear(String chartOfAccountsCode, String financialObjectCode);
051    
052        /**
053         * @param chartOfAccountsCode - Chart of Accounts Code
054         * @param financialObjectCode - Financial Object Code
055         * @return a list containing integer years, given object code. The list may be empty, but will not be null.
056         */
057        public List getYearList(String chartOfAccountsCode, String financialObjectCode);
058    
059        /**
060         * This method, written for use with DWR, returns a joined string representation of all of the names of the distinct object
061         * codes associated with each of the chart codes given. In the best of all possible worlds, this will only ever return *one*
062         * object code name, as object codes will be shared across charts.
063         * 
064         * @param universityFiscalYear the fiscal year of the financial object code to check.
065         * @param chartOfAccountCodes array of Chart of Accounts codes to
066         * @param financialObjectCode financial object code to look up
067         * @return a String representation of the distinct names of the object codes
068         */
069        public String getObjectCodeNamesByCharts(Integer universityFiscalYear, String[] chartOfAccountCodes, String financialObjectCode);
070    }