org.opensync.engine.server
Class Schedule

java.lang.Object
  extended byorg.opensync.engine.server.Schedule
All Implemented Interfaces:
java.io.Serializable

public class Schedule
extends java.lang.Object
implements java.io.Serializable

This class gives the necessary information to schedule a task If a date is given, the task will start at the specific date and time. One shot. Others paramters will be ignored. If days of month are given, the task will start all months at the specific days and time. Others paramters will be ignored. If days of week are given, the task will start all week at the specific days and time. Use repeat to repeat the task with a period interval. Intraday only.

See Also:
Serialized Form

Constructor Summary
Schedule()
          Construct a schedule
 
Method Summary
 java.util.Date getDate()
          Get the date
 java.util.Date getDateTime()
          Return the full date, time comprise
 int[] getDaysOfMonth()
          Get the days of month
 int[] getDaysOfWeek()
          Get the days of week
 int getHour()
          get the hour
 int getMinute()
          Get the hour
 int getPeriod()
          Get the period between two repetition.
 int getRepeat()
          Get the repeat number
 java.lang.String getStrDaysOfMonth()
          Get the days of month in String format
 java.lang.String getStrDaysOfWeek()
          Get the days of week in String format
 boolean isHttpRequest()
          Return true if the scheduling is made by an http request
 boolean isValid()
          Check if the schedule is valid.
 void setDate(java.util.Date date)
          Set the date
 void setDaysOfMonth(int[] daysOfMonth)
          Set the days of month.
 void setDaysOfWeek(int[] daysOfWeek)
          Set the days of week.
 void setHour(int hour)
          Set the hour
 void setHttpRequest(boolean httpRequest)
          The scheduling is made by an http request
 void setMinute(int minute)
          Set the minute
 void setPeriod(int period)
          Set the period between two repetition.
 void setRepeat(int repeat)
          Set the repeat option.
 java.lang.String toString()
          Convert a schedule to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule()
Construct a schedule

Method Detail

setDate

public void setDate(java.util.Date date)
Set the date

Parameters:
date - the date (dd/MM/yyyy)

getDate

public java.util.Date getDate()
Get the date


setDaysOfMonth

public void setDaysOfMonth(int[] daysOfMonth)
Set the days of month.

Parameters:
daysOfMonth - days of month of the schedulerEntry (-1 if every day). This attribute is exclusive with daysOfWeek. Allowed values 1-31.

getDaysOfMonth

public int[] getDaysOfMonth()
Get the days of month


getStrDaysOfMonth

public java.lang.String getStrDaysOfMonth()
Get the days of month in String format


setHour

public void setHour(int hour)
Set the hour

Parameters:
hour - hour of the schedulerEntry. Allowed values 0-23

getHour

public int getHour()
get the hour


setRepeat

public void setRepeat(int repeat)
Set the repeat option. Use it when you want to repeat the task.

Parameters:
repeat - the number to repeat

getRepeat

public int getRepeat()
Get the repeat number


setPeriod

public void setPeriod(int period)
Set the period between two repetition.

Parameters:
period - the repetition period in minute

getPeriod

public int getPeriod()
Get the period between two repetition.


setDaysOfWeek

public void setDaysOfWeek(int[] daysOfWeek)
Set the days of week.

Parameters:
daysOfWeek - day of week of the schedulerEntry (-1 if every day). This attribute is exclusive with dayOfMonth. Allowed values 1-7 (1 = Sunday, 2 = Monday, ...). java.util.Calendar constants can be used.

getDaysOfWeek

public int[] getDaysOfWeek()
Get the days of week


getStrDaysOfWeek

public java.lang.String getStrDaysOfWeek()
Get the days of week in String format


isValid

public boolean isValid()
Check if the schedule is valid.


getDateTime

public java.util.Date getDateTime()
Return the full date, time comprise


toString

public java.lang.String toString()
Convert a schedule to a string. (Use for debug only)


setMinute

public void setMinute(int minute)
Set the minute

Parameters:
minute - minute of the schedulerEntry. Allowed values 0-59

getMinute

public int getMinute()
Get the hour


setHttpRequest

public void setHttpRequest(boolean httpRequest)
The scheduling is made by an http request

Parameters:
httpRequest -

isHttpRequest

public boolean isHttpRequest()
Return true if the scheduling is made by an http request



Copyright © 2004 sourceforge. All Rights Reserved.