org.planx.routing.kademlia.operation
Class NodeLookupOperation

java.lang.Object
  extended by org.planx.routing.kademlia.operation.AbstractNodeLookupOperation<List<Node>>
      extended by org.planx.routing.kademlia.operation.NodeLookupOperation
All Implemented Interfaces:
Operation<List<Node>>, Receiver

public class NodeLookupOperation
extends AbstractNodeLookupOperation<List<Node>>
implements Operation<List<Node>>, Receiver

Finds the K closest nodes to a specified identifier. The algorithm terminates when the operation has gotten responses from the K closest nodes it has seen. Nodes that fail to respond are removed from consideration.

Author:
Thomas Ambus

Constructor Summary
NodeLookupOperation(Configuration conf, MessageServer server, Space space, Node local, Identifier id)
          Create a NodeLookupOperation for the specified id.
 
Method Summary
 List<Node> execute()
          Starts the operation and returns when the operation is finished.
 
Methods inherited from class org.planx.routing.kademlia.operation.AbstractNodeLookupOperation
receive, timeout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.planx.routing.messaging.Receiver
receive, timeout
 

Constructor Detail

NodeLookupOperation

public NodeLookupOperation(Configuration conf,
                           MessageServer server,
                           Space space,
                           Node local,
                           Identifier id)
Create a NodeLookupOperation for the specified id.

Method Detail

execute

public List<Node> execute()
                   throws IOException,
                          RoutingException
Description copied from interface: Operation
Starts the operation and returns when the operation is finished.

Specified by:
execute in interface Operation<List<Node>>
Specified by:
execute in class AbstractNodeLookupOperation<List<Node>>
Returns:
A List containing the K closest nodes to the id provided in the constructor.
Throws:
RoutingException - If the lookup operation timed out
IOException - If a network error occurred


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