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.module.ar.batch.service;
017
018 import java.util.List;
019
020 import org.kuali.kfs.module.ar.batch.vo.CustomerDigesterVO;
021 import org.kuali.rice.kns.document.MaintenanceDocument;
022
023 public interface CustomerLoadService {
024
025 /**
026 * Validates and parses all files ready to go in the batch staging area.
027 * @return
028 */
029 public boolean loadFiles();
030
031 /**
032 * Validates and parses the file identified by the given files name. If successful, parsed entries are stored.
033 *
034 * @param fileNaem Name of file to be uploaded and processed.
035 * @return True if the file load and store was successful, false otherwise.
036 */
037 public boolean loadFile(String fileName);
038
039 /**
040 *
041 * Performs specific validation on the parsed file contents. If errors were found, method will return false and
042 * GlobalVariables.errorMap will contain the error message. If no errors were encountered the method will return true.
043 *
044 * @param customerUploads A List of CustomerDigesterVO objects, that are the processed
045 * results of the uploaded files.
046 * @return True if no errors were encountered, False otherwise.
047 */
048 public boolean validate(List<CustomerDigesterVO> customerUploads);
049
050 /**
051 *
052 * Performs specific validation on the parsed file contents. If errors were found, method will return false and
053 * GlobalVariables.errorMap will contain the error message. If no errors were encountered the method will return true.
054 *
055 * @param customerUploads A List of CustomerDigesterVO objects, that are the processed
056 * results of the uploaded files.
057 * @param customerMaintDocs A list of the customerMaintDocs that are returned by the validateAndPrepare method. A valid list
058 * should be passed in, and MaintDocs will be added to it.
059 * @return True if no errors were encountered, False otherwise.
060 */
061 public boolean validateAndPrepare(List<CustomerDigesterVO> customerUploads, List<MaintenanceDocument> customerMaintDocs, boolean useGlobalErrorMap);
062
063 }
064