com.sun.management.oss.pm.util
Interface Schedule

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable

public interface Schedule
extends java.io.Serializable, java.lang.Cloneable

Specifies the time frames during which the schedule will be active.

The schedule is active as soon as the start time - if supplied - is reached. The schedule remains active until the stop time - if supplied - is reached. If no stop time is specified the schedule will active indefinitely. The time frame defined by the schedule may contain one or more intervals. These intervals may repeat on a daily and/or weekly basis and specify the time periods during which the schedule is active. A daily schedule includes a start time and end time, which lie between 00.00 and 24.00 hours. If daily schedule is omitted, the schedule will run continuously through the day. If weekly schedule is omitted the schedule will run all days of the week. Alternatively the weekly schedule will indicate which days of the week the schedule will be active on.

The timer-synchronization between the client and the server is not part of this interface and is left over to the implementers. However the implementations need to handle different time zones.

Version:
0.9, 2001-10-25
Author:
Stefan Aberg

Method Summary
 java.lang.Object clone()
          Deep copy of this instance.
 DailySchedule getDailySchedule()
          Gets the daily schedule of the schedule.
 java.util.Calendar getStartTime()
          Returns the start time.
 java.util.Calendar getStopTime()
          Returns the stop time of the schedule.
 WeeklySchedule getWeeklySchedule()
          Gets the weekly schedule of the schedule.
 boolean isActive()
          Checks if the schedule is active or not.
 DailySchedule makeDailySchedule()
          Creates a new instance of the DailySchedule interface.
 WeeklySchedule makeWeeklySchedule()
          Creates a new instance of the WeeklySchedule interface.
 void setDailySchedule(DailySchedule dailySchedule)
          Sets the daily schedule of the schedule.
 void setStartTime(java.util.Calendar startTime)
          Sets the start time of the schedule.
 void setStopTime(java.util.Calendar stopTime)
          Sets the stop time of the schedule.
 void setWeeklySchedule(WeeklySchedule weekSchedule)
          Sets the weekly schedule of the schedule.
 

Method Detail

clone

public java.lang.Object clone()
Deep copy of this instance.

Returns:
Object copy of this instance.

makeWeeklySchedule

public WeeklySchedule makeWeeklySchedule()
Creates a new instance of the WeeklySchedule interface.

Returns:
WeeklySchedule The created object. The object is empty.

makeDailySchedule

public DailySchedule makeDailySchedule()
Creates a new instance of the DailySchedule interface.

Returns:
DailySchedule The created object. The object is empty.

isActive

public boolean isActive()
Checks if the schedule is active or not.

If the current date and time is within the defined schedule this method will return true. If the current date and time is outside the schedule false will be returned.

Returns:
boolean Returns true if the schedule is active, else false.

getStartTime

public java.util.Calendar getStartTime()
Returns the start time.

Returns:
Date Start time of the schedule or null if the start time is not set.
See Also:
setStartTime(java.util.Calendar)

setStartTime

public void setStartTime(java.util.Calendar startTime)
Sets the start time of the schedule.

The start time specifies when the schedule shall start to be active. If no start time is provided, the schedule is active immediately.

If start time is null the start time will be cleared.

Parameters:
startTime - Start time of the schedule.
See Also:
getStartTime()

getStopTime

public java.util.Calendar getStopTime()
Returns the stop time of the schedule.

Returns:
Date Stop time of the schedule or null if the stop time is not set.
See Also:
setStopTime(java.util.Calendar)

setStopTime

public void setStopTime(java.util.Calendar stopTime)
Sets the stop time of the schedule.

The stop time specifies when the schedule shall stop. The schedule will remain active until the stop time - if set - is reached. If no stop time is specified the schedule will be active indefinitely.

If stop time is null the stop time will be cleared.

Parameters:
stopTime - Stop time of the measurement job.
See Also:
getStopTime()

getWeeklySchedule

public WeeklySchedule getWeeklySchedule()
Gets the weekly schedule of the schedule.

Returns:
WeeklySchedule The weekly schedule of the schedule or null if weekly schedule is not set.
See Also:
setWeeklySchedule(com.sun.management.oss.pm.util.WeeklySchedule)

setWeeklySchedule

public void setWeeklySchedule(WeeklySchedule weekSchedule)
Sets the weekly schedule of the schedule.

The weekly schedule specifies which day of the week the schedule will be active. If weekly schedule is omitted the schedule will run all days of the week.

If weekly schedule is null the weekly schedule will be cleared.

Parameters:
weekSchedule - The weekly schedule of the schedule.
See Also:
getWeeklySchedule()

getDailySchedule

public DailySchedule getDailySchedule()
Gets the daily schedule of the schedule.

Returns:
DailySchedule The daily schedule of the schedule or null if daily schedule is not set.
See Also:
setDailySchedule(com.sun.management.oss.pm.util.DailySchedule)

setDailySchedule

public void setDailySchedule(DailySchedule dailySchedule)
Sets the daily schedule of the schedule.

The daily schedule specifies the time frames during the day that the schedule will be active. If daily schedule is omitted, the schedule will run continuously through the day.

If daily schedule is null the daily schedule will be cleared.

Parameters:
dailySchedule - The daily schedule of the schedule.
See Also:
getDailySchedule()