*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.publish.alerts
Class AlertUtil
java.lang.Object
com.sas.services.publish.alerts.AlertUtil
@SASScope("ALL")
@BinaryCompatibilityOnly
public class AlertUtil
extends Object
Utility class used for sending alert notifications.
The incoming XML should have the following form:
<Notifications> optional
<Notification type="mail text/plain | mail text/html | portlet">
<To>
<EmailAddress></EmailAddress>
<Bcc></Bcc>
<SMTPHost></SMTPHost>
<SMTPPort></SMTPPort>
<SMTPSubject charset="charset"></SMTPSubject>
<SMTPFrom name="personal-name" charset="charset&guot;></SMTPFrom>
<SMTPReplyTo name="personal-name" charset="charset&guot;></SMTPReplyTo>
<SMTPUser></SMTPUser>
<SMTPPassword></SMTPPassword>
<SMTPDomain></SMTPDomain>
<Userid domain="authentication domain"></Userid>
<Attachments>
<Attachment type="dav|file|url" path="file-path"
name="filename-to-use-in-email"
domain="authentication domain"/>
<Attachment type="file|url" path="file-path"
name="filename-to-use-in-email"
domain="authentication domain"
contentType="user-specified-MIME-type"/>
<Attachment type="file|url"
path="file-path"
name="filename-to-use-in-email"
domain="authentication domain"
cid="content-ID"/>
<Attachment type="file|url"
path="file-path"
name="filename-to-use-in-email"
domain="authentication domain"
cid="content-ID"
contentType="user-specified-MIME-type"/>
</Attachments>
</To>
<Template name="name-of-template">
<Dir type="dav|file|url" path="path-to-file"
domain="authentication domain"/>
<MergeVariables>
<Variable name="name-of-substitution-variable"></Variable>
...
<Variable name="name-of-substitution-variable"></Variable>
</MergeVariables>
</Template>
</Notification>
</Notifications>
|
Explanations of the elements are in the following table:
| Element | Description |
| Notifications | This is an optional element but should be used to indicate multiple notifications within this XML specification. |
| Notification | Indicates the start of the alert notification information. One or more notification elements may be specified. Supported attributes include:
|
| To | Begins the transport specific information that will identify where to send the notification. |
| EmailAddress | Defines the email recipient of the notification. This element is only used by mail notifications. Multiple email addresses, separated by commas, may be specified. |
| Bcc | Defines the blind carbon copy recipient of the notification. This element is only used by mail notifications. |
| SMTPHost | Defines the SMTP server to connect to. This element is only used by mail notifications. |
| SMTPPort | Defines the port of the SMTP server. This element is only used by mail notifications. |
| SMTPSubject | Defines the subject of the email message. This element is only used by mail notifications.
Supported (optional) attributes include:
|
| SMTPFrom | Defines the FROM field of the email message. This element is only used by mail notifications.
Supported (optional) attributes include:
|
| SMTPReplyTo | Defines the ReplyTo field of the email message. This element is only used by mail notifications.
Supported (optional) attributes include:
|
| SMTPUser | Defines the username to use when binding to the SMTP server. This element is only used by mail notifications. |
| SMTPPassword | Defines the password to use when binding to the SMTP server. This element is only used by mail notifications. |
| SMTPDomain | Defines the authentication domain to use when binding to the SMTP server. This element is only used by mail notifications. If the SMTPUser and SMTPPassword elements are specified, they will be used when binding to the SMTP server. If they are NOT specified, this authentication domain will be used to determine the credentials when binding to the SMTP server. |
| Userid | The WebDAV userid. This element is only used by
portlet notifications. Portlet notifications will be sent to the
personal repository (inbox) of the specified userid. Format should be
userid, domain\\userid or user@domain.
Supported attributes include:
|
| Attachments | Begins the attachment definition. This is an optional element that is only used by mail notifications. This should only be specified if there are attachments to be included in the message. |
| Attachment | Indicates attachments to include with the mail message.
Supported attributes include:
|
| Template | Begins the template definition.
The template is a file that enables a site to customize
the contents of an alert notification. The templates can
contain variables that will be substituted with the corresponding
merge variable values. View
com.sas.services.publish.alerts.TemplateInterface
for more general information
on how the template is used. Supported attributes include:
|
| Dir | Defines how to access the template file. Supported attributes include:
|
| MergeVariables | Defines the start of the merge variable definitions. The specified template can contain variables that will be substituted with the corresponding merge variable values. |
| Variable | Defines a merge variable for this template. Supported
attributes include:
|
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidnotify(Document doc, org.apache.logging.log4j.Logger logger) Deprecated.The Logging Service has been deprecated.static voidnotify(Document doc, org.apache.logging.log4j.Logger logger, SessionContextInterface sessionContext) Deprecated.The Logging Service has been deprecated.static voidnotify(Document doc, org.apache.logging.log4j.Logger logger, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) Deprecated.The Logging Service has been deprecated.static voidsendNotification(Document doc, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) Parses the notification XML and sends the alert notifications to the specified destinations via the WIP's Mail Service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AlertUtil
public AlertUtil()
-
-
Method Details
-
notify
public static void notify(Document doc, org.apache.logging.log4j.Logger logger) throws ServiceException Deprecated.The Logging Service has been deprecated. UsesendNotification(Document doc, SessionContextInterface sessionContext, MailServiceInterface mailService)Parses the notification XML and sends the alert notifications to the specified destinations.- Parameters:
doc- the alert notification eventlogger- the logger to use for logging alert notification activity- Throws:
ServiceException- if an error occurs processing the alert notification.
-
notify
public static void notify(Document doc, org.apache.logging.log4j.Logger logger, SessionContextInterface sessionContext) throws ServiceException Deprecated.The Logging Service has been deprecated. UsesendNotification(Document doc, SessionContextInterface sessionContext, MailServiceInterface mailService)Parses the notification XML and sends the alert notifications to the specified destinations.- Parameters:
doc- the alert notification eventlogger- the logger to use for logging alert notification activitysessionContext- the session context. The user context (bound to the session context) is used to determine credentials when binding to various servers.- Throws:
ServiceException- if an error occurs processing the alert notification.
-
notify
public static void notify(Document doc, org.apache.logging.log4j.Logger logger, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) throws ServiceException, IllegalArgumentException Deprecated.The Logging Service has been deprecated. UsesendNotification(Document doc, SessionContextInterface sessionContext, MailServiceInterface mailService)Parses the notification XML and sends the alert notifications to the specified destinations via the WIP's Mail Service.- Parameters:
doc- the alert notification eventlogger- the logger to use for logging alert notification activitysessionContext- the session context. The user context (bound to the session context) is used to determine credentials when binding to various servers.mailService- the WIP Mail Service- Throws:
ServiceException- if an error occurs processing the alert notification.IllegalArgumentException- if mailService isnull
-
sendNotification
public static void sendNotification(Document doc, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) throws ServiceException, IllegalArgumentException Parses the notification XML and sends the alert notifications to the specified destinations via the WIP's Mail Service.- Parameters:
doc- the alert notification eventsessionContext- the session context. The user context (bound to the session context) is used to determine credentials when binding to various servers.mailService- the WIP Mail Service- Throws:
ServiceException- if an error occurs processing the alert notification.IllegalArgumentException- if mailService isnull
-