org.planx.routing.kademlia.operation
Class DataLookupOperation
java.lang.Object
org.planx.routing.kademlia.operation.AbstractNodeLookupOperation<Serializable>
org.planx.routing.kademlia.operation.DataLookupOperation
- All Implemented Interfaces:
- Operation<Serializable>, Receiver
public class DataLookupOperation
- extends AbstractNodeLookupOperation<Serializable>
- implements Operation<Serializable>, Receiver
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.
|
Method Summary |
Serializable |
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 interface org.planx.routing.messaging.Receiver |
timeout |
DataLookupOperation
public DataLookupOperation(Configuration conf,
MessageServer server,
Space space,
Node local,
Identifier id)
execute
public Serializable 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<Serializable>- Specified by:
execute in class AbstractNodeLookupOperation<Serializable>
- 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 AbstractNodeLookupOperation<Serializable>
- Throws:
IOException - if an I/O error occurs
Copyright © 2004-2005 Plan-X. All Rights Reserved.