com.netscape.cms.jobs
Class RenewalNotificationJob

java.lang.Object
  extended by com.netscape.cms.jobs.AJobBase
      extended by 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:

and for the inner list items:

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
IJob, AJobBase

Field Summary
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 static java.util.Vector mExtendedPluginInfo
           
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 email
static java.lang.String PROP_EMAILTEMPLATE
          location of the template file used for email notification
static java.lang.String PROP_MAXNOTIFYCOUNT
           
static java.lang.String PROP_NOTIFYENDOFFSET
          This job will stop sending notification this much time after the expiration date
static java.lang.String PROP_NOTIFYTRIGGEROFFSET
          This job will send notification at this much time before the enpiration date
static 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 email
static java.lang.String PROP_SUMMARY_ITEMTEMPLATE
          location of the template file for each item appeared on the notification summary
static java.lang.String PROP_SUMMARY_RECIPIENTEMAIL
          recipient of the notification summary email
static java.lang.String PROP_SUMMARY_SENDEREMAIL
          sender email as appeared on the notification summary email
static java.lang.String PROP_SUMMARY_SUBJECT
          email subject as appeared on the notification summary email
static 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
RenewalNotificationJob()
          class constructor
 
Method Summary
 java.lang.String[] getConfigParams()
          Returns a list of configuration parameter names.
 IConfigStore getConfigStore()
          Gets the configuration substore used by this job
 java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
          holds help text for this plugin
 java.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 job
 void 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 parties
 void setId(java.lang.String id)
          set instance id.
 
Methods inherited from class com.netscape.cms.jobs.AJobBase
buildContentParams, buildItemParams, buildItemParams, buildItemParams, getTemplateContent, isEnabled, log, log, mailSummary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.netscape.certsrv.jobs.IJob
isEnabled
 

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

mExtendedPluginInfo

protected static java.util.Vector mExtendedPluginInfo
Constructor Detail

RenewalNotificationJob

public RenewalNotificationJob()
class constructor

Method Detail

getExtendedPluginInfo

public java.lang.String[] getExtendedPluginInfo(java.util.Locale locale)
holds help text for this plugin

Specified by:
getExtendedPluginInfo in interface IExtendedPluginInfo

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 interface IJob
Specified by:
init in class AJobBase
Parameters:
id - String name of this instance
implName - string name of this implementation
config - configuration store for this instance
Throws:
EBaseException

run

public void run()
finds out which cert needs notification and notifies the responsible parties

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AJobBase

getId

public java.lang.String getId()
get instance id.

Specified by:
getId in interface IJob
Overrides:
getId in class AJobBase
Returns:
a String identifier

setId

public void setId(java.lang.String id)
set instance id.

Specified by:
setId in interface IJob
Overrides:
setId in class AJobBase
Parameters:
id - String id of the instance

getJobCron

public IJobCron getJobCron()
get cron string associated with this job

Specified by:
getJobCron in interface IJob
Overrides:
getJobCron in class AJobBase
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 interface IJob
Overrides:
getImplName in class AJobBase
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 interface IJob
Overrides:
getConfigStore in class AJobBase
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 interface IJob
Returns:
String array of configuration parameter names.