|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rice.pastry.PastryNode
A Pastry node is single entity in the pastry network.
Field Summary | |
protected java.util.Vector |
apps
|
protected rice.pastry.NodeHandle |
localhandle
|
protected rice.pastry.NodeId |
myNodeId
|
Constructor Summary | |
protected |
PastryNode(rice.pastry.NodeId id)
Constructor, with NodeId. |
Method Summary | |
void |
addLeafSetObserver(java.util.Observer o)
Add a leaf set observer to the Pastry node. |
void |
addRouteSetObserver(java.util.Observer o)
Add a route set observer to the Pastry node. |
void |
deleteLeafSetObserver(java.util.Observer o)
Delete a leaf set observer from the Pastry node. |
void |
deleteRouteSetObserver(java.util.Observer o)
Delete a route set observer from the Pastry node. |
rice.p2p.commonapi.Id |
getId()
Returns the Id of this node |
rice.p2p.commonapi.IdFactory |
getIdFactory()
Returns a factory for Ids specific to this node's protocol. |
rice.pastry.leafset.LeafSet |
getLeafSet()
|
rice.pastry.NodeHandle |
getLocalHandle()
|
rice.pastry.messaging.MessageDispatch |
getMessageDispatch()
FOR TESTING ONLY - DO NOT USE! |
rice.pastry.NodeId |
getNodeId()
|
rice.pastry.routing.RoutingTable |
getRoutingTable()
|
abstract void |
initiateJoin(rice.pastry.NodeHandle bootstrap)
Overridden by derived classes to initiate the join process |
boolean |
isClosest(rice.pastry.NodeId key)
Called by the layered Pastry application to check if the local pastry node is the one that is currently closest to the object key id. |
boolean |
isReady()
|
abstract void |
nodeIsReady()
Overridden by derived classes, and invoked when the node has joined successfully. |
void |
receiveMessage(rice.pastry.messaging.Message msg)
message receiver interface. |
void |
registerApp(rice.pastry.client.PastryAppl app)
Registers an application with this pastry node. |
rice.p2p.commonapi.Endpoint |
registerApplication(rice.p2p.commonapi.Application application,
java.lang.String instance)
This returns a VirtualizedNode specific to the given application and instance name to the application, which the application can then use in order to send an receive messages. |
void |
registerReceiver(rice.pastry.security.Credentials cred,
rice.pastry.messaging.Address address,
rice.pastry.messaging.MessageReceiver receiver)
Registers a message receiver with this Pastry node. |
abstract rice.pastry.ScheduledMessage |
scheduleMsg(rice.pastry.messaging.Message msg,
long delay)
Schedule the specified message to be sent to the local node after a specified delay. |
abstract rice.pastry.ScheduledMessage |
scheduleMsg(rice.pastry.messaging.Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-delay delivery to the local node, beginning after the specified delay. |
abstract rice.pastry.ScheduledMessage |
scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg,
long delay,
long period)
Schedule the specified message for repeated fixed-rate delivery to the local node, beginning after the specified delay. |
void |
setElements(rice.pastry.NodeHandle lh,
rice.pastry.security.PastrySecurityManager sm,
rice.pastry.messaging.MessageDispatch md,
rice.pastry.leafset.LeafSet ls,
rice.pastry.routing.RoutingTable rt)
Combined accessor method for various members of PastryNode. |
void |
setMessageDispatch(rice.pastry.messaging.MessageDispatch md)
|
void |
setReady()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected rice.pastry.NodeId myNodeId
protected rice.pastry.NodeHandle localhandle
protected java.util.Vector apps
Constructor Detail |
protected PastryNode(rice.pastry.NodeId id)
Method Detail |
public void setElements(rice.pastry.NodeHandle lh, rice.pastry.security.PastrySecurityManager sm, rice.pastry.messaging.MessageDispatch md, rice.pastry.leafset.LeafSet ls, rice.pastry.routing.RoutingTable rt)
lh
- Node handle corresponding to this node.sm
- Security manager.md
- Message dispatcher.ls
- Leaf set.rt
- Routing table.public rice.pastry.NodeHandle getLocalHandle()
public rice.pastry.NodeId getNodeId()
public boolean isReady()
public rice.pastry.messaging.MessageDispatch getMessageDispatch()
public void setMessageDispatch(rice.pastry.messaging.MessageDispatch md)
public abstract void nodeIsReady()
public abstract void initiateJoin(rice.pastry.NodeHandle bootstrap)
bootstrap
- Node handle to bootstrap with.public void setReady()
public boolean isClosest(rice.pastry.NodeId key)
key
- the object key id
public rice.pastry.leafset.LeafSet getLeafSet()
public rice.pastry.routing.RoutingTable getRoutingTable()
public void addLeafSetObserver(java.util.Observer o)
o
- the observer.public void deleteLeafSetObserver(java.util.Observer o)
o
- the observer.public void addRouteSetObserver(java.util.Observer o)
o
- the observer.public void deleteRouteSetObserver(java.util.Observer o)
o
- the observer.public void receiveMessage(rice.pastry.messaging.Message msg)
receiveMessage
in interface MessageReceiver
msg
- the message.public void registerReceiver(rice.pastry.security.Credentials cred, rice.pastry.messaging.Address address, rice.pastry.messaging.MessageReceiver receiver)
cred
- the credentials.address
- the address that the receiver will be at.receiver
- the message receiver.public void registerApp(rice.pastry.client.PastryAppl app)
app
- the applicationpublic abstract rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay)
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be delivered
public abstract rice.pastry.ScheduledMessage scheduleMsg(rice.pastry.messaging.Message msg, long delay, long period)
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be deliveredperiod
- time in milliseconds between successive message deliveries
public abstract rice.pastry.ScheduledMessage scheduleMsgAtFixedRate(rice.pastry.messaging.Message msg, long delay, long period)
msg
- a message that will be delivered to the local node after the specified delaydelay
- time in milliseconds before message is to be deliveredperiod
- time in milliseconds between successive message deliveries
public java.lang.String toString()
toString
in class java.lang.Object
public rice.p2p.commonapi.Endpoint registerApplication(rice.p2p.commonapi.Application application, java.lang.String instance)
registerApplication
in interface Node
application
- The Applicationinstance
- An identifier for a given instance
public rice.p2p.commonapi.Id getId()
getId
in interface Node
public rice.p2p.commonapi.IdFactory getIdFactory()
getIdFactory
in interface Node
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |