|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.publish.alerts.AlertUtil
public class AlertUtil
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 | |
---|---|
AlertUtil()
|
Method Summary | |
---|---|
static void |
notify(org.w3c.dom.Document doc,
LoggerInterface logger)
Deprecated. The Logging Service has been deprecated. Use sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService) |
static void |
notify(org.w3c.dom.Document doc,
LoggerInterface logger,
SessionContextInterface sessionContext)
Deprecated. The Logging Service has been deprecated. Use sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService) |
static void |
notify(org.w3c.dom.Document doc,
LoggerInterface logger,
SessionContextInterface sessionContext,
com.sas.svcs.mail.client.MailServiceInterface mailService)
Deprecated. The Logging Service has been deprecated. Use sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService) |
static void |
sendNotification(org.w3c.dom.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. |
Constructor Detail |
---|
public AlertUtil()
Method Detail |
---|
public static void notify(org.w3c.dom.Document doc, LoggerInterface logger) throws ServiceException
sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService)
doc
- the alert notification eventlogger
- the logger to use for logging alert notification activity
ServiceException
- if an error occurs processing the alert notification.public static void notify(org.w3c.dom.Document doc, LoggerInterface logger, SessionContextInterface sessionContext) throws ServiceException
sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService)
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.
ServiceException
- if an error occurs processing the alert
notification.public static void notify(org.w3c.dom.Document doc, LoggerInterface logger, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) throws ServiceException, java.lang.IllegalArgumentException
sendNotification(Document
doc, SessionContextInterface sessionContext, MailServiceInterface mailService)
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
ServiceException
- if an error occurs processing the alert notification.
java.lang.IllegalArgumentException
- if mailService is null
public static void sendNotification(org.w3c.dom.Document doc, SessionContextInterface sessionContext, com.sas.svcs.mail.client.MailServiceInterface mailService) throws ServiceException, java.lang.IllegalArgumentException
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
ServiceException
- if an error occurs processing the alert notification.
java.lang.IllegalArgumentException
- if mailService is null
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |