|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nimx.services.notification.StatusTicketCache
public class StatusTicketCache
This class manages the cached status objects for the notification messages. It is only accessible through the service so that there is exactly one cache in the system and the delivery channels do not have to implement their own versions. The delivery channels place and retrieve status objects, while the cache manages the cleanup process for expired status objects.
Field Summary |
---|
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 | |
---|---|
protected |
StatusTicketCache(ConfigurationService confService,
NotificationService notifyService)
Protected constructor to only allow the service to instantiate the cache. |
Method Summary | |
---|---|
java.lang.String |
addStatus(java.lang.String deliveryChanelId,
IndividualStatus status)
Add a new status object to the cache. |
java.lang.String |
addTransaction(java.util.List<java.lang.String> ticketList)
Create a new transaction record for the provided list of status IDs. |
static java.lang.String |
constructTicket(java.lang.String dc,
java.lang.String ticket,
java.lang.String recipient)
Creates a status ticket based on the delivery channel's ID, some ticket value provided by the delivery channel and the recipient. |
protected java.util.Set<java.lang.String> |
getAllTransactions()
Returns a set of all the transaction IDs currently in the cache. |
static java.lang.String |
getDeliveryChannelId(java.lang.String ticket)
Returns the delivery channel ID from the ticket string. |
IndividualStatus |
getStatus(java.lang.String ticket)
Get a status object from the cache. |
static java.lang.String |
getTicketId(java.lang.String ticket)
Returns the ticket's content from the complete ticket string. |
static java.lang.String |
getTicketRecipient(java.lang.String ticket)
Returns the recipient info encoded in the ticket. |
java.util.List<java.lang.String> |
getTransaction(java.lang.String transTicket)
Get the list of individual status IDs that make up the transaction specified by the provided transaction ID. |
void |
removeTransaction(java.lang.String transTicket)
Remove the transaction and all the status objects cached for the individual tickets that are part of this transaction. |
protected void |
signalShutdown()
Server is shutting down so we need to make sure that the clean up thread(s) are shut down. |
void |
updateStatus(java.lang.String ticket,
IndividualStatus status)
Update the status object stored in the cache for a given ticket. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected StatusTicketCache(ConfigurationService confService, NotificationService notifyService)
Method Detail |
---|
public java.lang.String addTransaction(java.util.List<java.lang.String> ticketList)
ticketList
- the list of individual status tickets which make up
this transaction
public java.util.List<java.lang.String> getTransaction(java.lang.String transTicket) throws StatusNotFoundException
transTicket
- the ID of the transaction
StatusNotFoundException
- if the transaction with the provided ID
could not be found in the cachepublic void removeTransaction(java.lang.String transTicket) throws StatusNotFoundException
transTicket
- the ticket for the transaction
StatusNotFoundException
- thrown if the transaction ticket was not
found in the cachepublic java.lang.String addStatus(java.lang.String deliveryChanelId, IndividualStatus status)
deliveryChanelId
- the delivery channel's IDstatus
- the status object to store in the cache
public void updateStatus(java.lang.String ticket, IndividualStatus status) throws StatusNotFoundException
ticket
- the ticket for which the object needs to be updatedstatus
- the new status object to store in the cache
StatusNotFoundException
- thrown if there is nothing stored in the
cache for the provided ticketpublic IndividualStatus getStatus(java.lang.String ticket) throws StatusNotFoundException
ticket
- the ticket for which the status object is to be returned
StatusNotFoundException
- thrown if there is nothing stored in the
cache for the provided ticketpublic static java.lang.String constructTicket(java.lang.String dc, java.lang.String ticket, java.lang.String recipient)
dc
- delivery channel's IDticket
- the delivery channel's internal ticket/coderecipient
- the recipient's address (including the protocol prefix)
public static java.lang.String getDeliveryChannelId(java.lang.String ticket)
ticket
- complete ticket string
public static java.lang.String getTicketId(java.lang.String ticket)
ticket
- complete ticket string
public static java.lang.String getTicketRecipient(java.lang.String ticket)
ticket
- the complete ticket string
protected java.util.Set<java.lang.String> getAllTransactions()
protected void signalShutdown()
|
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.