|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.post.PostImpl
public class PostImpl
This class is the service layer which allows Post applications to use Post functionality.
Field Summary | |
---|---|
protected PostEntityAddress |
address
The address of the local user. |
static int |
BACKUP_INTERVAL
The interval between log refreshes |
protected Endpoint |
endpoint
The endpoint used for routing messages |
protected Environment |
environment
The Environment. |
protected java.lang.String |
instance
The instance. |
protected Logger |
logger
|
static int |
REPLICATION_FACTOR
The replication factor to use for replicating delivery messages |
protected Scribe |
scribe
The local Scribe service to use for notification. |
static int |
SYNCHRONIZE_WAIT
|
Constructor Summary | |
---|---|
PostImpl(Node node,
Past immutablePast,
Past mutablePast,
DeliveryPast deliveryPast,
Past deliveredPast,
PostEntityAddress address,
java.security.KeyPair keyPair,
PostCertificate certificate,
java.security.PublicKey caPublicKey,
java.lang.String instance,
boolean logRewrite,
boolean announce,
PostEntityAddress previousAddress,
long synchronizeInterval,
long refreshInterval,
long timeoutInterval)
Builds a PostImpl to run on the given pastry node, using the provided PAST and Scribe services. |
Method Summary | |
---|---|
void |
addClient(PostClient client)
Registers a client with this Post |
void |
announcePresence()
This method announce's our presence via our scribe tree |
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 |
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 |
createPostLog(Continuation command)
Internal method which builds a new PostLog for the log user. |
void |
deliver(Id id,
Message message)
The method by which Pastry passes a message up to POST |
void |
deliver(Topic topic,
ScribeContent content)
Method by which Scribe delivers a message to this client. |
boolean |
forward(RouteMessage message)
This method is invoked on applications when the underlying node is about to forward the given message with the provided target to the specified next hop. |
void |
getAndVerifyPostLog(Continuation command)
Shortcut which returns the PostLog of the local user. |
java.security.PublicKey |
getCAPublicKey()
Returns the certificate authority's public key. |
Endpoint |
getEndpoint()
|
PostEntityAddress |
getEntityAddress()
Returns the PostEntityAddress of this Post's local user. |
Environment |
getEnvironment()
Get the rice.environment.Environment. |
java.lang.String |
getInstance()
|
void |
getPostLog(Continuation command)
Shortcut which returns the PostLog of the local user. |
void |
getPostLog(PostEntityAddress entity,
Continuation command)
Returns and verifies the PostLog of the named entity |
StorageService |
getStorageService()
This method returns the local storage service. |
void |
joinGroup(PostGroupAddress address,
byte[] key)
This method causes the local POST service to subscribe to the specified address, and use the specified shared key in order to decrypt messages. |
void |
removeClient(PostClient client)
Removes a client from this PostService. |
void |
sendGroup(NotificationMessage message,
Continuation command)
This method multicasts the provided notification message to the destination group. |
void |
sendNotification(NotificationMessage message,
Continuation command)
Sends a notification message with destination specified by the members of the NotificationMessage. |
void |
sendNotificationDirect(NodeHandle handle,
NotificationMessage message,
Continuation command)
Sends a notification message with destination specified by the members of the NotificationMessage. |
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. |
java.lang.String |
toString()
|
void |
update(NodeHandle handle,
boolean joined)
This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int REPLICATION_FACTOR
public static int BACKUP_INTERVAL
public static int SYNCHRONIZE_WAIT
protected Endpoint endpoint
protected Scribe scribe
protected PostEntityAddress address
protected Environment environment
protected Logger logger
protected final java.lang.String instance
Constructor Detail |
---|
public PostImpl(Node node, Past immutablePast, Past mutablePast, DeliveryPast deliveryPast, Past deliveredPast, PostEntityAddress address, java.security.KeyPair keyPair, PostCertificate certificate, java.security.PublicKey caPublicKey, java.lang.String instance, boolean logRewrite, boolean announce, PostEntityAddress previousAddress, long synchronizeInterval, long refreshInterval, long timeoutInterval) throws PostException
node
- The Pastry node to run on.past
- The PAST service running on this Pastry node.address
- The address of the user in the systemkeyPair
- The KeyPair of this usercertificate
- The certificate authenticating this usercaPublicKey
- The public key of the certificate authorityinstance
- The unique instance name of this POST
PostException
- if the PostLog could not be accessedMethod Detail |
---|
public Endpoint getEndpoint()
public PostEntityAddress getEntityAddress()
Post
getEntityAddress
in interface Post
public java.security.PublicKey getCAPublicKey()
Post
getCAPublicKey
in interface Post
public void deliver(Id id, Message message)
deliver
in interface Application
message
- The message which has arrivedid
- The destination id of the messagepublic boolean forward(RouteMessage message)
forward
in interface Application
message
- The message being sent, containing an internal message
along with a destination key and nodeHandle next hop.
public void update(NodeHandle handle, boolean joined)
update
in interface Application
handle
- The handle that has joined/leftjoined
- Whether the node has joined or leftpublic 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 onpublic void createPostLog(Continuation command)
command
- The command to call once donepublic void getAndVerifyPostLog(Continuation command)
Post
getAndVerifyPostLog
in interface Post
public void getPostLog(Continuation command)
Post
getPostLog
in interface Post
public void getPostLog(PostEntityAddress entity, Continuation command)
Post
getPostLog
in interface Post
public StorageService getStorageService()
getStorageService
in interface Post
public void addClient(PostClient client)
addClient
in interface Post
client
- The client to addpublic void announcePresence()
announcePresence
in interface Post
public void removeClient(PostClient client)
removeClient
in interface Post
client
- The client to removepublic void sendNotification(NotificationMessage message, Continuation command)
sendNotification
in interface Post
message
- The notification message to be sent. Destination parameters
are encapsulated inside the message object.command
- The command to run once the operation is completepublic void sendNotificationDirect(NodeHandle handle, NotificationMessage message, Continuation command)
sendNotificationDirect
in interface Post
message
- The notification message to be sent. Destination parameters
are encapsulated inside the message object.command
- The command to run once the operation is completepublic void joinGroup(PostGroupAddress address, byte[] key)
joinGroup
in interface Post
address
- The address to joinkey
- The shared key to use (or null, if unencrypted)public void sendGroup(NotificationMessage message, Continuation command)
sendGroup
in interface Post
message
- The message to sendcommand
- The command to execute once donepublic java.lang.String toString()
toString
in class java.lang.Object
public Environment getEnvironment()
Post
getEnvironment
in interface Post
public java.lang.String getInstance()
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |