|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nimx.services.notification.channels.DeliveryChannel
com.nitido.nimx.services.notification.channels.EmailDeliveryChannel
public class EmailDeliveryChannel
An implementation of the delivery channel that handles the sending of email messages.
Field Summary | |
---|---|
protected int |
_maxSMTPconnections
Property which determines the number of simultaneous SMTP connections to allow for the email delivery channel. |
protected java.util.Properties |
_smtpProperties
|
Fields inherited from class com.nitido.nimx.services.notification.channels.DeliveryChannel |
---|
_confService, _ticketCache |
Fields inherited from interface com.nitido.nimx.services.notification.NotificationConstants |
---|
CONF_KEY_CACHE_EXPIRE_TIME, CONF_KEY_CACHE_MAX_TIME, CONF_KEY_CACHE_PREFIX, CONF_KEY_CACHE_REMOVE_FINAL, CONF_KEY_CACHE_SLEEP_TIME, CONF_KEY_DELIVERY_CHANNEL_LIST_PREFIX, CONF_KEY_DELIVERY_CHANNELS_PREFIX, KEY_TRANSACTION_PREFIX, LEN_PREFIX_TOKEN, LEN_PREFIX_USER_SPACE, PREFIX_TOKEN, PREFIX_USER_SPACE, PROTOCOL_ADDRESS_SEPARATOR, TICKET_SEPARATOR |
Constructor Summary | |
---|---|
EmailDeliveryChannel(NiMKernelServiceVisa visa)
|
Method Summary | |
---|---|
boolean |
canDeliverTo(Member target)
Determines whether the member has the requied information for this delivery channel to be able to send a message to the user. |
protected javax.mail.Transport |
connectSMTP(Entity entity)
Connect to to the SMTP server with the specified settings. |
javax.mail.internet.MimeMessage |
createMessage()
Returns a new MimeMessage object from the current mail session. |
java.lang.String |
deliver(NotificationMessage msg)
Starts the delivery process for this message (or places it into some sort of internal queue). |
protected void |
disconnectSMTP(javax.mail.Transport smtp)
|
protected java.lang.String |
getActualConfigProperty(Entity entity,
java.lang.String configKey)
This method return the actual value of a setting. |
java.lang.String |
getKey()
Returns the key to use when referring to this delivery method. |
java.lang.String |
getProtocolPrefix()
"mailto://" -> EmailDeliveryChannel "mobile://" -> SMSDeliveryChannel etc. |
IndividualStatus |
getStatus(java.lang.String ticket)
Notification service uses this method to get an updated status object before returning to the client. |
void |
init(StatusTicketCache cache,
ConfigurationService conf)
Initializes the delivery channel by providing access to the status ticket cache and the configuration service. |
boolean |
isStandardTicket(java.lang.String ticket)
The implementation of the delivery channel determines whether the given status ticket belongs to its set of standard tickets that do not require storage in the status cache. |
protected void |
loadProperties()
Loads configuratioin properties. |
protected void |
sendMessage(Entity entity,
javax.mail.Message msg,
javax.mail.Address[] addr)
Sends the message by opening a new new SMTP connection and using its sendMessage() method. |
boolean |
validateRecipient(java.lang.String recipient)
Determines whether the recipient string is a valid address/phone etc that this delivery channel can use. |
Methods inherited from class com.nitido.nimx.services.notification.channels.DeliveryChannel |
---|
getConfigPropertiesByPrefix, getConfigProperty, getTicketCache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int _maxSMTPconnections
protected transient java.util.Properties _smtpProperties
Constructor Detail |
---|
public EmailDeliveryChannel(NiMKernelServiceVisa visa)
Method Detail |
---|
public void init(StatusTicketCache cache, ConfigurationService conf) throws InitializationFailedException
DeliveryChannel
init
in class DeliveryChannel
cache
- status ticket cacheconf
- configuration service
InitializationFailedException
protected void loadProperties() throws InitializationFailedException
InitializationFailedException
public boolean canDeliverTo(Member target)
DeliveryChannel
canDeliverTo
in class DeliveryChannel
target
- the Member object to which the message will be delivered
public java.lang.String deliver(NotificationMessage msg) throws NotificationServiceException
DeliveryChannel
deliver
in class DeliveryChannel
msg
- the message to be sent out
NotificationServiceException
- if the delivery channel is unable to
initiate the delivery of the messagepublic java.lang.String getKey()
DeliveryChannel
getKey
in class DeliveryChannel
public java.lang.String getProtocolPrefix()
DeliveryChannel
getProtocolPrefix
in class DeliveryChannel
public boolean isStandardTicket(java.lang.String ticket)
DeliveryChannel
isStandardTicket
in class DeliveryChannel
ticket
- status ticket
public IndividualStatus getStatus(java.lang.String ticket) throws StatusNotFoundException
DeliveryChannel
getStatus
in class DeliveryChannel
ticket
- the status ticket that is being requested from the channel
StatusNotFoundException
- thrown if the delivery channel could not
find a status object for the given ticketpublic javax.mail.internet.MimeMessage createMessage()
protected void sendMessage(Entity entity, javax.mail.Message msg, javax.mail.Address[] addr) throws javax.mail.MessagingException, NotificationServiceException, javax.mail.SendFailedException
entity
- the entity on whose behalf the message is being sent outmsg
- the message to sendaddr
- the array of emails that this message is being sent to
javax.mail.MessagingException
- if there is an exception in sending out the
message
javax.mail.SendFailedException
- if there is an exception in sending out the
message
NotificationServiceException
- if there is an exception in
obtaining an SMTP connection (either the max number of allowed connections
has been reached or there is an error connecting to the server)protected javax.mail.Transport connectSMTP(Entity entity) throws NotificationServiceException
NotificationServiceException
protected void disconnectSMTP(javax.mail.Transport smtp)
public boolean validateRecipient(java.lang.String recipient)
DeliveryChannel
validateRecipient
in class DeliveryChannel
protected java.lang.String getActualConfigProperty(Entity entity, java.lang.String configKey) throws NotificationServiceException
NotificationServiceException
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.