diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/certsrv/jobs')
6 files changed, 67 insertions, 82 deletions
diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/EJobsException.java b/pki/base/common/src/com/netscape/certsrv/jobs/EJobsException.java index 154cb4e4a..cc0923ae7 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/EJobsException.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/EJobsException.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - import com.netscape.certsrv.base.EBaseException; - /** * A class represents a jobs exception. * <P> - * + * * @version $Revision$, $Date$ */ public class EJobsException extends EBaseException { diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/IJob.java b/pki/base/common/src/com/netscape/certsrv/jobs/IJob.java index 1c3842bf5..3683b1f09 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/IJob.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/IJob.java @@ -17,72 +17,77 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.IConfigStore; import com.netscape.certsrv.base.ISubsystem; - /** * An interface to be implemented from for a job to be scheduled by * the Jobs Scheduler. - * - * @version $Revision$, $Date$ + * + * @version $Revision$, $Date$ */ public interface IJob { /** * Initialize from the configuration file. + * * @param id String name of this instance * @param implName string name of this implementation * @param config configuration store for this instance * @exception EBaseException any initilization failure */ public void init(ISubsystem owner, String id, String implName, - IConfigStore config) throws EBaseException; + IConfigStore config) throws EBaseException; /** * tells if the job is enabled + * * @return a boolean value indicating whether the job is enabled - * or not + * or not */ public boolean isEnabled(); /** * set instance id. + * * @param id String id of the instance */ public void setId(String id); /** * get instance id. + * * @return a String identifier */ public String getId(); /** * get cron string associated with this job + * * @return a JobCron object that represents the schedule of this job */ public IJobCron getJobCron(); /** - * Returns a list of configuration parameter names. - * The list is passed to the configuration console so instances of + * Returns a list of configuration parameter names. + * The list is passed to the configuration console so instances of * this implementation can be configured through the console. - * + * * @return String array of configuration parameter names. */ public String[] getConfigParams(); /** * gets the plugin name of this job. + * * @return a String that is the name of this implementation */ public String getImplName(); /** * Gets the configuration substore used by this job + * * @return configuration store */ public IConfigStore getConfigStore(); diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/IJobCron.java b/pki/base/common/src/com/netscape/certsrv/jobs/IJobCron.java index 1e238f60a..e0fb0ba4b 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/IJobCron.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/IJobCron.java @@ -17,32 +17,20 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - - - /** * class representing one Job cron information - * <p>here, 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: - * <i>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)</i> * <p> - * 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. + * here, 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: <i>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)</i> + * <p> + * 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. * <p> - * + * * @version $Revision$, $Date$ */ public interface IJobCron { /** * constant that represents the configuration parameter - * "cron" for the job that this JobCron is associated with. The + * "cron" for the job that this JobCron is associated with. The * value of which should conform to the cron format specified above. */ public static final String PROP_CRON = "cron"; diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/IJobsScheduler.java b/pki/base/common/src/com/netscape/certsrv/jobs/IJobsScheduler.java index 844250dee..e4daffbe7 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/IJobsScheduler.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/IJobsScheduler.java @@ -17,32 +17,22 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - import java.util.Hashtable; import com.netscape.certsrv.base.EBaseException; import com.netscape.certsrv.base.ISubsystem; - /** - * An interface that represents the job scheduler component. A JobScheduler + * An interface that represents the job scheduler component. A JobScheduler * is a daemon thread that handles scheduled jobs like cron would - * do with different jobs. This daemon wakes up at a pre-configured + * do with different jobs. This daemon wakes up at a pre-configured * interval to see * if there is any job to be done, if so, a thread is created to execute * the job(s). * <p> - * The interval <b>jobsScheduler.interval</b> in the configuration is - * specified as number of minutes. If not set, the default is 1 minute. - * Note that the cron specification for each job CAN NOT be finer than - * the granularity of the Scheduler daemon interval. For example, if - * the daemon interval is set to 5 minute, a job cron for every minute - * at 7am on each Tuesday (e.g. * 7 * * 2) will result in the - * execution of the job thread only once every 5 minutes during that - * hour. <b>The inteval value is recommended at 1 minute, setting it - * otherwise has the potential of forever missing the beat</b>. Use - * with caution. - * + * The interval <b>jobsScheduler.interval</b> in the configuration is specified as number of minutes. If not set, the default is 1 minute. Note that the cron specification for each job CAN NOT be finer than the granularity of the Scheduler daemon interval. For example, if the daemon interval is set to 5 minute, a job cron for every minute at 7am on each Tuesday (e.g. * 7 * * 2) will result in the execution of the job thread only once every 5 minutes during that hour. <b>The inteval value is + * recommended at 1 minute, setting it otherwise has the potential of forever missing the beat</b>. Use with caution. + * * @version $Revision$, $Date$ */ public interface IJobsScheduler extends ISubsystem { @@ -53,14 +43,14 @@ public interface IJobsScheduler extends ISubsystem { /** * constant that represents the configuration parameter - * "enabled" for this component in CMS.cfg. The value of which + * "enabled" for this component in CMS.cfg. The value of which * tells CMS whether the JobsScheduler is enabled or not */ public static final String PROP_ENABLED = "enabled"; /** * constant that represents the configuration parameter - * "interval" for this component in CMS.cfg. The value of which + * "interval" for this component in CMS.cfg. The value of which * tells CMS the interval that the JobsScheduler thread should * wake up and look for jobs to execute */ @@ -68,14 +58,14 @@ public interface IJobsScheduler extends ISubsystem { /** * constant that represents the configuration parameter - * "class" for this component in CMS.cfg. The values of which are + * "class" for this component in CMS.cfg. The values of which are * the actual implementation classes */ public static final String PROP_CLASS = "class"; /** * constant that represents the configuration parameter - * "job" for this component in CMS.cfg. The values of which gives + * "job" for this component in CMS.cfg. The values of which gives * configuration information specific to one single job instance. * There may be multiple jobs served by the jobsScheduler */ @@ -83,80 +73,86 @@ public interface IJobsScheduler extends ISubsystem { /** * constant that represents the configuration parameter - * "impl" for this component in CMS.cfg. The values of which are + * "impl" for this component in CMS.cfg. The values of which are * actual plugin implementation(s) */ public static final String PROP_IMPL = "impl"; /** * constant that represents the configuration parameter - * "pluginName" for this component in CMS.cfg. The value of which + * "pluginName" for this component in CMS.cfg. The value of which * gives the pluginName for the job it associates with */ public static final String PROP_PLUGIN = "pluginName"; /** * Retrieves all the job implementations. + * * @return a Hashtable of available job plugin implementations */ public Hashtable<String, JobPlugin> getPlugins(); /** * Retrieves all the job instances. + * * @return a Hashtable of job instances */ - public Hashtable<String, IJob> getInstances(); + public Hashtable<String, IJob> getInstances(); /** * Retrieves the configuration parameters of the given - * implementation. It is used to return to the Console for + * implementation. It is used to return to the Console for * configuration + * * @param implName the pulubin implementation name * @return a String array of required configuration parameters of - * the given implementation. + * the given implementation. * @exception EJobsException when job plugin implementation can - * not be found, instantiation is impossible, permission problem - * with the class. + * not be found, instantiation is impossible, permission problem + * with the class. */ - public String[] getConfigParams(String implName) - throws EJobsException; + public String[] getConfigParams(String implName) + throws EJobsException; /** * Writes a message to the system log. + * * @param level an integer representing the log message level. - * Depending on the configuration set by the administrator, this - * value is a determining factor for whether this message will be - * actually logged or not. The lower the level, the higher the - * priority, and the higher chance it will be logged. - * @param msg the message to be written. Ideally should call - * CMS.getLogMessage() to get the localizable message - * from the log properties file. + * Depending on the configuration set by the administrator, this + * value is a determining factor for whether this message will be + * actually logged or not. The lower the level, the higher the + * priority, and the higher chance it will be logged. + * @param msg the message to be written. Ideally should call + * CMS.getLogMessage() to get the localizable message + * from the log properties file. */ - public void log(int level, String msg); + public void log(int level, String msg); /** * Sets daemon's wakeup interval. + * * @param minutes time in minutes that is to be the frequency of - * JobsScheduler wakeup call. + * JobsScheduler wakeup call. */ - public void setInterval(int minutes); + public void setInterval(int minutes); /** - * Starts up the JobsScheduler daemon. Usually called from the + * Starts up the JobsScheduler daemon. Usually called from the * initialization method when it's successfully initialized. */ public void startDaemon(); /** - * Creates a job cron. Each job is associated with a "cron" which + * Creates a job cron. Each job is associated with a "cron" which * specifies the rule of frequency that this job should be - * executed (e.g. every Sunday at midnight). This method is + * executed (e.g. every Sunday at midnight). This method is * called by each job at initialization time. - * @param cs the string that represents the cron. See IJobCron - * for detail of the format. + * + * @param cs the string that represents the cron. See IJobCron + * for detail of the format. * @return IJobCron an IJobCron * @exception EBaseException when the cron string, cs, can not be - * parsed correctly + * parsed correctly */ public IJobCron createJobCron(String cs) throws EBaseException; } diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/JobPlugin.java b/pki/base/common/src/com/netscape/certsrv/jobs/JobPlugin.java index 33b7e7f2a..46a1b6d7e 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/JobPlugin.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/JobPlugin.java @@ -17,15 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - - - /** * This class represents a job plugin registered with the - * JobScheduler. A Job plugin can be instantiated into a Job instance + * JobScheduler. A Job plugin can be instantiated into a Job instance * and scheduled by the JobScheduler to run at a scheduled interval * <P> - * + * * @version $Revision$, $Date$ */ public class JobPlugin { @@ -46,6 +43,7 @@ public class JobPlugin { /** * Constructor for a Job plugin. + * * @param id job plugin name * @param classPath the Java class name of this job plugin */ @@ -56,6 +54,7 @@ public class JobPlugin { /** * get the job plugin name + * * @return the name of this job plugin */ public String getId() { @@ -64,6 +63,7 @@ public class JobPlugin { /** * get the Java class name + * * @return the Java class name of this plugin */ public String getClassPath() { diff --git a/pki/base/common/src/com/netscape/certsrv/jobs/JobsResources.java b/pki/base/common/src/com/netscape/certsrv/jobs/JobsResources.java index 9bc828262..ec33137cf 100644 --- a/pki/base/common/src/com/netscape/certsrv/jobs/JobsResources.java +++ b/pki/base/common/src/com/netscape/certsrv/jobs/JobsResources.java @@ -17,14 +17,12 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.certsrv.jobs; - import java.util.ListResourceBundle; - /** - * A class represents a resource bundle for the + * A class represents a resource bundle for the * Jobs package - * + * * @version $Revision$, $Date$ */ public class JobsResources extends ListResourceBundle { |