org.kuali.kfs.module.purap.batch.service.impl
Class PurapRunDateServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.purap.batch.service.impl.PurapRunDateServiceImpl
All Implemented Interfaces:
PurapRunDateService

public class PurapRunDateServiceImpl
extends Object
implements PurapRunDateService


Nested Class Summary
protected  class PurapRunDateServiceImpl.CutoffTime
          Holds the hour, minute, and second of a given cut off time
 
Constructor Summary
PurapRunDateServiceImpl()
           
 
Method Summary
protected  void adjustTimeOfDay(Calendar calendar, boolean appliedCutoff)
          Adjusts the time of day if necessary, possibly depending on whether the execution time was before or after cutoff time
 Date calculateRunDate(Date executionDate)
          Determines the date to assume when running the batch processes
protected  boolean isCurrentDateAfterCutoff(Calendar currentCal, PurapRunDateServiceImpl.CutoffTime cutoffTime)
          Determines if the given calendar time is before the given cutoff time
protected  PurapRunDateServiceImpl.CutoffTime parseCutoffTime(String cutoffTime)
          Parses a String representation of the cutoff time
protected  String retrieveCutoffTimeValue()
          Retrieves the cutoff time from a repository.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurapRunDateServiceImpl

public PurapRunDateServiceImpl()
Method Detail

calculateRunDate

public Date calculateRunDate(Date executionDate)
Determines the date to assume when running the batch processes

Specified by:
calculateRunDate in interface PurapRunDateService
Parameters:
executionDate - the actual date that this method is called
Returns:
the run date/time to assume when running the PURAP processes

adjustTimeOfDay

protected void adjustTimeOfDay(Calendar calendar,
                               boolean appliedCutoff)
Adjusts the time of day if necessary, possibly depending on whether the execution time was before or after cutoff time

Parameters:
calendar -
appliedCutoff - true if the execution time was before the cutoff

isCurrentDateAfterCutoff

protected boolean isCurrentDateAfterCutoff(Calendar currentCal,
                                           PurapRunDateServiceImpl.CutoffTime cutoffTime)
Determines if the given calendar time is before the given cutoff time

Parameters:
currentCal - the current time
cutoffTime - the "start of the day" cut off time
Returns:
true if the current time is before the cutoff, false otherwise

parseCutoffTime

protected PurapRunDateServiceImpl.CutoffTime parseCutoffTime(String cutoffTime)
Parses a String representation of the cutoff time

Parameters:
cutoffTime - the cutoff time String to parse
Returns:
a record holding the cutoff time

retrieveCutoffTimeValue

protected String retrieveCutoffTimeValue()
Retrieves the cutoff time from a repository.

Returns:
a time of day in the format "HH:mm:ss", where HH, mm, ss are defined in the java.text.SimpleDateFormat class. In particular, 0 <= hour <= 23, 0 <= minute <= 59, and 0 <= second <= 59

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.