diff options
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/jobs/AJobBase.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/jobs/AJobBase.java | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/pki/base/common/src/com/netscape/cms/jobs/AJobBase.java b/pki/base/common/src/com/netscape/cms/jobs/AJobBase.java index 8488ec2d0..5b8176da2 100644 --- a/pki/base/common/src/com/netscape/cms/jobs/AJobBase.java +++ b/pki/base/common/src/com/netscape/cms/jobs/AJobBase.java @@ -17,7 +17,6 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.jobs; - import java.io.IOException; import java.util.Hashtable; @@ -36,11 +35,10 @@ import com.netscape.certsrv.notification.IEmailTemplate; import com.netscape.certsrv.notification.IMailNotification; import com.netscape.certsrv.request.IRequest; - /** * This abstract class is a base job for real job extentions for the - * Jobs Scheduler. - * + * Jobs Scheduler. + * * @version $Revision$, $Date$ * @see com.netscape.certsrv.jobs.IJob */ @@ -81,8 +79,9 @@ public abstract class AJobBase implements IJob, Runnable { /** * tells if the job is enabled + * * @return a boolean value indicating whether the job is enabled - * or not + * or not */ public boolean isEnabled() { boolean enabled = false; @@ -98,16 +97,17 @@ public abstract class AJobBase implements IJob, Runnable { * abstract methods ***********************/ public abstract void init(ISubsystem owner, String id, String implName, IConfigStore - config) throws EBaseException; + config) throws EBaseException; public abstract void run(); /*********************** * public methods ***********************/ - + /** * get instance id. + * * @return a String identifier */ public String getId() { @@ -116,6 +116,7 @@ public abstract class AJobBase implements IJob, Runnable { /** * set instance id. + * * @param id String id of the instance */ public void setId(String id) { @@ -124,6 +125,7 @@ public abstract class AJobBase implements IJob, Runnable { /** * get cron string associated with this job + * * @return a JobCron object that represents the schedule of this job */ public IJobCron getJobCron() { @@ -132,6 +134,7 @@ public abstract class AJobBase implements IJob, Runnable { /** * gets the plugin name of this job. + * * @return a String that is the name of this implementation */ public String getImplName() { @@ -140,6 +143,7 @@ public abstract class AJobBase implements IJob, Runnable { /** * Gets the configuration substore used by this job + * * @return configuration store */ public IConfigStore getConfigStore() { @@ -193,29 +197,29 @@ public abstract class AJobBase implements IJob, Runnable { } catch (ENotificationException e) { // already logged, lets audit mLogger.log(ILogger.EV_AUDIT, null, - ILogger.S_OTHER, - ILogger.LL_FAILURE, CMS.getLogMessage("JOBS_SEND_NOTIFICATION", e.toString())); + ILogger.S_OTHER, + ILogger.LL_FAILURE, CMS.getLogMessage("JOBS_SEND_NOTIFICATION", e.toString())); } catch (IOException e) { // already logged, lets audit mLogger.log(ILogger.EV_AUDIT, null, - ILogger.S_OTHER, - ILogger.LL_FAILURE, CMS.getLogMessage("JOBS_SEND_NOTIFICATION", e.toString())); + ILogger.S_OTHER, + ILogger.LL_FAILURE, CMS.getLogMessage("JOBS_SEND_NOTIFICATION", e.toString())); } } protected void buildItemParams(X509CertImpl cert) { mItemParams.put(IEmailFormProcessor.TOKEN_SERIAL_NUM, - (Object) cert.getSerialNumber().toString()); + (Object) cert.getSerialNumber().toString()); mItemParams.put(IEmailFormProcessor.TOKEN_HEX_SERIAL_NUM, - (Object) cert.getSerialNumber().toString(16)); + (Object) cert.getSerialNumber().toString(16)); mItemParams.put(IEmailFormProcessor.TOKEN_ISSUER_DN, - (Object) cert.getIssuerDN().toString()); + (Object) cert.getIssuerDN().toString()); mItemParams.put(IEmailFormProcessor.TOKEN_SUBJECT_DN, - (Object) cert.getSubjectDN().toString()); + (Object) cert.getSubjectDN().toString()); mItemParams.put(IEmailFormProcessor.TOKEN_NOT_AFTER, - (Object) cert.getNotAfter().toString()); + (Object) cert.getNotAfter().toString()); mItemParams.put(IEmailFormProcessor.TOKEN_NOT_BEFORE, - (Object) cert.getNotBefore().toString()); + (Object) cert.getNotBefore().toString()); // ... and more } @@ -258,7 +262,8 @@ public abstract class AJobBase implements IJob, Runnable { } /** - * logs an entry in the log file. Used by classes extending this class. + * logs an entry in the log file. Used by classes extending this class. + * * @param level log level * @param msg log message in String */ @@ -266,21 +271,21 @@ public abstract class AJobBase implements IJob, Runnable { if (mLogger == null) return; mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER, - level, mId + ": " + msg); + level, mId + ": " + msg); } /** - * capable of logging multiline entry in the log file. Used by classes extending this class. + * capable of logging multiline entry in the log file. Used by classes extending this class. + * * @param level log level * @param msg log message in String * @param multiline boolean indicating whether the message is a - * multi-lined message. + * multi-lined message. */ public void log(int level, String msg, boolean multiline) { if (mLogger == null) return; mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER, - level, mId + ": " + msg, multiline); + level, mId + ": " + msg, multiline); } } - |