ePOST API

rice.post
Interface Post

All Known Implementing Classes:
PostImpl

public interface Post

This interface represents the Post service layer.

Version:
$Id: Post.java 2829 2005-12-02 17:50:22Z jstewart $
Author:
Ansley Post, Alan Mislove

Method Summary
 void addClient(PostClient client)
          Registers a client with this Post
 void announcePresence()
          This method announce's the local user's presence via the scribe tree
 void getAndVerifyPostLog(Continuation command)
          Shortcut which returns the PostLog of the local user.
 java.security.PublicKey getCAPublicKey()
          Returns the certificate authority's public key.
 PostEntityAddress getEntityAddress()
          Returns the PostEntityAddress of this Post's local user.
 Environment getEnvironment()
          Get the rice.environment.Environment.
 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.
 

Method Detail

getEntityAddress

PostEntityAddress getEntityAddress()
Returns the PostEntityAddress of this Post's local user.

Returns:
The PostEntityAddress of the local user.

getCAPublicKey

java.security.PublicKey getCAPublicKey()
Returns the certificate authority's public key.

Returns:
The CA's public key

getPostLog

void getPostLog(Continuation command)
Shortcut which returns the PostLog of the local user.


getAndVerifyPostLog

void getAndVerifyPostLog(Continuation command)
Shortcut which returns the PostLog of the local user. This version also verifies all replicas for safety


getPostLog

void getPostLog(PostEntityAddress entity,
                Continuation command)
Returns and verifies the PostLog of the named entity


getStorageService

StorageService getStorageService()
This method returns the local storage service.

Returns:
The storage service.

addClient

void addClient(PostClient client)
Registers a client with this Post

Parameters:
client - The client to add

removeClient

void removeClient(PostClient client)
Removes a client from this PostService.

Parameters:
client - The client to remove

announcePresence

void announcePresence()
This method announce's the local user's presence via the scribe tree


sendNotification

void sendNotification(NotificationMessage message,
                      Continuation command)
Sends a notification message with destination specified by the members of the NotificationMessage. Destination parameters include a PostEntityAddress which specifies the group or user to which the notification should go, and a PostClientAddress which specifies the user application to which the notification should go. The NotificationMessage sent is signed by the sender and is then encrypted with the public key of each recipient. In this method, the notification is sent indirectly, through a group of random nodes who subscribe to the recipient's scribe group.

Parameters:
message - The notification message to be sent. Destination parameters are encapsulated inside the message object.
command - The command to execute once done

sendNotificationDirect

void sendNotificationDirect(NodeHandle handle,
                            NotificationMessage message,
                            Continuation command)
Sends a notification message with destination specified by the members of the NotificationMessage. Destination parameters include a PostEntityAddress which specifies the group or user to which the notification should go, and a PostClientAddress which specifies the user application to which the notification should go. The NotificationMessage sent is signed by the sender and is then encrypted with the public key of each recipient. In this method, the notification message is sent directly to the provided node handle, instead of through a group of random nodes via the Scribe tree.

Parameters:
message - The notification message to be sent. Destination parameters are encapsulated inside the message object.
command - The command to execute once done

joinGroup

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. If the key is null, then messages are assumed to be unencrypted. Incoming messages, once verified, will be passed up to the appropriate applciation through the notificationReceived() method.

Parameters:
address - The address to join
key - The shared key to use (or null, if unencrypted)

sendGroup

void sendGroup(NotificationMessage message,
               Continuation command)
This method multicasts the provided notification message to the destination group. However, this local node *MUST* have already joined this group (through the joinGroup method) in order for this to work properly.

Parameters:
message - The message to send
command - The command to execute once done

getEnvironment

Environment getEnvironment()
Get the rice.environment.Environment.

Returns:
the environment

ePOST API

Copyright © 2001-2005 - Rice Pastry.