Package com.netscape.cms.jobs
Class Job
java.lang.Object
com.netscape.cms.jobs.Job
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
RequestInQueueJob
This abstract class is a base job for real job extensions for the
Jobs Scheduler.
- Version:
- $Revision$, $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CMSEngine
static final org.slf4j.Logger
protected JobConfig
protected static String[]
protected String
protected String
protected String
protected String
protected JobCron
protected String
protected boolean
protected String
protected String
protected String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildContentParams
(String name, String val) protected void
protected void
buildItemParams
(String name, String val) protected void
buildItemParams
(org.mozilla.jss.netscape.security.x509.X509CertImpl cert) abstract String[]
Returns a list of configuration parameter names.Gets the configuration substore used by this jobgetId()
get instance id.gets the plugin name of this job.get cron string associated with this jobprotected String
getTemplateContent
(String templatePath) void
init
(JobsScheduler scheduler, String id, String implName, JobConfig config) Initialize from the configuration file.boolean
tells if the job is enabledboolean
Check whether the job has been asked to stop.protected void
mailSummary
(String content) void
setCMSEngine
(CMSEngine engine) void
set instance id.void
stop()
Request the job to stop gracefully.
-
Field Details
-
logger
public static final org.slf4j.Logger logger -
PROP_SUMMARY
- See Also:
-
PROP_ENABLED
- See Also:
-
PROP_EMAIL_SUBJECT
- See Also:
-
PROP_EMAIL_TEMPLATE
- See Also:
-
PROP_ITEM_TEMPLATE
- See Also:
-
PROP_SENDER_EMAIL
- See Also:
-
PROP_RECEIVER_EMAIL
- See Also:
-
STATUS_FAILURE
- See Also:
-
STATUS_SUCCESS
- See Also:
-
engine
-
mImplName
-
mConfig
-
mId
-
mCron
-
mJobCron
-
mConfigParams
-
mSummaryMailSubject
-
mMailHTML
protected boolean mMailHTML -
mMailForm
-
mItemForm
-
mSummarySenderEmail
-
mSummaryReceiverEmail
-
mContentParams
-
mItemParams
-
-
Constructor Details
-
Job
protected Job()
-
-
Method Details
-
getCMSEngine
-
setCMSEngine
-
getConfigParams
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.- Returns:
- String array of configuration parameter names.
-
isEnabled
public boolean isEnabled()tells if the job is enabled- Returns:
- a boolean value indicating whether the job is enabled or not
-
init
public void init(JobsScheduler scheduler, String id, String implName, JobConfig config) throws EBaseException Initialize from the configuration file.- Parameters:
id
- String name of this instanceimplName
- string name of this implementationconfig
- configuration store for this instance- Throws:
EBaseException
- any initialization failure
-
getId
get instance id.- Returns:
- a String identifier
-
setId
set instance id.- Parameters:
id
- String id of the instance
-
getJobCron
get cron string associated with this job- Returns:
- a JobCron object that represents the schedule of this job
-
getImplName
gets the plugin name of this job.- Returns:
- a String that is the name of this implementation
-
getConfigStore
Gets the configuration substore used by this job- Returns:
- configuration store
-
getTemplateContent
-
mailSummary
-
buildItemParams
protected void buildItemParams(org.mozilla.jss.netscape.security.x509.X509CertImpl cert) -
buildItemParams
-
buildItemParams
-
buildContentParams
-
stop
public void stop()Request the job to stop gracefully. The job may not stop immediately. -
isStopped
public boolean isStopped()Check whether the job has been asked to stop. Long running jobs should call this method occasionally inside the run() method and exit gracefully if it returns true.
-