|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.post.delivery.DeliveryService
public class DeliveryService
This class encapsulates the logic for the delivery of notification messages to users in the Post system.
Field Summary | |
---|---|
protected java.util.HashSet |
cache
A cache of recently-received delivery message ids |
protected Past |
delivered
The PAST service used for storing delivery receipts |
protected Environment |
environment
|
protected IdFactory |
factory
The factory used for creating ids |
protected Logger |
logger
|
protected DeliveryPast |
pending
The PAST service used for storing pending notifications |
protected PostImpl |
post
The address of the user running this storage service. |
protected Scribe |
scribe
The Scribe used for subscribing to pending groups |
protected long |
timeoutInterval
The default timeout for delivery requests and receipts |
Constructor Summary | |
---|---|
DeliveryService(PostImpl post,
DeliveryPast pending,
Past delivered,
Scribe scribe,
IdFactory factory,
long timeoutInterval)
Contructs a StorageService given a PAST to run on top of. |
Method Summary | |
---|---|
boolean |
anycast(Topic topic,
ScribeContent content)
This method is invoked when an anycast is received for a topic which this client is interested in. |
void |
check(Id id,
Continuation command)
Determines whether or not the given ENM has been delivered before |
void |
childAdded(Topic topic,
NodeHandle child)
Informs this client that a child was added to a topic in which it was interested in. |
void |
childRemoved(Topic topic,
NodeHandle child)
Informs this client that a child was removed from a topic in which it was interested in. |
void |
deliver(SignedPostMessage message,
Continuation command)
Requests delivery of the given EncryptedNotificationMessage, which internally contains the destination user. |
void |
deliver(Topic topic,
ScribeContent content)
Method by which Scribe delivers a message to this client. |
void |
delivered(SignedPostMessage message,
Id id,
byte[] signature,
Continuation command)
Records delivery of the given message to the user. |
Id |
getIdForMessage(SignedPostMessage message)
|
protected long |
getTimeout()
Internal method which returns what the timeout should be for an object inserted now. |
void |
presence(PresenceMessage message,
Continuation command)
Is called when a presence message is received. |
void |
subscribeFailed(Topic topic)
Informs the client that a subscribe on the given topic failed - the client should retry the subscribe or take appropriate action. |
void |
synchronize()
Method which periodically checks to see if we've got receipts for any outstanding messages. |
void |
undeliverable(SignedPostMessage message,
Id id,
Continuation command)
Records a message as being undeliverable, which will ensure that delivery won't be attempted again, but does not provide a receipt. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long timeoutInterval
protected PostImpl post
protected DeliveryPast pending
protected Past delivered
protected Scribe scribe
protected IdFactory factory
protected java.util.HashSet cache
protected Environment environment
protected Logger logger
Constructor Detail |
---|
public DeliveryService(PostImpl post, DeliveryPast pending, Past delivered, Scribe scribe, IdFactory factory, long timeoutInterval)
past
- The PAST service to use.credentials
- Credentials to use to store data.keyPair
- The keypair to sign/verify data withMethod Detail |
---|
protected long getTimeout()
public void deliver(SignedPostMessage message, Continuation command)
message
- The message to delivercommand
- The command to run once finishedpublic void presence(PresenceMessage message, Continuation command)
message
- The presence message that was receivedcommand
- The command to call with the message to send, if there is onepublic Id getIdForMessage(SignedPostMessage message)
public void check(Id id, Continuation command)
id
- The Id of the message in questioncommand
- The command to run once finishedpublic void delivered(SignedPostMessage message, Id id, byte[] signature, Continuation command)
message
- The message that was deliveredsignature
- The signaturecommand
- The command to run once finishedpublic void undeliverable(SignedPostMessage message, Id id, Continuation command)
message
- The message that was deliveredcommand
- The command to run once finishedpublic void synchronize()
public void deliver(Topic topic, ScribeContent content)
deliver
in interface ScribeClient
msg
- The incoming message.public boolean anycast(Topic topic, ScribeContent content)
anycast
in interface ScribeClient
topic
- The topic the message was anycasted tocontent
- The content which was anycasted
public void childAdded(Topic topic, NodeHandle child)
childAdded
in interface ScribeClient
topic
- The topic to unsubscribe fromchild
- The child that was addedpublic void childRemoved(Topic topic, NodeHandle child)
childRemoved
in interface ScribeClient
topic
- The topic to unsubscribe fromchild
- The child that was removedpublic void subscribeFailed(Topic topic)
subscribeFailed
in interface ScribeClient
topic
- The topic which the subscribe failed on
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |