AbstractRequest
, SnmpRequest
public interface Request<S,R,U extends SubRequest>
Request
interface defines common elements of SNMP related
operation requests.Modifier and Type | Field | Description |
---|---|---|
static int |
PHASE_1PC |
|
static int |
PHASE_2PC_CLEANUP |
|
static int |
PHASE_2PC_COMMIT |
|
static int |
PHASE_2PC_PREPARE |
|
static int |
PHASE_2PC_UNDO |
|
static int |
PHASE_INIT |
Modifier and Type | Method | Description |
---|---|---|
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.
|
org.snmp4j.smi.OctetString |
getContext() |
Gets the context of the request.
|
int |
getErrorIndex() |
|
int |
getErrorStatus() |
|
int |
getMessageProcessingModel() |
|
int |
getPhase() |
Gets the phase identifier of the current Two-Phase-Commit (2PC) phase of
this request.
|
java.lang.Object |
getProcessingUserObject(java.lang.Object key) |
Gets the processing user object for the specified key.
|
int |
getReprocessCounter() |
Returns the value of the reprocessing counter associated with this request.
|
R |
getResponse() |
Returns the response object for this request.
|
int |
getSecurityLevel() |
|
int |
getSecurityModel() |
|
org.snmp4j.smi.OctetString |
getSecurityName() |
|
S |
getSource() |
Returns the initiating event object for the request.
|
int |
getTransactionID() |
|
org.snmp4j.smi.OctetString |
getViewName() |
|
int |
getViewType() |
|
void |
incReprocessCounter() |
Increments the reprocess counter by one.
|
boolean |
isComplete() |
Checks whether the response for this request is complete.
|
boolean |
isPhaseComplete() |
Checks whether the current phase is complete.
|
java.util.Iterator<U> |
iterator() |
Returns an
Iterator over the sub-requests of this request. |
int |
nextPhase() |
Initializes next phase and returns its identifier.
|
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.
|
java.lang.Object |
setProcessingUserObject(java.lang.Object key,
java.lang.Object value) |
Sets an user object association.
|
void |
setViewName(org.snmp4j.smi.OctetString viewName) |
|
int |
size() |
Gets the number of sub-requests in this request.
|
static final int PHASE_INIT
static final int PHASE_1PC
static final int PHASE_2PC_PREPARE
static final int PHASE_2PC_COMMIT
static final int PHASE_2PC_UNDO
static final int PHASE_2PC_CLEANUP
U find(org.snmp4j.smi.OID prefix)
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.R getResponse()
boolean isComplete()
true
if all required data has been collected to create
a response for this request, false
otherwise.boolean isPhaseComplete()
true
if all required processing has been finished for
the current request phase. For single phase request types this method
returns the same result as isComplete()
.S getSource()
Object
instance on whose behalf this request
has been initiated.org.snmp4j.smi.OctetString getContext()
OctetString
instance.U get(int index)
index
- an index >= 0 and < size()
SnmpSubRequest
instance.int size()
int getPhase()
int nextPhase() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if there is no next phase for this type
of request.void setPhase(int phase) throws java.util.NoSuchElementException
phase
- a phase identifier.java.util.NoSuchElementException
- if there is no such phase for this type
of request.java.util.Iterator<U> iterator()
Iterator
over the sub-requests of this request.Iterator
void setViewName(org.snmp4j.smi.OctetString viewName)
org.snmp4j.smi.OctetString getViewName()
org.snmp4j.smi.OctetString getSecurityName()
int getMessageProcessingModel()
int getSecurityModel()
int getSecurityLevel()
int getViewType()
void setErrorStatus(int errorStatus)
int getErrorStatus()
int getErrorIndex()
int getTransactionID()
void resetProcessedStatus()
false
.int getReprocessCounter()
n
after the n
-th reprocessing iteration.incReprocessCounter()
void incReprocessCounter()
getReprocessCounter()
java.lang.Object getProcessingUserObject(java.lang.Object key)
ManagedObject
s may put their own objects into the request
(for example to avoid unnecessary updates on behalf of the same request).key
- an Object.null
if their exists no such
association.java.lang.Object setProcessingUserObject(java.lang.Object key, java.lang.Object value)
key
- a key Object.value
- a value Object associated with key
.key
or null
if no such association existed.Copyright © 2018 SNMP4J.org. All rights reserved.