|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectplanet.test.helloworld.DHTApplication
This application only make two tasks: send a "Hello World" message and receive it.
| Field Summary | |
static java.lang.String |
applicationId
Identification of the application. |
| Constructor Summary | |
DHTApplication()
Constructor |
|
DHTApplication(java.lang.String name)
Builds a new application with the specified name as application id. |
|
| 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 |
getId()
Gets the identification of the Application |
Message |
makeTestMessage(java.lang.String data)
Build a new DHTPeerTestMessage with the specified data. |
void |
send(java.lang.String textKey,
DHTPeerTestMessage mess)
This method permits to send a message with the specified key textKey |
void |
setEndPoint(EndPoint ep)
Sets the underlying EndPoint for interact with the Node, for sending and receiving messages. |
void |
setId(java.lang.String appId)
Sets the identification of the Application |
Application |
setValues(java.lang.String applicationName)
Sets the name for this applicaton. |
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 java.lang.String applicationId
| Constructor Detail |
public DHTApplication()
public DHTApplication(java.lang.String name)
name - New name of the application.| Method Detail |
public void byStep()
byStep in interface Applicationpublic Message makeTestMessage(java.lang.String data)
data - Data to be sent with the new message.
public void setEndPoint(EndPoint ep)
setEndPoint in interface Applicationep - EndPoint to interact.public boolean forward(Message message)
forward in interface Applicationmessage - Application Message to test if is forwarding or not.
public void deliver(Id id,
Message message)
deliver in interface Applicationid - The destination id of the messagemessage - The message being sentpublic java.lang.String getId()
getId in interface ApplicationApplication.getId()public void setId(java.lang.String appId)
setId in interface ApplicationappId - New String identification of this application.Application.setId(java.lang.String)
public void send(java.lang.String textKey,
DHTPeerTestMessage mess)
textKey - The String to use as key of the message.mess - Message to be sent.
public void update(NodeHandle node,
boolean joined)
update in interface Applicationnode - 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)public Application setValues(java.lang.String applicationName)
setValues in interface ApplicationapplicationName - Name for this application.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||