Package com.netscape.cms.jobs
Class RenewalNotificationJob
- java.lang.Object
-
- com.netscape.cms.jobs.AJobBase
-
- com.netscape.cms.jobs.RenewalNotificationJob
-
- All Implemented Interfaces:
IExtendedPluginInfo
,IJob
,java.lang.Runnable
public class RenewalNotificationJob extends AJobBase implements IJob, java.lang.Runnable, IExtendedPluginInfo
A job for the Jobs Scheduler. This job checks in the internal ldap db for certs about to expire within the next configurable days and sends email notifications to the appropriate recipients. the $TOKENS that are available for the this jobs's summary outer form are:
- $Status
- $InstanceID
- $SummaryItemList
- $SummaryTotalNum
- $SummaryTotalSuccess
- $SummaryTotalfailure
- $ExecutionTime
- $SerialNumber
- $IssuerDN
- $SubjectDN
- $NotAfter
- $NotBefore
- $RequestorEmail
- $CertType
- $RequestType
- $HttpHost
- $HttpPort
-
-
Field Summary
Fields Modifier and Type Field Description protected ICertificateAuthority
mCA
protected ICertificateRepository
mCertDB
protected static java.lang.String[]
mConfigParams
protected java.lang.String
mEmailSender
protected java.lang.String
mEmailSubject
protected java.lang.String
mEmailTemplateName
protected boolean
mHTML
protected java.lang.String
mHttpHost
protected java.lang.String
mHttpPort
protected boolean
mSummary
protected boolean
mSummaryHTML
protected java.lang.String
mSummaryItemTemplateName
protected java.lang.String
mSummaryTemplateName
static java.lang.String
PROP_CRON
static java.lang.String
PROP_EMAILSUBJECT
email subject line as appeared on the notification emailstatic java.lang.String
PROP_EMAILTEMPLATE
location of the template file used for email notificationstatic java.lang.String
PROP_MAXNOTIFYCOUNT
static java.lang.String
PROP_NOTIFYENDOFFSET
This job will stop sending notification this much time after the expiration datestatic java.lang.String
PROP_NOTIFYTRIGGEROFFSET
This job will send notification at this much time before the enpiration datestatic java.lang.String
PROP_PROFILE_ID
Profile ID specifies which profile approves the certificate.static java.lang.String
PROP_SENDEREMAIL
sender email address as appeared on the notification emailstatic java.lang.String
PROP_SUMMARY_ITEMTEMPLATE
location of the template file for each item appeared on the notification summarystatic java.lang.String
PROP_SUMMARY_RECIPIENTEMAIL
recipient of the notification summary emailstatic java.lang.String
PROP_SUMMARY_SENDEREMAIL
sender email as appeared on the notification summary emailstatic java.lang.String
PROP_SUMMARY_SUBJECT
email subject as appeared on the notification summary emailstatic java.lang.String
PROP_SUMMARY_TEMPLATE
location of the email template used for notification summary-
Fields inherited from class com.netscape.cms.jobs.AJobBase
mConfig, mContentParams, mCron, mId, mImplName, mItemForm, mItemParams, mJobCron, mLogger, mMailForm, mMailHTML, mSummaryMailSubject, mSummaryReceiverEmail, mSummarySenderEmail, PROP_EMAIL_SUBJECT, PROP_EMAIL_TEMPLATE, PROP_ENABLED, PROP_ITEM_TEMPLATE, PROP_RECEIVER_EMAIL, PROP_SENDER_EMAIL, PROP_SUMMARY, STATUS_FAILURE, STATUS_SUCCESS
-
Fields inherited from interface com.netscape.certsrv.base.IExtendedPluginInfo
HELP_TEXT, HELP_TOKEN
-
-
Constructor Summary
Constructors Constructor Description RenewalNotificationJob()
class constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getConfigParams()
Returns a list of configuration parameter names.IConfigStore
getConfigStore()
Gets the configuration substore used by this jobjava.lang.String[]
getExtendedPluginInfo(java.util.Locale locale)
holds help text for this pluginjava.lang.String
getId()
get instance id.java.lang.String
getImplName()
gets the plugin name of this job.IJobCron
getJobCron()
get cron string associated with this jobvoid
init(ISubsystem owner, java.lang.String id, java.lang.String implName, IConfigStore config)
Initialize from the configuration file.protected void
mailUser(java.lang.String subject, java.lang.String msg, java.lang.String sender, IRequest req, ICertRecord cr)
void
run()
finds out which cert needs notification and notifies the responsible partiesvoid
setId(java.lang.String id)
set instance id.-
Methods inherited from class com.netscape.cms.jobs.AJobBase
buildContentParams, buildItemParams, buildItemParams, buildItemParams, getTemplateContent, isEnabled, isStopped, log, log, mailSummary, stop
-
-
-
-
Field Detail
-
PROP_CRON
public static final java.lang.String PROP_CRON
- See Also:
- Constant Field Values
-
PROP_PROFILE_ID
public static final java.lang.String PROP_PROFILE_ID
Profile ID specifies which profile approves the certificate.- See Also:
- Constant Field Values
-
PROP_NOTIFYTRIGGEROFFSET
public static final java.lang.String PROP_NOTIFYTRIGGEROFFSET
This job will send notification at this much time before the enpiration date- See Also:
- Constant Field Values
-
PROP_NOTIFYENDOFFSET
public static final java.lang.String PROP_NOTIFYENDOFFSET
This job will stop sending notification this much time after the expiration date- See Also:
- Constant Field Values
-
PROP_SENDEREMAIL
public static final java.lang.String PROP_SENDEREMAIL
sender email address as appeared on the notification email- See Also:
- Constant Field Values
-
PROP_EMAILSUBJECT
public static final java.lang.String PROP_EMAILSUBJECT
email subject line as appeared on the notification email- See Also:
- Constant Field Values
-
PROP_EMAILTEMPLATE
public static final java.lang.String PROP_EMAILTEMPLATE
location of the template file used for email notification- See Also:
- Constant Field Values
-
PROP_MAXNOTIFYCOUNT
public static final java.lang.String PROP_MAXNOTIFYCOUNT
- See Also:
- Constant Field Values
-
PROP_SUMMARY_SENDEREMAIL
public static final java.lang.String PROP_SUMMARY_SENDEREMAIL
sender email as appeared on the notification summary email- See Also:
- Constant Field Values
-
PROP_SUMMARY_RECIPIENTEMAIL
public static final java.lang.String PROP_SUMMARY_RECIPIENTEMAIL
recipient of the notification summary email- See Also:
- Constant Field Values
-
PROP_SUMMARY_SUBJECT
public static final java.lang.String PROP_SUMMARY_SUBJECT
email subject as appeared on the notification summary email- See Also:
- Constant Field Values
-
PROP_SUMMARY_TEMPLATE
public static final java.lang.String PROP_SUMMARY_TEMPLATE
location of the email template used for notification summary- See Also:
- Constant Field Values
-
PROP_SUMMARY_ITEMTEMPLATE
public static final java.lang.String PROP_SUMMARY_ITEMTEMPLATE
location of the template file for each item appeared on the notification summary- See Also:
- Constant Field Values
-
mConfigParams
protected static java.lang.String[] mConfigParams
-
mCertDB
protected ICertificateRepository mCertDB
-
mCA
protected ICertificateAuthority mCA
-
mSummary
protected boolean mSummary
-
mEmailSender
protected java.lang.String mEmailSender
-
mEmailSubject
protected java.lang.String mEmailSubject
-
mEmailTemplateName
protected java.lang.String mEmailTemplateName
-
mSummaryItemTemplateName
protected java.lang.String mSummaryItemTemplateName
-
mSummaryTemplateName
protected java.lang.String mSummaryTemplateName
-
mSummaryHTML
protected boolean mSummaryHTML
-
mHTML
protected boolean mHTML
-
mHttpHost
protected java.lang.String mHttpHost
-
mHttpPort
protected java.lang.String mHttpPort
-
-
Method Detail
-
getExtendedPluginInfo
public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
holds help text for this plugin- Specified by:
getExtendedPluginInfo
in interfaceIExtendedPluginInfo
-
init
public void init(ISubsystem owner, java.lang.String id, java.lang.String implName, IConfigStore config) throws EBaseException
Initialize from the configuration file.- Specified by:
init
in interfaceIJob
- Specified by:
init
in classAJobBase
- Parameters:
id
- String name of this instanceimplName
- string name of this implementationconfig
- configuration store for this instance- Throws:
EBaseException
-
run
public void run()
finds out which cert needs notification and notifies the responsible parties
-
getId
public java.lang.String getId()
get instance id.
-
setId
public void setId(java.lang.String id)
set instance id.
-
getJobCron
public IJobCron getJobCron()
get cron string associated with this job- Specified by:
getJobCron
in interfaceIJob
- Overrides:
getJobCron
in classAJobBase
- Returns:
- a JobCron object that represents the schedule of this job
-
getImplName
public java.lang.String getImplName()
gets the plugin name of this job.- Specified by:
getImplName
in interfaceIJob
- Overrides:
getImplName
in classAJobBase
- Returns:
- a String that is the name of this implementation
-
getConfigStore
public IConfigStore getConfigStore()
Gets the configuration substore used by this job- Specified by:
getConfigStore
in interfaceIJob
- Overrides:
getConfigStore
in classAJobBase
- Returns:
- configuration store
-
mailUser
protected void mailUser(java.lang.String subject, java.lang.String msg, java.lang.String sender, IRequest req, ICertRecord cr) throws java.io.IOException, ENotificationException, EBaseException
- Throws:
java.io.IOException
ENotificationException
EBaseException
-
getConfigParams
public java.lang.String[] 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.- Specified by:
getConfigParams
in interfaceIJob
- Returns:
- String array of configuration parameter names.
-
-