Package com.netscape.cmscore.jobs
Class JobCron
- java.lang.Object
-
- com.netscape.cmscore.jobs.JobCron
-
- All Implemented Interfaces:
com.netscape.certsrv.jobs.IJobCron
public class JobCron extends java.lang.Object implements com.netscape.certsrv.jobs.IJobCron
class representing one Job cron informationhere, an "item" refers to one of the 5 fields in a cron string; "element" refers to any comma-deliminated element in an "item"...which includes both numbers and '-' separated ranges. A cron string in the configuration takes the following format: minute (0-59), hour (0-23), day of the month (1-31), month of the year (1-12), day of the week (0-6 with 0=Sunday)
e.g. jobsScheduler.job.rnJob1.cron=30 11,23 * * 1-5 In this example, the job "rnJob1" will be executed from Monday through Friday, at 11:30am and 11:30pm.
- Version:
- $Revision$, $Date$
- Author:
- cfu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CRON_DAY_OF_MONTH
static java.lang.String
CRON_DAY_OF_WEEK
static java.lang.String
CRON_HOUR
static java.lang.String
CRON_MINUTE
CRON_MINUTE, CRON_HOUR, CRON_DAY_OF_MONTH, CRON_MONTH_OF_YEAR, and CRON_DAY_OF_WEEK are to be used in getItem() to retrieve the corresponding CronItemstatic java.lang.String
CRON_MONTH_OF_YEAR
static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description JobCron(java.lang.String cronString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
DOW_cal2cron(java.util.Calendar time)
convert the day of the week representation from Calendar to cronCronItem
getItem(java.lang.String item)
retrieves the cron itemint
MOY_cal2cron(java.util.Calendar time)
convert the month of year representation from Calendar to cron
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
CRON_MINUTE
public static final java.lang.String CRON_MINUTE
CRON_MINUTE, CRON_HOUR, CRON_DAY_OF_MONTH, CRON_MONTH_OF_YEAR, and CRON_DAY_OF_WEEK are to be used in getItem() to retrieve the corresponding CronItem- See Also:
- Constant Field Values
-
CRON_HOUR
public static final java.lang.String CRON_HOUR
- See Also:
- Constant Field Values
-
CRON_DAY_OF_MONTH
public static final java.lang.String CRON_DAY_OF_MONTH
- See Also:
- Constant Field Values
-
CRON_MONTH_OF_YEAR
public static final java.lang.String CRON_MONTH_OF_YEAR
- See Also:
- Constant Field Values
-
CRON_DAY_OF_WEEK
public static final java.lang.String CRON_DAY_OF_WEEK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JobCron
public JobCron(java.lang.String cronString) throws EBaseException
- Throws:
EBaseException
-
-
Method Detail
-
getItem
public CronItem getItem(java.lang.String item)
retrieves the cron item- Parameters:
item
- name of the item. must be one of the CRON_* strings defined in this class- Returns:
- an instance of the CronItem class which represents the requested cron item
-
DOW_cal2cron
public int DOW_cal2cron(java.util.Calendar time)
convert the day of the week representation from Calendar to cron- Parameters:
time
- the Calendar value represents a moment of time- Returns:
- an integer value that represents a cron Day-Of-Week element
-
MOY_cal2cron
public int MOY_cal2cron(java.util.Calendar time)
convert the month of year representation from Calendar to cron- Parameters:
time
- the Calendar value represents a moment of time- Returns:
- an integer value that represents a cron Month-Of-Year element
-
-