|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.snmp4j.agent.request.AbstractRequest<U,S,R>
public abstract class AbstractRequest<U extends SubRequest,S,R>
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 R |
response
|
protected S |
source
|
protected java.util.List<U> |
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(S source)
|
|
| 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. |
R |
getResponse()
Returns the response object for this request. |
S |
getSource()
Returns the initiating event object for the 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, getSecurityLevel, getSecurityModel, getSecurityName, getViewName, getViewType, isPhaseComplete, iterator, setProcessingUserObject, setViewName, size |
| Field Detail |
|---|
protected java.util.List<U extends SubRequest> subrequests
protected S source
protected R response
protected int phase
protected int errorStatus
protected int repeaterStartIndex
protected int repeaterRowSize
protected int reprocessCounter
protected int transactionID
| Constructor Detail |
|---|
public AbstractRequest(S source)
| Method Detail |
|---|
public S getSource()
Request
getSource in interface Request<S,R>Object instance on whose behalf this request
has been initiated.public R getResponse()
Request
getResponse in interface Request<S,R>public abstract boolean isBulkRequest()
public SubRequest find(org.snmp4j.smi.OID prefix)
Request
find in interface Request<S,R>prefix - 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 Request<S,R>public boolean isComplete()
Request
isComplete in interface Request<S,R>true 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 Request<S,R>index - an index >= 0 and < size()
SnmpSubRequest instance.public int getPhase()
Request
getPhase in interface Request<S,R>public int getErrorIndex()
getErrorIndex in interface Request<S,R>public int getErrorStatus()
getErrorStatus in interface Request<S,R>public int getTransactionID()
getTransactionID in interface Request<S,R>
public void setPhase(int phase)
throws java.util.NoSuchElementException
Request
setPhase in interface Request<S,R>phase - 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 Request<S,R>public void setErrorStatus(int errorStatus)
setErrorStatus in interface Request<S,R>public 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 Request<S,R>n after the n-th reprocessing iteration.Request.incReprocessCounter()public void incReprocessCounter()
Request
incReprocessCounter in interface Request<S,R>Request.getReprocessCounter()public java.lang.String toString()
toString in class java.lang.Object
|
Copyright 2005-2010 Frank Fock (SNMP4J.org) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||