org.planx.xmlstore.routing.operation
Class DataLookupOperation

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

public class DataLookupOperation
extends NodeLookupOperation

Looks up the specified identifier and returns the value associated with it. It is not checked if the data is available in the local IdentifierMap, so this should be checked before this operation is executed. The subclassing is merely for code reuse.


Field Summary
protected  Serializable value
          The found value or null if it has not been found.
 
Fields inherited from class org.planx.xmlstore.routing.operation.NodeLookupOperation
conf, error, id, local, lookupMessage, server, space
 
Constructor Summary
DataLookupOperation(Configuration conf, MessageServer server, Space space, Node local, Identifier id)
           
 
Method Summary
 Object execute()
          Starts the operation and returns when the operation is finished.
 void receive(Message incoming, int comm)
          Once a DataMessage is received the algorithm terminates.
 
Methods inherited from class org.planx.xmlstore.routing.operation.NodeLookupOperation
timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected Serializable value
The found value or null if it has not been found.

Constructor Detail

DataLookupOperation

public DataLookupOperation(Configuration conf,
                           MessageServer server,
                           Space space,
                           Node local,
                           Identifier id)
Method Detail

execute

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

Overrides:
execute in class NodeLookupOperation
Returns:
The value associated with the key or null if no mapping with the specified key could be found.
Throws:
RoutingException - If the lookup operation timed out
IOException - If a network error occurred

receive

public void receive(Message incoming,
                    int comm)
             throws IOException
Once a DataMessage is received the algorithm terminates. If a NodeReplyMessage is received the algorithm continues as by the superclass.

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


Copyright © 2010. All Rights Reserved.