|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.figure8.join.services.notification.mail.MailNotifier
public class MailNotifier
This is an implementation of SubscribersNotifier
using the mail as
notification media.
Field Summary | |
---|---|
static java.lang.String |
FROM_PARAM
Name of configurable parameter denoting the From address to use in sent messages. |
protected static ParameterDefinition |
fromParam
ParameterDefinition representation of parameter denoting the From address to use. |
static java.lang.String |
HOST_PARAM
Name of configurable parameter denoting the SMTP host to use. |
protected static ParameterDefinition |
hostParam
ParameterDefinition representation of parameter denoting the SMTP host to use. |
protected static java.util.List |
parameters
List of ParameterDefinition s supported by this adapter |
static java.lang.String |
PASSWORD_PARAM
Name of configurable parameter denoting the password for connecting to SMTP host. |
protected static ParameterDefinition |
pwdParam
ParameterDefinition representation of parameter denoting the password of SMTP host. |
static java.lang.String |
USER_PARAM
Name of configurable parameter denoting the username for connecting to SMTP host. |
protected static ParameterDefinition |
userParam
ParameterDefintion representation of paramter denoting the username of SMTP host. |
Constructor Summary | |
---|---|
MailNotifier()
Creates a new instance of MailNotifier. |
Method Summary | |
---|---|
java.lang.String[] |
extractRecipients(RemoteSubscriber[] subscribers)
Extract mail addresses for subscribers to provide recipients. |
java.lang.String |
getFrom()
|
java.lang.String |
getHost()
|
ParameterDefinition[] |
getParameterDefinitions()
Get this object parameters definitions as an array |
java.util.List |
getParameterDefinitionsAsList()
Get this object parameters definitions as a list |
java.lang.String |
getPassword()
|
java.lang.String |
getUsername()
|
void |
notify(RemoteSubscriber[] subscribers,
java.lang.String title,
java.lang.String content)
Notify subscribers of mailing list defined into Join application |
void |
notify(java.lang.String[] recipients,
java.lang.String title,
java.lang.String content)
Notifier are able to notify recipients and use a title and a content within their notification messages. |
void |
setFrom(java.lang.String from)
|
void |
setHost(java.lang.String host)
|
void |
setParameter(ParameterDefinition parameter,
java.lang.String parameterValue)
Set the value of a parameter using its definitions |
void |
setParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Set the value of a parameter using its nama |
void |
setParameters(java.util.Properties parameters)
Convenient methods for setting all attributes values using a single method. |
void |
setPassword(java.lang.String password)
|
void |
setUsername(java.lang.String username)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOST_PARAM
public static final java.lang.String USER_PARAM
public static final java.lang.String PASSWORD_PARAM
public static final java.lang.String FROM_PARAM
protected static java.util.List parameters
ParameterDefinition
s supported by this adapter
protected static final ParameterDefinition hostParam
protected static final ParameterDefinition userParam
protected static final ParameterDefinition pwdParam
protected static final ParameterDefinition fromParam
Constructor Detail |
---|
public MailNotifier()
Method Detail |
---|
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- The SMTP host to use for sending messages.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- The username for connecting to SMTP host.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The password for connecting to SMTP host.public java.lang.String getFrom()
public void setFrom(java.lang.String from)
from
- The From address that appears on sent messages.public java.lang.String[] extractRecipients(RemoteSubscriber[] subscribers)
extractRecipients
in interface SubscribersNotifier
subscribers
- The subscribers to get recipients for
public void notify(RemoteSubscriber[] subscribers, java.lang.String title, java.lang.String content) throws NotificationException
notify
in interface SubscribersNotifier
subscribers
- The subscriber of mailing list to notifytitle
- The title of notification message to sendcontent
- The content of notification message to send
NotificationException
- if an exception occurs during the notification operation
(usually they are network related exceptions)public void notify(java.lang.String[] recipients, java.lang.String title, java.lang.String content) throws NotificationException
notify
in interface Notifier
recipients
- An array of recipients to noitify. Recipient is described with a Stringtitle
- The title of notification message to sendcontent
- The content of notification message to send
NotificationException
- if an exception occurs during the notification operation
(usually they are network related exceptions)public java.util.List getParameterDefinitionsAsList()
getParameterDefinitionsAsList
in interface Configurable
ParameterDefinition
objectspublic ParameterDefinition[] getParameterDefinitions()
getParameterDefinitions
in interface Configurable
ParameterDefinition
objectspublic void setParameter(java.lang.String parameterName, java.lang.String parameterValue) throws InvalidParameterException
setParameter
in interface Configurable
parameterName
- The name of parameter so set value forparameterValue
- The value of the paramater
InvalidParameterException
- if this parameter is not supported by this objectpublic void setParameter(ParameterDefinition parameter, java.lang.String parameterValue) throws InvalidParameterException
setParameter
in interface Configurable
parameter
- The definitino of the paramater to setparameterValue
- The value of the parameter
InvalidParameterException
- if this parameter is not supported by this objectpublic void setParameters(java.util.Properties parameters) throws InvalidParameterException
setParameters
in interface Configurable
parameters
- Properties where keys are parameter names
InvalidParameterException
- if one of these parameters is not supported by this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |