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 ICertificateAuthoritymCAprotected ICertificateRepositorymCertDBprotected static java.lang.String[]mConfigParamsprotected java.lang.StringmEmailSenderprotected java.lang.StringmEmailSubjectprotected java.lang.StringmEmailTemplateNameprotected booleanmHTMLprotected java.lang.StringmHttpHostprotected java.lang.StringmHttpPortprotected booleanmSummaryprotected booleanmSummaryHTMLprotected java.lang.StringmSummaryItemTemplateNameprotected java.lang.StringmSummaryTemplateNamestatic java.lang.StringPROP_CRONstatic java.lang.StringPROP_EMAILSUBJECTemail subject line as appeared on the notification emailstatic java.lang.StringPROP_EMAILTEMPLATElocation of the template file used for email notificationstatic java.lang.StringPROP_MAXNOTIFYCOUNTstatic java.lang.StringPROP_NOTIFYENDOFFSETThis job will stop sending notification this much time after the expiration datestatic java.lang.StringPROP_NOTIFYTRIGGEROFFSETThis job will send notification at this much time before the enpiration datestatic java.lang.StringPROP_PROFILE_IDProfile ID specifies which profile approves the certificate.static java.lang.StringPROP_SENDEREMAILsender email address as appeared on the notification emailstatic java.lang.StringPROP_SUMMARY_ITEMTEMPLATElocation of the template file for each item appeared on the notification summarystatic java.lang.StringPROP_SUMMARY_RECIPIENTEMAILrecipient of the notification summary emailstatic java.lang.StringPROP_SUMMARY_SENDEREMAILsender email as appeared on the notification summary emailstatic java.lang.StringPROP_SUMMARY_SUBJECTemail subject as appeared on the notification summary emailstatic java.lang.StringPROP_SUMMARY_TEMPLATElocation of the email template used for notification summary-
Fields inherited from class com.netscape.cms.jobs.AJobBase
logger, mConfig, mContentParams, mCron, mId, mImplName, mItemForm, mItemParams, mJobCron, 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.IConfigStoregetConfigStore()Gets the configuration substore used by this jobjava.lang.String[]getExtendedPluginInfo(java.util.Locale locale)holds help text for this pluginjava.lang.StringgetId()get instance id.java.lang.StringgetImplName()gets the plugin name of this job.IJobCrongetJobCron()get cron string associated with this jobvoidinit(ISubsystem owner, java.lang.String id, java.lang.String implName, IConfigStore config)Initialize from the configuration file.protected voidmailUser(java.lang.String subject, java.lang.String msg, java.lang.String sender, IRequest req, ICertRecord cr)voidrun()finds out which cert needs notification and notifies the responsible partiesvoidsetId(java.lang.String id)set instance id.-
Methods inherited from class com.netscape.cms.jobs.AJobBase
buildContentParams, buildItemParams, buildItemParams, buildItemParams, getTemplateContent, isEnabled, isStopped, 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:
getExtendedPluginInfoin 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:
initin interfaceIJob- Specified by:
initin 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:
getJobCronin interfaceIJob- Overrides:
getJobCronin 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:
getImplNamein interfaceIJob- Overrides:
getImplNamein 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:
getConfigStorein interfaceIJob- Overrides:
getConfigStorein 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.IOExceptionENotificationExceptionEBaseException
-
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:
getConfigParamsin interfaceIJob- Returns:
- String array of configuration parameter names.
-
-