|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.test.dht.DHTApplication
Application that contains all key/values pairs, required for owner Node Id.
Field Summary | |
static java.lang.String |
APPLICATION_ID
|
Constructor Summary | |
DHTApplication()
Constructor |
|
DHTApplication(java.lang.String name)
Simple constructor where is specified the application identification. |
Method Summary | |
void |
byStep()
An upcall to inform this Application for a new step. |
void |
deliver(Id id,
Message message)
This method is called on the application at the destination node for the given id. |
boolean |
forward(Message 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. |
java.lang.String |
gatherStatistics()
Generate a string with a representation of keys and values existing at this application. |
java.lang.String |
getId()
Gets the identification of this instance of Application. |
void |
send(java.lang.String key)
Owner DHTApplication method which permits to send a Message with a key/value pair, for LOOKUP. |
void |
send(java.lang.String key,
java.lang.String value)
Owner DHTApplication method which permits to send a Message with a key/value pair, for INSERT. |
void |
setEndPoint(EndPoint endPoint)
Sets the actual EndPoint to use to communication with underlying network. |
void |
setId(java.lang.String appId)
Sets the identification of this instance of Application. |
void |
setNode(java.lang.String node)
Sets the identification of the node over which this instance of application is running. |
void |
update(NodeHandle node,
boolean joined)
Shows that the node has been joinded or not to the network. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String APPLICATION_ID
Constructor Detail |
public DHTApplication()
public DHTApplication(java.lang.String name)
name
- New name to set to this application.Method Detail |
public void setNode(java.lang.String node)
node
- Identification of the local node.public void byStep()
byStep
in interface Application
public boolean forward(Message 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 deliver(Id id, Message message)
deliver
in interface Application
id
- The destination id of the messagemessage
- The message being sentpublic java.lang.String gatherStatistics()
public java.lang.String getId()
getId
in interface Application
Application.getId()
public void setId(java.lang.String appId)
setId
in interface Application
appId
- New identification of this instance of Application.Application.setId(java.lang.String)
public void setEndPoint(EndPoint endPoint)
setEndPoint
in interface Application
endPoint
- EndPoint to contact that knows how talk with
underlying node.Application.setEndPoint(planet.commonapi.EndPoint)
public void send(java.lang.String key, java.lang.String value)
key
- Text to be used as material for construct Message Id, in
hexadecimal format.value
- Related value to that key.public void send(java.lang.String key)
key
- Text to be used as material for construct Message Id, in
hexadecimal format.public void update(NodeHandle node, boolean joined)
update
in interface Application
node
- Node that has been joined or leaved.joined
- If true, the node has been joinded. If false, the
node has been leaved to the network.Application.update(planet.commonapi.NodeHandle, boolean)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |