dd.api
Interface DDQuery

All Superinterfaces:
QuickSerializable
All Known Implementing Classes:
HelloWorldQuery, HelloWorldQuery, HelloWorldQuery, NullTagQuery, RepairDHTTest.Query, RepairDirectoryTest.Query, RequestDisseminationSetQuery, TriggerTester.Query

public interface DDQuery
extends QuickSerializable

The query that is passed along with a location/lookup request. The query(ostore.util.SecureHash, bamboo.vivaldi.VirtualCoordinate, ostore.util.SecureHash, dd.host.api.HostInfo, dd.api.DDTag, dd.api.DDQueryState) is executed on each object pointer. The query returns a result, and possibly modifies the passed in query_state as well. The result can be one of DDQueryResultMatch or DDQueryResultNoMatch.

When the request is a location request (i.e. location.forward==true), a matching result indicates which object pointer to follow (i.e. forward the location request to), as well as whether or not to continue routing up the tree towards the root. A non-matching result causes the query to continue towards the root without following any object pointers.

When the request is a lookup request (i.e. location.forward==false), the lookup request will be returned back to the original sender (i.e. none of the pointers will be followed). The lookup request is returned back to the original sender when either the query(ostore.util.SecureHash, bamboo.vivaldi.VirtualCoordinate, ostore.util.SecureHash, dd.host.api.HostInfo, dd.api.DDTag, dd.api.DDQueryState) result match states to DDQueryResultMatch.stop() or the lookup request reaches the root with DDQueryResultMatch.stop()==false.

Note that when DDLocateMsg.forward==true (i.e. location request) any recipient of the location request will not receive the state, but when DDLocateMsg.forward==false (i.e. lookup request) the original sender will receive the state.

Version:
$Id: DDQuery.java,v 1.3 2004/05/06 18:10:12 hweather Exp $
Author:
Sean C. Rhea
See Also:
DDLocateMsg

Method Summary
 DDQueryResult query(SecureHash node_guid, bamboo.vivaldi.VirtualCoordinate node_coordinates, SecureHash bp_guid, HostInfo bp_hinfo, DDTag tag, DDQueryState state)
          Perform the query on the given object pointer and tag, possibly modifying the supplied state.
 
Methods inherited from interface ostore.util.QuickSerializable
serialize
 

Method Detail

query

public DDQueryResult query(SecureHash node_guid,
                           bamboo.vivaldi.VirtualCoordinate node_coordinates,
                           SecureHash bp_guid,
                           HostInfo bp_hinfo,
                           DDTag tag,
                           DDQueryState state)
Perform the query on the given object pointer and tag, possibly modifying the supplied state.

Parameters:
node_guid - The guid of the current node.
node_coordinates - The VirtualCoordinate of the current node. (possibly null).
bp_guid - The guid of the node to which the object pointer points.
bp_hinfo - The HostInfo of the node to which the object pointer points. (possibly null).
tag - The object's associated tag.
state - The state, passed in and (possibly) modified
Returns:
A query result of type DDQueryResultMatch or DDQueryResultNoMatch.