org.planx.routing.kademlia.operation
Class OriginReceiver

java.lang.Object
  extended by org.planx.routing.kademlia.operation.OriginReceiver
All Implemented Interfaces:
Receiver
Direct Known Subclasses:
ConnectReceiver, DataLookupReceiver, HashReceiver, HashRequestReceiver, NodeLookupReceiver, RemoveReceiver, StoreReceiver, StoreRequestReceiver

public abstract class OriginReceiver
extends Object
implements Receiver

Handles updating of the local space when messages are received and provides easy implementation of more specific receivers.


Constructor Summary
OriginReceiver(MessageServer server, Node local, Space space)
           
 
Method Summary
 void receive(Message incoming, int comm)
          Updates the local space by inserting the origin node.
 void timeout(int comm)
          Does nothing, can be overridden by subclasses to change timeout functionality.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OriginReceiver

public OriginReceiver(MessageServer server,
                      Node local,
                      Space space)
Method Detail

receive

public void receive(Message incoming,
                    int comm)
             throws IOException
Updates the local space by inserting the origin node. Note that if the node already exists in the local space, it's time last seen is updated instead.

Specified by:
receive in interface Receiver
Throws:
IOException - if an I/O error occurs

timeout

public void timeout(int comm)
             throws IOException
Does nothing, can be overridden by subclasses to change timeout functionality.

Specified by:
timeout in interface Receiver
Throws:
IOException - if an I/O error occurs


Copyright © 2004-2005 Plan-X. All Rights Reserved.