com.sun.jaw.snmp.manager
Class Request

java.lang.Object
  |
  +--com.sun.jaw.snmp.manager.Request
Direct Known Subclasses:
SnmpRequest

public abstract class Request
extends java.lang.Object

This class is an abtract representation of a request.


Field Summary
protected  int retry
          Number of retries performed for the current polling operation.
static int stAborted
          Status of a request: request aborted.
protected static int stBase
          Base status of a request.
static int stInProgress
          Status of a request: in progress.
static int stInternalError
          Status of a request: internal error occured.
static int stNeverUsed
          Status of a request: request never used.
static int stReceivedReply
          Status of a request: reply received.
static int stResultsAvailable
          Status of a request: result available for the request.
static int stTimeout
          Status of a request: timeout.
static int stWaitingForReply
          Status of a request: waiting for reply.
static int stWaitingToSend
          Status of a request: waiting to be sent.
protected  int timeout
          Timeout.
 
Constructor Summary
protected Request()
          Default constructor.
 
Method Summary
abstract  boolean allowMultiplex()
          Checks to see if this request can be multiplexed with other requests.
abstract  void cancelRequest()
          Cancels the active request and removes itself from polling list.
 long getAbsMaxTimeToWait()
          Gets absolute time in milliseconds (based on epoch time) before which a response is expected from a agent.
 long getAbsNextPollTime()
          Gets absolute time in milliseconds (based on epoch time) when the next polling activity will begin.
abstract  int getMaxRetry()
          Gets the maximum number of retries before declaring that the peer is not responding.
 long getPollTimestamp()
          Gets the absolute time (based on epoch time) when the poll started.
 int getRequestId()
          Gets the request id (invoke identifier) of the current request.
 int getRequestStatus()
          Gets the current status of the request.
 int getRetryCount()
          Gets the number of retries performed for the current request.
protected  void initNewRequest()
          Initializes the request id from the request counter.
 boolean inProgress()
          Indicates whether or not the request is in progress.
 boolean isAborted()
          Indicates whether or not the request was aborted.
 boolean isResultAvailable()
          Indicates whether or not the request result is available.
 java.lang.String toString()
          Gets a string representation of the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stBase

protected static final int stBase
Base status of a request.

stInProgress

public static final int stInProgress
Status of a request: in progress.

stWaitingToSend

public static final int stWaitingToSend
Status of a request: waiting to be sent.

stWaitingForReply

public static final int stWaitingForReply
Status of a request: waiting for reply.

stReceivedReply

public static final int stReceivedReply
Status of a request: reply received.

stAborted

public static final int stAborted
Status of a request: request aborted.

stTimeout

public static final int stTimeout
Status of a request: timeout.

stInternalError

public static final int stInternalError
Status of a request: internal error occured.

stResultsAvailable

public static final int stResultsAvailable
Status of a request: result available for the request.

stNeverUsed

public static final int stNeverUsed
Status of a request: request never used.

retry

protected int retry
Number of retries performed for the current polling operation.

timeout

protected int timeout
Timeout. The default value is 5 seconds.
Constructor Detail

Request

protected Request()
Default constructor.
Method Detail

getMaxRetry

public abstract int getMaxRetry()
Gets the maximum number of retries before declaring that the peer is not responding.
Returns:
The maximum number of retries.

allowMultiplex

public abstract boolean allowMultiplex()
Checks to see if this request can be multiplexed with other requests.
Returns:
True if this request can be multiplexed with other requests; false otherwise.

cancelRequest

public abstract void cancelRequest()
Cancels the active request and removes itself from polling list.

getRetryCount

public final int getRetryCount()
Gets the number of retries performed for the current request.
Returns:
The number of retries performed.

getRequestId

public final int getRequestId()
Gets the request id (invoke identifier) of the current request.
Returns:
The request id.

getRequestStatus

public final int getRequestStatus()
Gets the current status of the request.
Returns:
The current status of the request.

isAborted

public final boolean isAborted()
Indicates whether or not the request was aborted.
Returns:
True if the request was aborted; false otherwise.

inProgress

public final boolean inProgress()
Indicates whether or not the request is in progress.
Returns:
True if the request is in progress; false otherwise.

isResultAvailable

public final boolean isResultAvailable()
Indicates whether or not the request result is available.
Returns:
True if the request result is available; false otherwise.

getAbsNextPollTime

public final long getAbsNextPollTime()
Gets absolute time in milliseconds (based on epoch time) when the next polling activity will begin.
Returns:
The absolute time when polling will begin.

getAbsMaxTimeToWait

public final long getAbsMaxTimeToWait()
Gets absolute time in milliseconds (based on epoch time) before which a response is expected from a agent.
Returns:
The absolute time within which a response is expected.

getPollTimestamp

public final long getPollTimestamp()
Gets the absolute time (based on epoch time) when the poll started.
Returns:
The absolute time the polling started.

initNewRequest

protected final void initNewRequest()
Initializes the request id from the request counter.

toString

public java.lang.String toString()
Gets a string representation of the request.
Returns:
A string representation of the request.
Overrides:
toString in class java.lang.Object