org.planx.xmlstore.routing.operation
Class ConnectOperation

java.lang.Object
  extended by org.planx.xmlstore.routing.operation.Operation
      extended by org.planx.xmlstore.routing.operation.ConnectOperation
All Implemented Interfaces:
Receiver

public class ConnectOperation
extends Operation
implements Receiver

Connects to an existing Kademlia network using a bootstrap node.


Constructor Summary
ConnectOperation(Configuration conf, MessageServer server, Space space, Node local, InetAddress bootstrap, int bootPort)
           
 
Method Summary
 Object execute()
          Starts the operation and returns when the operation is finished.
 void receive(Message incoming, int comm)
          Receives an AcknowledgeMessage from the boot strap node.
 void timeout(int comm)
          Resends a ConnectMessage to the boot strap node a maximum of MAX_ATTEMPTS times.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectOperation

public ConnectOperation(Configuration conf,
                        MessageServer server,
                        Space space,
                        Node local,
                        InetAddress bootstrap,
                        int bootPort)
Method Detail

execute

public Object execute()
               throws IOException,
                      RoutingException
Description copied from class: Operation
Starts the operation and returns when the operation is finished.

Specified by:
execute in class Operation
Returns:
null
Throws:
IOException - if a network error occurred
RoutingException - if the bootstrap node did not respond

receive

public void receive(Message incoming,
                    int comm)
             throws IOException
Receives an AcknowledgeMessage from the boot strap node.

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

timeout

public void timeout(int comm)
             throws IOException
Resends a ConnectMessage to the boot strap node a maximum of MAX_ATTEMPTS times.

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


Copyright © 2010. All Rights Reserved.