ostore.replica
Class ReplicaReq

java.lang.Object
  |
  +--ostore.replica.ReplicaReq
All Implemented Interfaces:
QueueElementIF, QuickSerializable
Direct Known Subclasses:
ReplicaCloseAllReq, ReplicaCloseReq, ReplicaCreateReq, ReplicaOpenReq, ReplicaReadReq, ReplicaUpdateReq

public abstract class ReplicaReq
extends Object
implements QueueElementIF, QuickSerializable

A superclass of all requests sent to the ReplicaStage by the ClientStage, or possibly a remote ReplicaStage.

Version:
$Id: ReplicaReq.java,v 1.15 2002/07/29 18:48:54 geels Exp $
Author:
Dennis Geels

Field Summary
protected  SecureHash digest
          The digest of this ReplicaReq.
protected  boolean local
          true iff this ReplicaReq was constructed locally (not from its QuickSerializable form).
protected  SecureHash target
          The AGUID of the Replica on which to operate.
 
Constructor Summary
protected ReplicaReq(InputBuffer buffer)
          Constructs a ReplicaReq from its serialized form.
protected ReplicaReq(SecureHash target)
          Constructs a new ReplicaReq.
 
Method Summary
 SecureHash get_digest()
          Returns the digest of this ReplicaReq.
 long get_seq_num()
          Returns the sequence number of the request.
 SecureHash get_target()
          Returns the AGUID of the Replica on which to operate.
 int hashCode()
          Returns the hash of the digest of this ReplicaReq.
 boolean is_local()
          Returns true if this ReplicaReq was sent from a local stage, false if it came off the network.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Returns a human-readable representation of this ReplicaReq.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

target

protected SecureHash target
The AGUID of the Replica on which to operate.


local

protected final boolean local
true iff this ReplicaReq was constructed locally (not from its QuickSerializable form).


digest

protected transient SecureHash digest
The digest of this ReplicaReq. Do NOT include this field in to_bytes.

Constructor Detail

ReplicaReq

protected ReplicaReq(SecureHash target)
Constructs a new ReplicaReq.


ReplicaReq

protected ReplicaReq(InputBuffer buffer)
              throws QSException
Constructs a ReplicaReq from its serialized form.

Method Detail

get_seq_num

public long get_seq_num()
Returns the sequence number of the request.

Returns:
the sequence number of the request

get_target

public SecureHash get_target()
Returns the AGUID of the Replica on which to operate.


is_local

public boolean is_local()
Returns true if this ReplicaReq was sent from a local stage, false if it came off the network.


get_digest

public SecureHash get_digest()
Returns the digest of this ReplicaReq.


serialize

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

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

hashCode

public int hashCode()
Returns the hash of the digest of this ReplicaReq.

Overrides:
hashCode in class Object

toString

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

Overrides:
toString in class Object