SAP NetWeaver '04

com.sapportals.wcm.service.scheduler
Interface ISchedulerTime

[contained in: com.sap.netweaver.bc.sf.service.par - bc.sf.service.scheduler_api.jar]
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.
 java.lang.String getAsText()
          Get the time in textual representation.
 java.util.TimeZone getTimeZone()
          Returns the time zone this scheduler time belongs to.
 boolean matches(java.util.Calendar date)
          Test, if a given date matches this time.
 boolean set(int field, int value)
          Set time values, as in Calendar.
 boolean setAsText(java.lang.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(java.util.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

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

matches

public boolean matches(java.util.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

public 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

public 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

public 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

public 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

public 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

public java.lang.String getAsText()
Get the time in textual representation.
Returns:
a String with the time in a textual representation.
See Also:
setAsText(String)

setAsText

public boolean setAsText(java.lang.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

public void setTimeZone(java.util.TimeZone zone)
                 throws WcmException
Sets the time zone of this scheduler time belongs to.
Parameters:
zone - The time zone this time belongs to.
Throws:
WcmException - If the time zone could not be set.

getTimeZone

public java.util.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.

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.