demo.helloworld.step3.api
Class HelloWorldQueryState

java.lang.Object
  |
  +--demo.helloworld.step3.api.HelloWorldQueryState
All Implemented Interfaces:
DDQueryState, QuickSerializable

public class HelloWorldQueryState
extends Object
implements DDQueryState

HelloWorldQueryState is a DDQueryState used in a HelloWorldLocateMsg used to keep track of servers'guid and virtual coordinate that has be found by HelloWorldQuery

Version:
$Id: HelloWorldQueryState.java,v 1.1 2004/06/14 06:31:45 kelvinso Exp $
Author:
Chiu Wah Kelvin So

Constructor Summary
HelloWorldQueryState(InputBuffer buffer)
          Constructs a HelloWorldQueryState from its serialized form.
HelloWorldQueryState(int numberOfReqServers)
          Creates a new HelloWorldQueryState.
 
Method Summary
 Object add(SecureHash src, bamboo.vivaldi.VirtualCoordinate vc)
          Adds the specified server's GUID and virtual coordinate to the serversInfo if it is not already present.
 boolean contains(SecureHash src)
          Tests whether the serversInfo contains the specified server
 Hashtable getMap()
          getMap returns the serversInfo with requested number of GUID and corresponding VirtualCoordinate.
 int numberOfRequestedServers()
          numberOfRequestedServers returns the requested number of servers.
 void serialize(OutputBuffer buffer)
          Specified by ostore.util.QuickSerializable
 int size()
          size returns the size of the serversInfo
 String toString()
          Specified by java.lang.Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HelloWorldQueryState

public HelloWorldQueryState(int numberOfReqServers)
Creates a new HelloWorldQueryState.


HelloWorldQueryState

public HelloWorldQueryState(InputBuffer buffer)
                     throws QSException
Constructs a HelloWorldQueryState from its serialized form.

Parameters:
buffer - serialized form of object.
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable

Specified by:
serialize in interface QuickSerializable

add

public Object add(SecureHash src,
                  bamboo.vivaldi.VirtualCoordinate vc)
Adds the specified server's GUID and virtual coordinate to the serversInfo if it is not already present.

Parameters:
src - SecureHash
vc - VirtualCoordinate
Returns:
newly added Object

contains

public boolean contains(SecureHash src)
Tests whether the serversInfo contains the specified server

Parameters:
src - SecureHash
Returns:
true if the serversInfo already contains the specified server.

getMap

public Hashtable getMap()
getMap returns the serversInfo with requested number of GUID and corresponding VirtualCoordinate.

Returns:
serversInfo.

numberOfRequestedServers

public int numberOfRequestedServers()
numberOfRequestedServers returns the requested number of servers.

Returns:
the requested number of servers.

size

public int size()
size returns the size of the serversInfo

Returns:
size returns the size of the serversInfo

toString

public String toString()
Specified by java.lang.Object

Overrides:
toString in class Object