ostore.client
Class OSRequest

java.lang.Object
  |
  +--ostore.client.OSRequest
All Implemented Interfaces:
QueueElementIF, QuickSerializable
Direct Known Subclasses:
OSCloseReplicaRequest, OSCreateObjectRequest, OSMetadataRequest, OSOpenReplicaRequest, OSRead, OSRegisterAppRequest, OSSetAppPropertyRequest, OSUpdate, OSVIDRequest

public abstract class OSRequest
extends Object
implements QuickSerializable, QueueElementIF

The OSRequest is the abstract super class for all OceanStore API requests. It provides a unique sequence number for each request. The outcome of the request will be returned to the application in the form of an OSResult which will contain the sequence number of the originating request.

Version:
$Id: OSRequest.java,v 1.29 2004/02/13 23:14:42 rrubin Exp $
Author:
Patrick R. Eaton
See Also:
OSResult

Field Summary
 OSAppId app_id
           
 
Constructor Summary
OSRequest(InputBuffer buffer)
           
 
Method Summary
 Object clone()
          Clone this request.
 OSAppId getAppId()
          Returns the OSAppId that identifies the requesting application.
 long getDispatchTime()
          Returns the time (as recorded by System.currentTimeMillis()) that this request was dispatched from the ClientStage.
 Long getSeqNum()
          Returns the sequence number of the request.
 QuickSerializable getUserTag()
          Returns the user tag.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 void setUserTag(QuickSerializable user_tag)
          Sets the user tag.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

app_id

public OSAppId app_id
Constructor Detail

OSRequest

public OSRequest(InputBuffer buffer)
          throws QSException
Method Detail

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

setUserTag

public void setUserTag(QuickSerializable user_tag)
Sets the user tag. The user tag is an application-defined object that can be used for any purpose the application desires. The user tag will be copied to the corresponding OSResult.


getUserTag

public QuickSerializable getUserTag()
Returns the user tag. The user tag is an application-defined object that can be used for any purpose the application desires. The user tag will be copied to the corresponding OSResult.

Returns:
the user tag attached to the request

getAppId

public OSAppId getAppId()
Returns the OSAppId that identifies the requesting application.

Returns:
the OSAppId to identify the requesting application

getSeqNum

public Long getSeqNum()
Returns the sequence number of the request.

Returns:
the sequence number of the request

getDispatchTime

public long getDispatchTime()
Returns the time (as recorded by System.currentTimeMillis()) that this request was dispatched from the ClientStage.

Returns:
the time this request was dispatched

clone

public Object clone()
Clone this request.

Overrides:
clone in class Object