diff options
author | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
commit | 171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch) | |
tree | 1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/common/src/com/netscape/cms/notification/MailNotification.java | |
parent | adad2fcee8a29fdb82376fbce07dedb11fccc182 (diff) | |
download | pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip |
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/notification/MailNotification.java')
-rw-r--r-- | pki/base/common/src/com/netscape/cms/notification/MailNotification.java | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java index 21401eef..1e409af8 100644 --- a/pki/base/common/src/com/netscape/cms/notification/MailNotification.java +++ b/pki/base/common/src/com/netscape/cms/notification/MailNotification.java @@ -17,6 +17,7 @@ // --- END COPYRIGHT BLOCK --- package com.netscape.cms.notification; + import java.io.IOException; import java.io.PrintStream; import java.util.Vector; @@ -29,11 +30,13 @@ import com.netscape.certsrv.logging.ILogger; import com.netscape.certsrv.notification.ENotificationException; import com.netscape.certsrv.notification.IMailNotification; + /** - * This class handles mail notification via SMTP. This class uses - * <b>smtp.host</b> in the configuration for smtp host. The port default (25) is - * used. If no smtp specified, local host is used - * + * This class handles mail notification via SMTP. + * This class uses <b>smtp.host</b> in the configuration for smtp + * host. The port default (25) is used. If no smtp specified, local + * host is used + * * @version $Revision$, $Date$ */ public class MailNotification implements IMailNotification { @@ -52,9 +55,11 @@ public class MailNotification implements IMailNotification { public MailNotification() { if (mHost == null) { try { - IConfigStore mConfig = CMS.getConfigStore(); + IConfigStore mConfig = + CMS.getConfigStore(); - IConfigStore c = mConfig.getSubStore(PROP_SMTP_SUBSTORE); + IConfigStore c = + mConfig.getSubStore(PROP_SMTP_SUBSTORE); if (c == null) { return; @@ -62,10 +67,10 @@ public class MailNotification implements IMailNotification { mHost = c.getString(PROP_HOST); // log it - // if (mHost !=null) { - // String msg =" using external SMTP host: "+mHost; - // CMS.debug("MailNotification: " + msg); - // } + // if (mHost !=null) { + // String msg =" using external SMTP host: "+mHost; + // CMS.debug("MailNotification: " + msg); + //} } catch (Exception e) { // don't care } @@ -89,7 +94,7 @@ public class MailNotification implements IMailNotification { if ((mFrom != null) && (!mFrom.equals(""))) sc.from(mFrom); else { - throw new ENotificationException( + throw new ENotificationException ( CMS.getUserMessage("CMS_NOTIFICATION_NO_SMTP_SENDER")); } @@ -98,7 +103,7 @@ public class MailNotification implements IMailNotification { log(ILogger.LL_INFO, "mail to be sent to " + mTo); sc.to(mTo); } else { - throw new ENotificationException( + throw new ENotificationException ( CMS.getUserMessage("CMS_NOTIFICATION_NO_SMTP_RECEIVER")); } @@ -123,16 +128,14 @@ public class MailNotification implements IMailNotification { try { sc.closeServer(); } catch (IOException e) { - log(ILogger.LL_FAILURE, - CMS.getLogMessage("OPERATION_ERROR", e.toString())); - throw new ENotificationException(CMS.getUserMessage( - "CMS_NOTIFICATION_SMTP_SEND_FAILED", mTo)); + log(ILogger.LL_FAILURE, CMS.getLogMessage("OPERATION_ERROR", e.toString())); + throw new ENotificationException ( + CMS.getUserMessage("CMS_NOTIFICATION_SMTP_SEND_FAILED", mTo)); } } /** * sets the "From" field - * * @param from email address of the sender */ public void setFrom(String from) { @@ -141,7 +144,6 @@ public class MailNotification implements IMailNotification { /** * sets the "Subject" field - * * @param subject subject of the email */ public void setSubject(String subject) { @@ -150,7 +152,6 @@ public class MailNotification implements IMailNotification { /** * sets the "Content-Type" field - * * @param contentType content type of the email */ public void setContentType(String contentType) { @@ -159,7 +160,6 @@ public class MailNotification implements IMailNotification { /** * sets the content of the email - * * @param content the message content */ public void setContent(String content) { @@ -168,7 +168,6 @@ public class MailNotification implements IMailNotification { /** * sets the recipients' email addresses - * * @param addresses a list of email addresses of the recipients */ public void setTo(Vector addresses) { @@ -178,7 +177,6 @@ public class MailNotification implements IMailNotification { /** * sets the recipient's email address - * * @param to address of the recipient email address */ public void setTo(String to) { @@ -188,8 +186,8 @@ public class MailNotification implements IMailNotification { private void log(int level, String msg) { if (mLogger == null) return; - mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER, level, - "MailNotification: " + msg); + mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_OTHER, + level, "MailNotification: " + msg); } } |