public abstract class AbstractRequest<U extends SubRequest,S,R> extends Object implements Request<S,R,U>
AbstractRequest implements common elements of SNMP and
AgentX requests and might be also used for other sub-agent request types.| Modifier and Type | Field and Description |
|---|---|
protected int |
errorStatus |
protected int |
phase |
protected int |
repeaterRowSize |
protected int |
repeaterStartIndex |
protected int |
reprocessCounter |
protected R |
response |
protected S |
source |
protected List<U> |
subrequests |
protected int |
transactionID |
PHASE_1PC, PHASE_2PC_CLEANUP, PHASE_2PC_COMMIT, PHASE_2PC_PREPARE, PHASE_2PC_UNDO, PHASE_INIT| Constructor and Description |
|---|
AbstractRequest(S source) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
U |
find(org.snmp4j.smi.OID prefix)
Finds the first sub-request whose OID starts with the supplied one.
|
U |
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() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetContext, getMessageProcessingModel, getProcessingUserObject, getSecurityLevel, getSecurityModel, getSecurityName, getViewName, getViewType, isPhaseComplete, iterator, setProcessingUserObject, setViewName, sizeprotected 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
public AbstractRequest(S source)
public S getSource()
Requestpublic R getResponse()
RequestgetResponse in interface Request<S,R,U extends SubRequest>public abstract boolean isBulkRequest()
public U find(org.snmp4j.smi.OID prefix)
Requestprotected void initSubRequests()
protected abstract void setupSubRequests()
protected abstract int getMaxPhase()
public int nextPhase()
Requestpublic boolean isComplete()
RequestisComplete in interface Request<S,R,U extends SubRequest>true if all required data has been collected to create
a response for this request, false otherwise.public U get(int index)
Requestpublic int getPhase()
Requestpublic int getErrorIndex()
getErrorIndex in interface Request<S,R,U extends SubRequest>public int getErrorStatus()
getErrorStatus in interface Request<S,R,U extends SubRequest>public int getTransactionID()
getTransactionID in interface Request<S,R,U extends SubRequest>public void setPhase(int phase)
throws NoSuchElementException
RequestsetPhase in interface Request<S,R,U extends SubRequest>phase - a phase identifier.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,U extends SubRequest>public void setErrorStatus(int errorStatus)
setErrorStatus in interface Request<S,R,U extends SubRequest>public int getReprocessCounter()
RequestgetReprocessCounter in interface Request<S,R,U extends SubRequest>n after the n-th reprocessing iteration.Request.incReprocessCounter()public void incReprocessCounter()
RequestincReprocessCounter in interface Request<S,R,U extends SubRequest>Request.getReprocessCounter()Copyright © 2020 SNMP4J.org. All rights reserved.