| 
 | Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--rice.p2p.scribe.ScribeImpl
| Nested Class Summary | |
|  class | ScribeImpl.TopicManagerClass which keeps track of a given topic | 
| Field Summary | |
| protected  rice.p2p.commonapi.Endpoint | endpointthis application's endpoint | 
| protected  rice.p2p.commonapi.NodeHandle | handlethe local node handle | 
| protected  java.util.logging.Logger | logthe logger which we will use | 
| static int | MESSAGE_TIMEOUTthe timeout for a subscribe message | 
| protected  rice.p2p.scribe.ScribePolicy | policythis scribe's policy | 
|  java.util.Hashtable | topicsthe hashtable of topic -> TopicManager | 
| Constructor Summary | |
| ScribeImpl(rice.p2p.commonapi.Node node,
           rice.p2p.scribe.ScribePolicy policy,
           java.lang.String instance)Constructor for Scribe | |
| ScribeImpl(rice.p2p.commonapi.Node node,
           java.lang.String instance)Constructor for Scribe, using the default policy. | |
| Method Summary | |
|  void | addChild(rice.p2p.scribe.Topic topic,
         rice.p2p.commonapi.NodeHandle child)Adds a child to the given topic | 
|  void | anycast(rice.p2p.scribe.Topic topic,
        rice.p2p.scribe.ScribeContent content)Anycasts the given content to a member of the given topic | 
|  void | deliver(rice.p2p.commonapi.Id id,
        rice.p2p.commonapi.Message message)This method is called on the application at the destination node for the given id. | 
|  boolean | forward(rice.p2p.commonapi.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. | 
|  rice.p2p.commonapi.NodeHandle[] | getChildren(rice.p2p.scribe.Topic topic)Returns the list of children for a given topic | 
|  rice.p2p.scribe.ScribeClient[] | getClients(rice.p2p.scribe.Topic topic)Returns the list of clients for a given topic | 
|  rice.p2p.commonapi.Id | getId()Returns the Id of the local node | 
|  rice.p2p.commonapi.NodeHandle | getParent(rice.p2p.scribe.Topic topic)Returns the parent for a given topic | 
|  rice.p2p.scribe.ScribePolicy | getPolicy()Returns the current policy for this scribe object | 
|  boolean | isRoot(rice.p2p.scribe.Topic topic)Returns whether or not this Scribe is the root for the given topic | 
|  void | publish(rice.p2p.scribe.Topic topic,
        rice.p2p.scribe.ScribeContent content)Publishes the given message to the topic. | 
|  void | removeChild(rice.p2p.scribe.Topic topic,
            rice.p2p.commonapi.NodeHandle child)Removes a child from the given topic | 
| protected  void | removeChild(rice.p2p.scribe.Topic topic,
            rice.p2p.commonapi.NodeHandle child,
            boolean sendDrop)Removes a child from the given topic | 
|  void | setPolicy(rice.p2p.scribe.ScribePolicy policy)Sets the current policy for this scribe object | 
|  void | subscribe(rice.p2p.scribe.Topic topic,
          rice.p2p.scribe.ScribeClient client)Subscribes the given client to the provided topic. | 
|  void | subscribe(rice.p2p.scribe.Topic topic,
          rice.p2p.scribe.ScribeClient client,
          rice.p2p.scribe.ScribeContent content)Subscribes the given client to the provided topic. | 
|  void | unsubscribe(rice.p2p.scribe.Topic topic,
            rice.p2p.scribe.ScribeClient client)Unsubscribes the given client from the provided topic. | 
|  void | update(rice.p2p.commonapi.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, toString, wait, wait, wait | 
| Field Detail | 
public static int MESSAGE_TIMEOUT
public java.util.Hashtable topics
protected rice.p2p.scribe.ScribePolicy policy
protected rice.p2p.commonapi.Endpoint endpoint
protected java.util.logging.Logger log
protected rice.p2p.commonapi.NodeHandle handle
| Constructor Detail | 
public ScribeImpl(rice.p2p.commonapi.Node node,
                  java.lang.String instance)
node - The node below this Scribe implementationinstance - The unique instance name of this Scribe
public ScribeImpl(rice.p2p.commonapi.Node node,
                  rice.p2p.scribe.ScribePolicy policy,
                  java.lang.String instance)
node - The node below this Scribe implementationpolicy - The policy for this Scribeinstance - The unique instance name of this Scribe| Method Detail | 
public rice.p2p.scribe.ScribePolicy getPolicy()
getPolicy in interface Scribepublic void setPolicy(rice.p2p.scribe.ScribePolicy policy)
setPolicy in interface Scribepolicy - The current policy for this scribepublic rice.p2p.commonapi.Id getId()
public rice.p2p.scribe.ScribeClient[] getClients(rice.p2p.scribe.Topic topic)
topic - The topic to return the clients of
public rice.p2p.commonapi.NodeHandle[] getChildren(rice.p2p.scribe.Topic topic)
getChildren in interface Scribetopic - The topic to return the children of
public rice.p2p.commonapi.NodeHandle getParent(rice.p2p.scribe.Topic topic)
topic - The topic to return the parent of
public boolean isRoot(rice.p2p.scribe.Topic topic)
isRoot in interface Scribetopic - The topic in question
public void subscribe(rice.p2p.scribe.Topic topic,
                      rice.p2p.scribe.ScribeClient client)
subscribe in interface Scribetopic - The topic to subscribe toclient - The client to give messages to
public void subscribe(rice.p2p.scribe.Topic topic,
                      rice.p2p.scribe.ScribeClient client,
                      rice.p2p.scribe.ScribeContent content)
subscribe in interface Scribetopic - The topic to subscribe toclient - The client to give messages tocontent - The content to include in the subscribe
public void unsubscribe(rice.p2p.scribe.Topic topic,
                        rice.p2p.scribe.ScribeClient client)
unsubscribe in interface Scribetopic - The topic to unsubscribe fromclient - The client to unsubscribe
public void publish(rice.p2p.scribe.Topic topic,
                    rice.p2p.scribe.ScribeContent content)
publish in interface Scribetopic - The topic to publish tocontent - The content to publish
public void anycast(rice.p2p.scribe.Topic topic,
                    rice.p2p.scribe.ScribeContent content)
anycast in interface Scribetopic - The topic to anycast tocontent - The content to anycast
public void addChild(rice.p2p.scribe.Topic topic,
                     rice.p2p.commonapi.NodeHandle child)
addChild in interface Scribetopic - The topic to add the child tochild - The child to add
public void removeChild(rice.p2p.scribe.Topic topic,
                        rice.p2p.commonapi.NodeHandle child)
removeChild in interface Scribetopic - The topic to remove the child fromchild - The child to remove
protected void removeChild(rice.p2p.scribe.Topic topic,
                           rice.p2p.commonapi.NodeHandle child,
                           boolean sendDrop)
topic - The topic to remove the child fromchild - The child to removesendDrop - Whether or not to send a drop message to the chilpublic boolean forward(rice.p2p.commonapi.RouteMessage message)
forward in interface Applicationmessage - The message being sent, containing an internal message along with a destination
      key and nodeHandle next hop.
public void deliver(rice.p2p.commonapi.Id id,
                    rice.p2p.commonapi.Message message)
deliver in interface Applicationid - The destination id of the messagemessage - The message being sent
public void update(rice.p2p.commonapi.NodeHandle handle,
                   boolean joined)
update in interface Applicationhandle - The handle that has joined/leftjoined - Whether the node has joined or left| 
 | Rice Pastry API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||