|
![]() |
|||||||||
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
public abstract class DeliveryChannel
Field Summary | |
---|---|
protected ConfigurationService |
_confService
The configuration service |
protected StatusTicketCache |
_ticketCache
The status ticket cache |
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 | |
---|---|
DeliveryChannel(NiMKernelServiceVisa visa)
The constructor for a delivery channel takes a NiMKernelServiceVisa to make sure that only certain classes can instantiate the channel. |
Method Summary | |
---|---|
abstract 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. |
abstract java.lang.String |
deliver(NotificationMessage msg)
Starts the delivery process for this message (or places it into some sort of internal queue). |
java.util.Properties |
getConfigPropertiesByPrefix(java.lang.String confKeyPrefix)
Get all configuration specified for the channel and starts with the specified prefix. |
java.lang.String |
getConfigProperty(java.lang.String propertyKey)
Get the configuration property form the configurationi service. |
abstract java.lang.String |
getKey()
Returns the key to use when referring to this delivery method. |
abstract java.lang.String |
getProtocolPrefix()
"mailto://" -> EmailDeliveryChannel "mobile://" -> SMSDeliveryChannel etc. |
abstract IndividualStatus |
getStatus(java.lang.String ticket)
Notification service uses this method to get an updated status object before returning to the client. |
StatusTicketCache |
getTicketCache()
Get the status ticket cache object. |
void |
init(StatusTicketCache cache,
ConfigurationService conf)
Initializes the delivery channel by providing access to the status ticket cache and the configuration service. |
abstract 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. |
abstract 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StatusTicketCache _ticketCache
protected ConfigurationService _confService
Constructor Detail |
---|
public DeliveryChannel(NiMKernelServiceVisa visa)
visa
- kernel service visa objectMethod Detail |
---|
public void init(StatusTicketCache cache, ConfigurationService conf) throws InitializationFailedException
cache
- status ticket cacheconf
- configuration service
InitializationFailedException
public StatusTicketCache getTicketCache()
public abstract java.lang.String getKey()
public abstract java.lang.String getProtocolPrefix()
public abstract IndividualStatus getStatus(java.lang.String ticket) throws StatusNotFoundException
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 abstract java.lang.String deliver(NotificationMessage msg) throws NotificationServiceException
msg
- the message to be sent out
NotificationServiceException
- if the delivery channel is unable to
initiate the delivery of the messagepublic abstract boolean canDeliverTo(Member target)
target
- the Member object to which the message will be delivered
public abstract boolean validateRecipient(java.lang.String recipient)
public java.lang.String getConfigProperty(java.lang.String propertyKey)
propertyKey
- the name of the property. If the key is null,
it will return a null object.
public java.util.Properties getConfigPropertiesByPrefix(java.lang.String confKeyPrefix)
It will return a Properties object with all configurations with keys starts with the confKeyPrefix. This Properties object's key will contain the string confKeyPrefix, but it will strip out all configuration prefix for the delivery channel.
For example, if the full configuration keys for the "email" channels are:
confKeyPrefix
- The configuration key prefix to be searched for.
It is recommend to make sure the confKeyPrefix to be ended with ".".
However, even if you don't add the ".", this method will automatically
append it to the key prefix.
If the parameter is null, it will be treated as an empty string.
An empty string for this parameter will imply this method should get
all configuration specified for the channel.
public abstract boolean isStandardTicket(java.lang.String ticket)
ticket
- status ticket
|
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.