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.pdp.batch; 017 018 import java.io.File; 019 import java.util.ArrayList; 020 import java.util.Date; 021 import java.util.List; 022 023 import org.apache.commons.lang.StringUtils; 024 import org.kuali.kfs.pdp.service.PaymentFileService; 025 import org.kuali.kfs.sys.batch.AbstractStep; 026 import org.kuali.kfs.sys.batch.BatchInputFileType; 027 import org.kuali.kfs.sys.batch.service.BatchInputFileService; 028 029 /** 030 * This step will call the <code>PaymentService</code> to pick up incoming PDP payment files and process. 031 */ 032 public class LoadPaymentsStep extends AbstractStep { 033 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(LoadPaymentsStep.class); 034 035 private PaymentFileService paymentFileService; 036 private BatchInputFileType paymentInputFileType; 037 038 /** 039 * @see org.kuali.kfs.sys.batch.Step#execute(java.lang.String, java.util.Date) 040 */ 041 public boolean execute(String jobName, Date jobRunDate) throws InterruptedException { 042 LOG.debug("execute() started"); 043 paymentFileService.processPaymentFiles(paymentInputFileType); 044 045 return true; 046 } 047 048 /** 049 * Sets the paymentFileService attribute value. 050 * 051 * @param paymentFileService The paymentFileService to set. 052 */ 053 public void setPaymentFileService(PaymentFileService paymentFileService) { 054 this.paymentFileService = paymentFileService; 055 } 056 057 /** 058 * Sets the paymentInputFileType attribute value. 059 * 060 * @param paymentInputFileType The paymentInputFileType to set. 061 */ 062 public void setPaymentInputFileType(BatchInputFileType paymentInputFileType) { 063 this.paymentInputFileType = paymentInputFileType; 064 } 065 066 }