ostore.dtree
Class DTreeServiceResp

java.lang.Object
  |
  +--ostore.dtree.DTreeResp
        |
        +--ostore.dtree.DTreeServiceResp
All Implemented Interfaces:
QueueElementIF, QuickSerializable

public class DTreeServiceResp
extends DTreeResp

Messages send from one dissemination tree node to another in response to a DTreeServiceReq message.

Version:
$Id: DTreeServiceResp.java,v 1.15 2003/02/23 23:11:56 hweather Exp $
Author:
Dennis Geels

Field Summary
protected  QSInt depth
          The depth of the sender in the tree, or null.
protected  Double distance
          The distance of the sender from the root the tree, or null.
protected  SignedQS signed_hb
          The most recent heartbeat for the tree's data object, signed, or null.
protected  SignedQS signed_resp
          If this response is initiating new service, this field has the signed CreateObjectResp containing the certificates required to check signatures on objects sent down the new tree.
 
Fields inherited from class ostore.dtree.DTreeResp
DENIED, digest, error_code, NO_ERROR, NOT_OPEN, req_digest, tree_id, UNKNOWN_TREE, UNREACHABLE
 
Constructor Summary
DTreeServiceResp(DTreeServiceReq req, int error_code)
          Creates a new (failed) DTreeServiceResp.
DTreeServiceResp(DTreeServiceReq req, QSInt depth, Double distance, SignedQS signed_resp, SignedQS signed_hb)
          Creates a new (successful) DTreeServiceResp.
DTreeServiceResp(InputBuffer buffer)
          Creates a DTreeServiceResp from its QuickSerializable form.
 
Method Summary
 QSInt get_depth()
          Returns the depth of the sender in the dissemination tree.
 Double get_distance()
          Returns the distance of the sender from the root of tree.
 SignedQS get_signed_hb()
          Returns the most recent heartbeat for the tree's data object, signed.
 SignedQS get_signed_resp()
          Returns signed CreateObjectResp containing the certificates required to check signatures on objects sent down the new tree.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Returns a human-readable representation of this DTreeServiceReq.
 
Methods inherited from class ostore.dtree.DTreeResp
get_digest, get_error_code, get_req_digest, get_tree_id, hashCode, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

depth

protected QSInt depth
The depth of the sender in the tree, or null.


distance

protected Double distance
The distance of the sender from the root the tree, or null.


signed_resp

protected SignedQS signed_resp
If this response is initiating new service, this field has the signed CreateObjectResp containing the certificates required to check signatures on objects sent down the new tree. Otherwise ths field is null.


signed_hb

protected SignedQS signed_hb
The most recent heartbeat for the tree's data object, signed, or null. The heartbeat itself may be any of the Heartbeat-like objects.

Constructor Detail

DTreeServiceResp

public DTreeServiceResp(DTreeServiceReq req,
                        QSInt depth,
                        Double distance,
                        SignedQS signed_resp,
                        SignedQS signed_hb)
Creates a new (successful) DTreeServiceResp.

Parameters:
req - the corresponding DTreeServiceReq.
signed_resp - The CreateObjectResp for the tree's data object, or null.
signed_hb - The most recent heartbeat for the tree's data object, signed, or null.
depth - the depth of the sender in the dissemination tree.
distance - the distance of the sender from the root the tree (ms).

DTreeServiceResp

public DTreeServiceResp(DTreeServiceReq req,
                        int error_code)
Creates a new (failed) DTreeServiceResp.

Parameters:
req - the corresponding DTreeServiceReq.
error_code - the reason the request failed.

DTreeServiceResp

public DTreeServiceResp(InputBuffer buffer)
                 throws QSException
Creates a DTreeServiceResp from its QuickSerializable form.

Method Detail

get_signed_resp

public SignedQS get_signed_resp()
Returns signed CreateObjectResp containing the certificates required to check signatures on objects sent down the new tree.


get_signed_hb

public SignedQS get_signed_hb()
Returns the most recent heartbeat for the tree's data object, signed.


get_depth

public QSInt get_depth()
Returns the depth of the sender in the dissemination tree.


get_distance

public Double get_distance()
Returns the distance of the sender from the root of tree.


serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class DTreeResp
Parameters:
buffer - the output buffer to add the object to

toString

public String toString()
Returns a human-readable representation of this DTreeServiceReq.

Overrides:
toString in class DTreeResp