|
${header} | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmeteor.dht.chord.MessageHandler
This class is responsible of handling messages between peers
It implements the QueryHandler class for processQuery and
processResponse methods.
At this time the types of Queries are:
| find_successor | To find the successor of a node id |
| predecessor | To return the predecessor of this current node |
| notify | TO notify the successor of this node that it should set its predecessor to this current node id |
| ping | Checks to see if the peer is alive |
| set_predecessor | When initializing finger tables and updating the ring, sets the predecessor |
| stabilize_others | Stabilize peers as a result of detection of a predecessor failing in the ring |
| process_squid_message | Send the squid querry to the Squid layer for processing |
| update_finger_table | Update the finger table as part of the protocol for a new node joining |
| Field Summary | |
static boolean |
QUEUEING
|
| Constructor Summary | |
MessageHandler(ChordServiceImpl l)
|
|
| Method Summary | |
java.math.BigInteger |
getID()
!!!ONLY FOR BLOCKING CALLS THe unique identifier exchanged by messages This is the response from a query returning the successor of a node ID. |
int |
getNextQID()
Generates a query ID for the resolver service |
java.math.BigInteger |
getNodeID()
This call sets the Responding Node ID, used for Predecessor |
int |
processQuery(net.jxta.protocol.ResolverQueryMsg query)
Implementing QueryHandler Resolves the queries between peers to find successor or predecessor nodes, or simply notifying a node through the Notification protocol |
void |
processResponse(net.jxta.protocol.ResolverResponseMsg response)
Process a Resolver response message. |
int |
sendQuery(java.lang.String destination,
QueryMessage queryMsg)
Send a query to a specific peer, by building a QueryMessage and using the resolver service to actually send the message |
void |
setFingerTable(FingerTable f)
Setting a pointer to the finger table instantiated in the DHTServiceImpl when it has received a Chord ID |
void |
setResolver(net.jxta.resolver.ResolverService r)
DHTservice implementation registers a handler for the resolver being this MessageHandler, it then points MessageHandler to that new resolver. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean QUEUEING
| Constructor Detail |
public MessageHandler(ChordServiceImpl l)
l - is the DHTServiceImplementation associated to this MessageHandler| Method Detail |
public void setResolver(net.jxta.resolver.ResolverService r)
public int sendQuery(java.lang.String destination,
QueryMessage queryMsg)
public int getNextQID()
public java.math.BigInteger getID()
public java.math.BigInteger getNodeID()
public void setFingerTable(FingerTable f)
public int processQuery(net.jxta.protocol.ResolverQueryMsg query)
processQuery in interface net.jxta.resolver.QueryHandlerpublic void processResponse(net.jxta.protocol.ResolverResponseMsg response)
processResponse in interface net.jxta.resolver.QueryHandlerresponse - a response message to be processed.
|
${header} | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||