summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/notification
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/notification')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java55
-rw-r--r--pki/base/common/src/com/netscape/cmscore/notification/EmailResolverKeys.java24
-rw-r--r--pki/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java54
-rw-r--r--pki/base/common/src/com/netscape/cmscore/notification/ReqCertEmailResolver.java66
-rw-r--r--pki/base/common/src/com/netscape/cmscore/notification/ReqCertSANameEmailResolver.java120
5 files changed, 161 insertions, 158 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
index 770b5ba4..9f6b206a 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/EmailFormProcessor.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.notification;
-
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
@@ -27,12 +26,12 @@ import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.logging.ILogger;
import com.netscape.certsrv.notification.IEmailFormProcessor;
-
/**
- * formulates the final email. Escape character '\' is understood.
- * '$' is used preceeding a token name. A token name should not be a
- * substring of any other token name
+ * formulates the final email. Escape character '\' is understood. '$' is used
+ * preceeding a token name. A token name should not be a substring of any other
+ * token name
* <p>
+ *
* @author cfu
* @version $Revision$, $Date$
*/
@@ -78,16 +77,19 @@ public class EmailFormProcessor implements IEmailFormProcessor {
}
/*
- * takes the form template, parse and replace all $tokens with the
- * right values. It handles escape character '\'
+ * takes the form template, parse and replace all $tokens with the right
+ * values. It handles escape character '\'
+ *
* @param form The locale specific form template,
- * @param tok2vals a hashtable containing one to one mapping
- * from $tokens used by the admins in the form template to the real
- * values corresponding to the $tokens
+ *
+ * @param tok2vals a hashtable containing one to one mapping from $tokens
+ * used by the admins in the form template to the real values corresponding
+ * to the $tokens
+ *
* @return mail content
*/
public String getEmailContent(String form,
- Hashtable<String, Object> tok2vals) {
+ Hashtable<String, Object> tok2vals) {
mTok2vals = tok2vals;
if (form == null) {
@@ -104,11 +106,11 @@ public class EmailFormProcessor implements IEmailFormProcessor {
* first, take care of the escape characters '\'
*/
StringTokenizer es = new StringTokenizer(form, TOK_ESC);
-
+
if (es.hasMoreTokens() && !form.startsWith(TOK_ESC)) {
dollarProcess(es.nextToken());
}
-
+
// rest of them start with '\'
while (es.hasMoreTokens()) {
String t = es.nextToken();
@@ -140,16 +142,16 @@ public class EmailFormProcessor implements IEmailFormProcessor {
}
/*
- * all of the string tokens below begin with a '$'
- * match it one by one with the mTok2vals table
+ * all of the string tokens below begin with a '$' match it one by one
+ * with the mTok2vals table
*/
while (st.hasMoreTokens()) {
String t = st.nextToken();
/*
- * We don't know when a token ends. Compare with every
- * token in the table for the first match. Which means, a
- * token name should not be a substring of any token name
+ * We don't know when a token ends. Compare with every token in the
+ * table for the first match. Which means, a token name should not
+ * be a substring of any token name
*/
boolean matched = false;
String tok = null;
@@ -183,7 +185,7 @@ public class EmailFormProcessor implements IEmailFormProcessor {
matched = true;
// replaced! bail out.
- break;
+ break;
}
}
@@ -192,17 +194,17 @@ public class EmailFormProcessor implements IEmailFormProcessor {
// no match, put the token back, as is
// -- for bug 382162, don't remove the following line, in
- // case John changes his mind for the better
- // mContent.add(TOK_PREFIX+t);
+ // case John changes his mind for the better
+ // mContent.add(TOK_PREFIX+t);
int tl = token_keys.length;
for (int i = 0; i < token_keys.length; i++) {
if (t.startsWith(token_keys[i])) {
- // match, replace it with the TOK_VALUE_UNKNOWN
+ // match, replace it with the TOK_VALUE_UNKNOWN
mContent.add(TOK_VALUE_UNKNOWN);
-
+
// now, put the rest of the non-token string
- // in mContent
+ // in mContent
if (t.length() != token_keys[i].length()) {
mContent.add(t.substring(token_keys[i].length()));
}
@@ -228,7 +230,7 @@ public class EmailFormProcessor implements IEmailFormProcessor {
// initialize content with first element
if (e.hasMoreElements()) {
- content = e.nextElement();
+ content = e.nextElement();
}
while (e.hasMoreElements()) {
@@ -247,7 +249,6 @@ public class EmailFormProcessor implements IEmailFormProcessor {
if (mLogger == null)
return;
mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER,
- level, "EmailFormProcessor: " + msg);
+ level, "EmailFormProcessor: " + msg);
}
}
-
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/EmailResolverKeys.java b/pki/base/common/src/com/netscape/cmscore/notification/EmailResolverKeys.java
index 909ec484..6f22c026 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/EmailResolverKeys.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/EmailResolverKeys.java
@@ -17,18 +17,16 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.notification;
-
import java.util.Enumeration;
import java.util.Hashtable;
import com.netscape.certsrv.base.EBaseException;
import com.netscape.certsrv.notification.IEmailResolverKeys;
-
/**
* Email resolver keys as input to email resolvers
* <P>
- *
+ *
* @author cfu
* @version $Revision$, $Date$
*/
@@ -45,11 +43,12 @@ public class EmailResolverKeys implements IEmailResolverKeys {
/**
* sets a key with key name and the key
+ *
* @param name key name
* @param key key
* @exception com.netscape.certsrv.base.EBaseException NullPointerException
*/
- public void set(String name, Object key)throws EBaseException {
+ public void set(String name, Object key) throws EBaseException {
try {
mKeys.put(name, key);
} catch (NullPointerException e) {
@@ -59,8 +58,8 @@ public class EmailResolverKeys implements IEmailResolverKeys {
}
/**
- * returns the key to which the specified name is mapped in this
- * key set
+ * returns the key to which the specified name is mapped in this key set
+ *
* @param name key name
* @return the named email resolver key
*/
@@ -69,9 +68,9 @@ public class EmailResolverKeys implements IEmailResolverKeys {
}
/**
- * removes the name and its corresponding key from this
- * key set. This method does nothing if the named
- * key is not in the key set.
+ * removes the name and its corresponding key from this key set. This method
+ * does nothing if the named key is not in the key set.
+ *
* @param name key name
*/
public void delete(String name) {
@@ -79,9 +78,9 @@ public class EmailResolverKeys implements IEmailResolverKeys {
}
/**
- * returns an enumeration of the keys in this key
- * set. Use the Enumeration methods on the returned object to
- * fetch the elements sequentially.
+ * returns an enumeration of the keys in this key set. Use the Enumeration
+ * methods on the returned object to fetch the elements sequentially.
+ *
* @return an enumeration of the values in this key set
* @see java.util.Enumeration
*/
@@ -89,4 +88,3 @@ public class EmailResolverKeys implements IEmailResolverKeys {
return (mKeys.elements());
}
}
-
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java b/pki/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java
index 5c9e9ae0..ac25616c 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/EmailTemplate.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.notification;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -28,21 +27,21 @@ import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.logging.ILogger;
import com.netscape.certsrv.notification.IEmailTemplate;
-
/**
- * Files to be processed and returned to the requested parties. It
- * is a template with $tokens to be used by the form/template processor.
- *
- *
+ * Files to be processed and returned to the requested parties. It is a template
+ * with $tokens to be used by the form/template processor.
+ *
+ *
* @author cfu
* @version $Revision$, $Date$
*/
public class EmailTemplate implements IEmailTemplate {
- /*==========================================================
- * variables
- *==========================================================*/
+ /*
+ * ========================================================== variables
+ * ==========================================================
+ */
/* private variables */
private String mTemplateFile = new String();
@@ -51,27 +50,29 @@ public class EmailTemplate implements IEmailTemplate {
/* public vaiables */
public String mFileContents;
- /*==========================================================
- * constructors
- *==========================================================*/
+ /*
+ * ========================================================== constructors
+ * ==========================================================
+ */
/**
* Default Constructor
- *
+ *
* @param templateFile File name of the template including the full path and
- * file extension
+ * file extension
*/
public EmailTemplate(String templatePath) {
mTemplateFile = templatePath;
}
- /*==========================================================
- * public methods
- *==========================================================*/
+ /*
+ * ========================================================== public methods
+ * ==========================================================
+ */
/*
* Load the template from the file
- *
+ *
* @return true if successful
*/
public boolean init() {
@@ -124,14 +125,14 @@ public class EmailTemplate implements IEmailTemplate {
return mTemplateFile;
}
- /**
+ /**
* @return true if template is an html file, false otherwise
*/
public boolean isHTML() {
if (mTemplateFile.endsWith(".html") ||
- mTemplateFile.endsWith(".HTML") ||
- mTemplateFile.endsWith(".htm") ||
- mTemplateFile.endsWith(".HTM"))
+ mTemplateFile.endsWith(".HTML") ||
+ mTemplateFile.endsWith(".htm") ||
+ mTemplateFile.endsWith(".HTM"))
return true;
else
return false;
@@ -144,9 +145,10 @@ public class EmailTemplate implements IEmailTemplate {
return mFileContents;
}
- /*==========================================================
- * private methods
- *==========================================================*/
+ /*
+ * ========================================================== private
+ * methods==========================================================
+ */
/* load file into string */
private String loadFile(FileReader input) {
@@ -178,7 +180,7 @@ public class EmailTemplate implements IEmailTemplate {
if (mLogger == null)
return;
mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER,
- level, msg);
+ level, msg);
}
}
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/ReqCertEmailResolver.java b/pki/base/common/src/com/netscape/cmscore/notification/ReqCertEmailResolver.java
index 04dd9b5f..4c62fa1e 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/ReqCertEmailResolver.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/ReqCertEmailResolver.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.notification;
-
import java.io.IOException;
import java.security.cert.X509Certificate;
@@ -31,11 +30,11 @@ import com.netscape.certsrv.notification.IEmailResolver;
import com.netscape.certsrv.notification.IEmailResolverKeys;
import com.netscape.certsrv.request.IRequest;
-
/**
- * An email resolver that first checks the request email, if none,
- * then follows by checking the subjectDN of the certificate
+ * An email resolver that first checks the request email, if none, then follows
+ * by checking the subjectDN of the certificate
* <p>
+ *
* @author cfu
* @version $Revision$, $Date$
*/
@@ -44,19 +43,21 @@ public class ReqCertEmailResolver implements IEmailResolver {
public static final String KEY_REQUEST = "request";
public static final String KEY_CERT = "cert";
+
// required keys for this resolver to figure out the email address
- // protected static String[] mRequiredKeys = {KEY_REQUEST, KEY_CERT};
+ // protected static String[] mRequiredKeys = {KEY_REQUEST, KEY_CERT};
public ReqCertEmailResolver() {
}
/**
- * returns an email address by using the resolver keys. The
- * return value can possibly be null
+ * returns an email address by using the resolver keys. The return value can
+ * possibly be null
+ *
* @param keys list of keys used for resolving the email address
*/
- public String getEmail(IEmailResolverKeys keys)
- throws EBaseException, ENotificationException {
+ public String getEmail(IEmailResolverKeys keys)
+ throws EBaseException, ENotificationException {
IRequest req = (IRequest) keys.get(KEY_REQUEST);
String mEmail = null;
@@ -84,14 +85,14 @@ public class ReqCertEmailResolver implements IEmailResolver {
if (cert != null) {
subjectDN =
(X500Name) cert.getSubjectDN();
-
+
try {
mEmail = subjectDN.getEmail();
} catch (IOException e) {
System.out.println("X500Name getEmail failed");
- throw new ENotificationException (
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- subjectDN.toString()));
+ subjectDN.toString()));
}
} else {
log(ILogger.LL_INFO, "cert null in keys");
@@ -101,31 +102,31 @@ public class ReqCertEmailResolver implements IEmailResolver {
if (mEmail == null) {
if (cert != null) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL", subjectDN.toString()));
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL", subjectDN.toString()));
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for " +
- subjectDN.toString());
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for " +
+ subjectDN.toString());
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
+ "subjectDN= " + subjectDN.toString()));
} else if (req != null) {
log(ILogger.LL_FAILURE,
- "no email resolved for request id =" +
- req.getRequestId().toString());
+ "no email resolved for request id =" +
+ req.getRequestId().toString());
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for request id =" +
- req.getRequestId().toString());
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for request id =" +
+ req.getRequestId().toString());
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "requestId= " + req.getRequestId().toString()));
+ "requestId= " + req.getRequestId().toString()));
} else {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_REQUEST"));
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_REQUEST"));
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1. No request id or cert info found");
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1. No request id or cert info found");
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- ": No request id or cert info found"));
+ ": No request id or cert info found"));
}
} else {
log(ILogger.LL_INFO, "email resolved: " + mEmail);
@@ -136,18 +137,19 @@ public class ReqCertEmailResolver implements IEmailResolver {
/**
* Returns array of required keys for this email resolver
+ *
* @return Array of required keys.
*/
-
- /* public String[] getRequiredKeys() {
- return mRequiredKeys;
- }*/
+
+ /*
+ * public String[] getRequiredKeys() { return mRequiredKeys; }
+ */
private void log(int level, String msg) {
if (mLogger == null)
return;
mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER,
- level, "ReqCertEmailResolver: " + msg);
+ level, "ReqCertEmailResolver: " + msg);
}
}
diff --git a/pki/base/common/src/com/netscape/cmscore/notification/ReqCertSANameEmailResolver.java b/pki/base/common/src/com/netscape/cmscore/notification/ReqCertSANameEmailResolver.java
index 580c9e98..52eaeefd 100644
--- a/pki/base/common/src/com/netscape/cmscore/notification/ReqCertSANameEmailResolver.java
+++ b/pki/base/common/src/com/netscape/cmscore/notification/ReqCertSANameEmailResolver.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.notification;
-
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateParsingException;
@@ -43,12 +42,12 @@ import com.netscape.certsrv.notification.IEmailResolver;
import com.netscape.certsrv.notification.IEmailResolverKeys;
import com.netscape.certsrv.request.IRequest;
-
/**
- * An email resolver that first checks the request email, if none,
- * then follows by checking the subjectDN of the certificate, if none,
- * then follows by checking the subjectalternatename extension
+ * An email resolver that first checks the request email, if none, then follows
+ * by checking the subjectDN of the certificate, if none, then follows by
+ * checking the subjectalternatename extension
* <p>
+ *
* @author cfu
* @version $Revision$, $Date$
*/
@@ -59,18 +58,19 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
public static final String KEY_CERT = IEmailResolverKeys.KEY_CERT;
// required keys for this resolver to figure out the email address
- // protected static String[] mRequiredKeys = {KEY_REQUEST, KEY_CERT};
+ // protected static String[] mRequiredKeys = {KEY_REQUEST, KEY_CERT};
public ReqCertSANameEmailResolver() {
}
/**
- * returns an email address by using the resolver keys. The
- * return value can possibly be null
+ * returns an email address by using the resolver keys. The return value can
+ * possibly be null
+ *
* @param keys list of keys used for resolving the email address
*/
- public String getEmail(IEmailResolverKeys keys)
- throws EBaseException, ENotificationException {
+ public String getEmail(IEmailResolverKeys keys)
+ throws EBaseException, ENotificationException {
IRequest req = (IRequest) keys.get(KEY_REQUEST);
String mEmail = null;
@@ -102,30 +102,30 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
ICertificateRepository certDB = ca.getCertificateRepository();
cert = certDB.getX509Certificate(revCert.getSerialNumber());
- }else
+ } else
cert = (X509Certificate) request;
-
+
X500Name subjectDN = null;
if (cert != null) {
subjectDN =
(X500Name) cert.getSubjectDN();
-
+
try {
mEmail = subjectDN.getEmail();
if (mEmail != null) {
if (!mEmail.equals("")) {
log(ILogger.LL_INFO, "cert subjectDN E=" +
- mEmail);
+ mEmail);
}
} else {
log(ILogger.LL_INFO, "no E component in subjectDN ");
}
} catch (IOException e) {
System.out.println("X500Name getEmail failed");
- throw new ENotificationException (
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- subjectDN.toString()));
+ subjectDN.toString()));
}
// try subjectalternatename
@@ -136,13 +136,13 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
try {
certInfo = (X509CertInfo)
((X509CertImpl) cert).get(
- X509CertImpl.NAME + "." + X509CertImpl.INFO);
+ X509CertImpl.NAME + "." + X509CertImpl.INFO);
} catch (CertificateParsingException ex) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_CERTINFO"));
- throw new ENotificationException (
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_CERTINFO"));
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
+ "subjectDN= " + subjectDN.toString()));
}
CertificateExtensions exts;
@@ -152,47 +152,46 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
certInfo.get(CertificateExtensions.NAME);
} catch (IOException e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
- throw new ENotificationException (
+ CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
+ "subjectDN= " + subjectDN.toString()));
} catch (CertificateException e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
- throw new ENotificationException (
+ CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
+ "subjectDN= " + subjectDN.toString()));
}
if (exts != null) {
SubjectAlternativeNameExtension ext;
try {
- ext =
+ ext =
(SubjectAlternativeNameExtension)
exts.get(SubjectAlternativeNameExtension.class.getSimpleName());
} catch (IOException e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
- throw new ENotificationException (
+ CMS.getLogMessage("CMSCORE_NOTIFY_GET_EXT", e.toString()));
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
-
+ "subjectDN= " + subjectDN.toString()));
+
}
try {
if (ext != null) {
GeneralNames gn =
- (GeneralNames) ext.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
+ (GeneralNames) ext.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
Enumeration<GeneralNameInterface> e = gn.elements();
while (e.hasMoreElements()) {
- GeneralNameInterface gni =e.nextElement();
+ GeneralNameInterface gni = e.nextElement();
- if (gni.getType() ==
- GeneralNameInterface.NAME_RFC822) {
+ if (gni.getType() == GeneralNameInterface.NAME_RFC822) {
CMS.debug("got an subjectalternatename email");
String nameString = gni.toString();
@@ -201,9 +200,9 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
mEmail =
nameString.substring(nameString.indexOf(' ') + 1);
log(ILogger.LL_INFO,
- "subjectalternatename email used:" +
- mEmail);
-
+ "subjectalternatename email used:" +
+ mEmail);
+
break;
} else {
CMS.debug("not an subjectalternatename email");
@@ -212,43 +211,43 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
}
} catch (IOException e) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_SUBJECTALTNAME"));
+ CMS.getLogMessage("CMSCORE_NOTIFY_SUBJECTALTNAME"));
}
}
}
} else {
log(ILogger.LL_INFO, "cert null in keys");
}
-
+
// log it
if (mEmail == null) {
if (cert != null) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL", subjectDN.toString()));
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL", subjectDN.toString()));
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for " +
- subjectDN.toString());
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for " +
+ subjectDN.toString());
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "subjectDN= " + subjectDN.toString()));
+ "subjectDN= " + subjectDN.toString()));
} else if (req != null) {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_ID",
- req.getRequestId().toString()));
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_ID",
+ req.getRequestId().toString()));
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for request id =" +
- req.getRequestId().toString());
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1 for request id =" +
+ req.getRequestId().toString());
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- "requestId= " + req.getRequestId().toString()));
+ "requestId= " + req.getRequestId().toString()));
} else {
log(ILogger.LL_FAILURE,
- CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_REQUEST"));
+ CMS.getLogMessage("CMSCORE_NOTIFY_NO_EMAIL_REQUEST"));
CMS.debug(
- "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1. No request id or cert info found");
- throw new ENotificationException (
+ "no email resolved, throwing NotificationResources.EMAIL_RESOLVE_FAILED_1. No request id or cert info found");
+ throw new ENotificationException(
CMS.getUserMessage("CMS_NOTIFICATION_EMAIL_RESOLVE_FAILED",
- ": No request id or cert info found"));
+ ": No request id or cert info found"));
}
} else {
log(ILogger.LL_INFO, "email resolved: " + mEmail);
@@ -259,18 +258,19 @@ public class ReqCertSANameEmailResolver implements IEmailResolver {
/**
* Returns array of required keys for this email resolver
+ *
* @return Array of required keys.
*/
-
- /* public String[] getRequiredKeys() {
- return mRequiredKeys;
- }*/
+
+ /*
+ * public String[] getRequiredKeys() { return mRequiredKeys; }
+ */
private void log(int level, String msg) {
if (mLogger == null)
return;
mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER,
- level, "ReqCertSANameEmailResolver: " + msg);
+ level, "ReqCertSANameEmailResolver: " + msg);
}
}