|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.snmp4j.agent.request.AbstractRequest
public abstract class AbstractRequest
The AbstractRequest implements common elements of SNMP and
AgentX requests and might be also used for other sub-agent request types.
| Field Summary | |
|---|---|
protected int |
errorStatus
|
protected int |
phase
|
protected int |
repeaterRowSize
|
protected int |
repeaterStartIndex
|
protected int |
reprocessCounter
|
protected java.util.List |
subrequests
|
protected int |
transactionID
|
| Fields inherited from interface org.snmp4j.agent.request.Request |
|---|
PHASE_1PC, PHASE_2PC_CLEANUP, PHASE_2PC_COMMIT, PHASE_2PC_PREPARE, PHASE_2PC_UNDO, PHASE_INIT |
| Constructor Summary | |
|---|---|
AbstractRequest()
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
SubRequest |
find(org.snmp4j.smi.OID prefix)
Finds the first sub-request whose OID starts with the supplied one. |
SubRequest |
get(int index)
Gets the sub-request at the specified index. |
int |
getErrorIndex()
|
int |
getErrorStatus()
|
protected abstract int |
getMaxPhase()
|
int |
getPhase()
Gets the phase identifier of the current Two-Phase-Commit (2PC) phase of this request. |
int |
getReprocessCounter()
Returns the value of the reprocessing counter associated with this request. |
int |
getTransactionID()
|
int |
hashCode()
|
void |
incReprocessCounter()
Increments the reprocess counter by one. |
protected void |
initSubRequests()
|
abstract boolean |
isBulkRequest()
|
boolean |
isComplete()
Checks whether the response for this request is complete. |
int |
nextPhase()
Initializes next phase and returns its identifier. |
protected void |
resetCompletionStatus()
|
void |
resetProcessedStatus()
Set the processed status of each (incomplete) sub-request to false. |
void |
setErrorStatus(int errorStatus)
|
void |
setPhase(int phase)
Sets the request phase. |
protected abstract void |
setupSubRequests()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.snmp4j.agent.request.Request |
|---|
getContext, getMessageProcessingModel, getProcessingUserObject, getResponse, getSecurityLevel, getSecurityModel, getSecurityName, getSource, getViewName, getViewType, isPhaseComplete, iterator, setProcessingUserObject, setViewName, size |
| Field Detail |
|---|
protected java.util.List subrequests
protected int phase
protected int errorStatus
protected int repeaterStartIndex
protected int repeaterRowSize
protected int reprocessCounter
protected int transactionID
| Constructor Detail |
|---|
public AbstractRequest()
| Method Detail |
|---|
public abstract boolean isBulkRequest()
public SubRequest find(org.snmp4j.smi.OID prefix)
Request
find in interface Requestprefix - the OID prefix of the sub-request OID.
SubRequest instance of this request whose OID
starts with prefix. If no such sub-request exits
null is returned.protected void initSubRequests()
protected abstract void setupSubRequests()
protected abstract int getMaxPhase()
public int nextPhase()
Request
nextPhase in interface Requestpublic boolean isComplete()
Request
isComplete in interface Requesttrue if all required data has been collected to create
a response for this request, false otherwise.public SubRequest get(int index)
Request
get in interface Requestindex - an index >= 0 and < size()
SnmpSubRequest instance.public int getPhase()
Request
getPhase in interface Requestpublic int getErrorIndex()
getErrorIndex in interface Requestpublic int getErrorStatus()
getErrorStatus in interface Requestpublic int getTransactionID()
getTransactionID in interface Request
public void setPhase(int phase)
throws java.util.NoSuchElementException
Request
setPhase in interface Requestphase - a phase identifier.
java.util.NoSuchElementException - if there is no such phase for this type
of request.protected void resetCompletionStatus()
public void resetProcessedStatus()
Requestfalse.
resetProcessedStatus in interface Requestpublic void setErrorStatus(int errorStatus)
setErrorStatus in interface Requestpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int getReprocessCounter()
Request
getReprocessCounter in interface Requestn after the n-th reprocessing iteration.Request.incReprocessCounter()public void incReprocessCounter()
Request
incReprocessCounter in interface RequestRequest.getReprocessCounter()public java.lang.String toString()
toString in class java.lang.Object
|
Copyright 2005-2008 Frank Fock (SNMP4J.org) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||