com.sapportals.wcm.service.scheduler

Interface ISchedulerTime


public interface ISchedulerTime

The times for a scheduler.

A ISchedulerTime represents a time in an ISchedulerTimeTable when an ISchedulerTask should be executed by the IScheduler.
Examples: every Friday at 10am: set(Calendar.FRIDAY, 10, 0); or every Day in September at 9pm: set(Calendar.SEPTEMBER, ISchedulerTime.WILDCARD, 21, 0);

Copyright 2004 SAP AG

See Also:
ISchedulerTimeTable

Field Summary
static int WILDCARD
          A 'dont care'-value for the several timetable fields (means 'any').
 
Method Summary
 int get(int field)
          Get time values, as in Calendar.
 String getAsText()
          Get the time in textual representation.
 Set getAvailableTimeZones()
          Returns a set of all time zones that can be set for this scheduler time.
 TimeZone getTimeZone()
          Returns the time zone this scheduler time belongs to.
 boolean isAvailableTimeZone(TimeZone zone)
          Checks whether a time zone can be set for this scheduler time or would be replaced by the default time zone if set.
 boolean matches(Calendar date)
          Test, if a given date matches this time.
 boolean set(int field, int value)
          Set time values, as in Calendar.
 boolean setAsText(String text)
          Set the time in a textual representation.
 boolean setMonthDay(int year, int month, int monthday, int hour, int minute)
          Set the time to the given values for month and monthday.
 void setTimeZone(TimeZone zone)
          Sets the time zone of this scheduler time belongs to.
 boolean setWeekDay(int year, int month, int weekday, int hour, int minute)
          Set the time to the given values for weekday.
 boolean setWeekOfMonth(int year, int month, int weekday, int weekofmonth, int hour, int minute)
          Set the time to the given values for the week of the month.
 

Field Detail

WILDCARD

static final int WILDCARD
A 'dont care'-value for the several timetable fields (means 'any').

See Also:
Constant Field Values
Method Detail

matches

boolean matches(Calendar date)
Test, if a given date matches this time.

Parameters:
date - the Calendar with the date to check.
Returns:
a boolean true if the date matches the time, false if it does not match.

setMonthDay

boolean setMonthDay(int year,
                    int month,
                    int monthday,
                    int hour,
                    int minute)
                    throws WcmException
Set the time to the given values for month and monthday.

Parameters:
year - an int with the year (1900-2100).
month - an int with the month (constants from Calendar)
hour - an int with the hour (0-23).
minute - an int with the minute (0-59)
monthday - The new monthDay value
Returns:
a boolean true if successful, false if not.
Throws:
WcmException - if the time can not be set.

setWeekDay

boolean setWeekDay(int year,
                   int month,
                   int weekday,
                   int hour,
                   int minute)
                   throws WcmException
Set the time to the given values for weekday.

Parameters:
year - an int with the year (1900-2100).
month - an int with the month (constants from Calendar)
weekday - an int with the weekday (use constants from Calendar)
hour - an int with the hour (0-23)
minute - an int with the minute (0-59)
Returns:
a boolean true if successful, false if not.
Throws:
WcmException - if the time can not be set.

setWeekOfMonth

boolean setWeekOfMonth(int year,
                       int month,
                       int weekday,
                       int weekofmonth,
                       int hour,
                       int minute)
                       throws WcmException
Set the time to the given values for the week of the month.

Parameters:
year - an int with the year (1900-2100).
month - an int with the month (constants from Calendar)
weekday - an int with the weekday (use constants from Calendar)
weekofmonth - an int with the week of the month (1-5)
hour - an int with the hour (0-23)
minute - an int with the minute (0-59)
Returns:
a boolean true if successful, false if not.
Throws:
WcmException - if the time can not be set.

get

int get(int field)
        throws WcmException
Get time values, as in Calendar.

Parameters:
field - an int which defines the field to get (constants from Calendar)
Returns:
an int with the value for that field.
Throws:
WcmException - if the field can not be retrieved.

set

boolean set(int field,
            int value)
            throws WcmException
Set time values, as in Calendar.

Parameters:
field - an int which defines the field to set (constants from Calendar)
value - an int with the value to set.
Returns:
a boolean true if successful, false if not.
Throws:
WcmException - if the field can not be set.

getAsText

String getAsText()
Get the time in textual representation.

Returns:
a String with the time in a textual representation.
See Also:
setAsText(String)

setAsText

boolean setAsText(String text)
                  throws WcmException
Set the time in a textual representation.

Parameters:
text - The new asText value
Returns:
a boolean true if successful, false if not (the String was not valid).
A valid String with the time has to be in the following format: y,m,d,w,o,h,m where y specifies the year (1900 to 2100 or * for any), m specifies the month (1 to 12, or * for any), d specifies the day of month (1 to 31, or * for any) w specifies the day of week (1 to 7, or * for any) o specifies the week of the month (1 to 5 or * for any) h specifies the hour (0 to 23, or * for any) m specifies the minute (0 to 59, or * for any) and either d or w or both have to be set to *, it's invalid to set both of them to a non-* value.
Throws:
WcmException - Description of the Exception
WcmException - if the time can not be set.

setTimeZone

void setTimeZone(TimeZone zone)
                 throws WcmException
Sets the time zone of this scheduler time belongs to. If the time zone is not available it is set to UTC.

Parameters:
zone - The time zone this time belongs to.
Throws:
WcmException - If the time zone could not be set.

getTimeZone

TimeZone getTimeZone()
                     throws WcmException
Returns the time zone this scheduler time belongs to.

Returns:
the time zone this scheduler time belongs to.
Throws:
WcmException - If the time zone could not be retrieved.

getAvailableTimeZones

Set getAvailableTimeZones()
                          throws WcmException
Returns a set of all time zones that can be set for this scheduler time.

Returns:
Set of all supported time zones
Throws:
WcmException - If the available time zones could not be retrieved.

isAvailableTimeZone

boolean isAvailableTimeZone(TimeZone zone)
                            throws WcmException
Checks whether a time zone can be set for this scheduler time or would be replaced by the default time zone if set.

Parameters:
zone - The time zone to be checked
Returns:
true if the given time zone can be set for this scheduler time
Throws:
WcmException - If the given time zone could not be checked
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice