com.sap.scheduler.api

Class RecurringEntry

java.lang.Object
  extended by com.sap.scheduler.api.RecurringEntry
All Implemented Interfaces:
Serializable

public class RecurringEntry
extends Object
implements Serializable

This class represents a recurring entry

See Also:
Serialized Form

Constructor Summary
RecurringEntry(long period)
          Constructs an entry with a specified period.
RecurringEntry(SchedulerTime expirationTime)
          Constrcuts a new entry that will cause one expiration at the specified time.
RecurringEntry(SchedulerTime startTime, long period)
          Constructs an entry with a spesified start time, period and no end time.
RecurringEntry(SchedulerTime startTime, long period, int iterations)
          Constructs an entry with specified start time, period and iterations.
RecurringEntry(SchedulerTime startTime, SchedulerTime endTime, int iterations)
          Constructor a entry with specified start time, end time and iterations.
RecurringEntry(SchedulerTime startTime, SchedulerTime endTime, long period)
          Constructs an entry with specified start time, end time and period.
 
Method Summary
 boolean compareRecurringEntry(RecurringEntry entry)
          Compares a RecurringEntry with this.
 SchedulerTime getEndTime()
          Getter method
 long getPeriod()
          Getter method
 SchedulerTime getStartTime()
          Getter method
 String toString()
          Returns a string representarion of the recuring entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecurringEntry

public RecurringEntry(long period)
               throws IllegalArgumentException
Constructs an entry with a specified period. The task created with this entry will expire every period milliseconds. This constructor sets the start time of this entry to the current time. Thus calling getStartTime would return the time at the moment of creating the object. This entry has no end time i.e. it will continue to execute in the infinity. The time zone returned by TimeZone.getDefault() is used to set the start time.

Parameters:
period - the entry period
Throws:
IllegalArgumentException - - if period is less then, or equal to 0;

RecurringEntry

public RecurringEntry(SchedulerTime expirationTime)
Constrcuts a new entry that will cause one expiration at the specified time. This entry sets both the start time and end time to the time specified by expirationTime parameter. The wait period is set to 0.

Parameters:
expirationTime - - time at which this entry will timeout.
Throws:
NullPointerException - - if expirationTime is null

RecurringEntry

public RecurringEntry(SchedulerTime startTime,
                      long period)
               throws IllegalArgumentException,
                      NullPointerException
Constructs an entry with a spesified start time, period and no end time. This entry will execute in the infinity per intervals with length specified by the period parameter.

Parameters:
startTime - - the entry start time
period - - the period between to successive timeouts
Throws:
IllegalArgumentException - - if period is less or equal to 0.
NullPointerException - - if startTime is null

RecurringEntry

public RecurringEntry(SchedulerTime startTime,
                      SchedulerTime endTime,
                      long period)
Constructs an entry with specified start time, end time and period. All other constructs default to this one by passing appropriate parameters.

Parameters:
startTime - - the entry start time. This cannot be null.
endTime - the entry end time. If null than this entry is infinite entry.
period - the entry period - the period between two successive timeouts. If 0 than startTime must equal endTime and this entry will cause a single expiration at time startTime, which equals endTime
Throws:
IllegalArgumentException - - if period is negative. Or if period is 0 but startTime does not equal endTime. Thrown if startTime is not equal to endTime but period is 0. Also thrown if the duration specified by period parameter is longer than the period between startTime and endTime
NullPointerException - - if startTime is null.

RecurringEntry

public RecurringEntry(SchedulerTime startTime,
                      SchedulerTime endTime,
                      int iterations)
               throws IllegalArgumentException,
                      NullPointerException
Constructor a entry with specified start time, end time and iterations. The period is infered from the iterations by the formula period = (start_time - end_time) / (iterations - 1)

Parameters:
startTime - - the start time
endTime - - the end time
iterations - - the iterations
Throws:
IllegalArgumentException - - if iteratons < 1, or if startTime is later than endTime. Thrown if iterations equals 1 but startTime is different than endTime
NullPointerException - - if startTime or endTime is null.

RecurringEntry

public RecurringEntry(SchedulerTime startTime,
                      long period,
                      int iterations)
               throws IllegalArgumentException,
                      NullPointerException
Constructs an entry with specified start time, period and iterations. The end time is infered from the iterations by the formula end_time = start_time + period * (iterations - 1).

Parameters:
startTime - - the start time
period - - the period between two successive timeouts. Must be greater or equal to 0. If zero than this would be single expiration entry with expiration time equal to startTime.
iterations - - number of iterations the iterations. Must not be negative. This is ignored if period is 0.
Throws:
IllegalArgumentException - iae - if iterations is less than 2 and period is not 0 (i.e.) the iterations are not ignored. Thrown if period is negative.
NullPointerException - npe - if startTime is null
Method Detail

getStartTime

public SchedulerTime getStartTime()
Getter method

Returns:
the entry start time

getEndTime

public SchedulerTime getEndTime()
Getter method

Returns:
the entry end time

getPeriod

public long getPeriod()
Getter method

Returns:
the entry petiod

toString

public String toString()
Returns a string representarion of the recuring entry

Overrides:
toString in class Object
Returns:
the string representation

compareRecurringEntry

public boolean compareRecurringEntry(RecurringEntry entry)
Compares a RecurringEntry with this.

Parameters:
entry - the RecurringEntry to compare
Returns:
true if the RecurringEntry are equals in case of StartTime, EndTime and period. otherwise false.
Access Rights

This class can be accessed from:


SC DC
[sap.com] ENGFACADE [sap.com] tc/je/scheduler/api


Copyright 2010 SAP AG Complete Copyright Notice