public class SnmpRequest.SnmpSubRequest extends Object implements SnmpSubRequest, RequestStatusListener
Modifier | Constructor and Description |
---|---|
protected |
SnmpSubRequest(SnmpRequest.SnmpSubRequest predecessor,
int index) |
protected |
SnmpSubRequest(org.snmp4j.smi.VariableBinding subrequest,
int index) |
Modifier and Type | Method and Description |
---|---|
void |
completed()
Marks the sub-request as completed.
|
int |
getErrorStatus()
Gets the error status for this sub-request.
|
int |
getIndex()
Returns the index of this subrequest in the request.
|
protected MOScope |
getNextScope(org.snmp4j.smi.OID previousOID) |
MOQuery |
getQuery()
Gets the query previously associated with this sub-request.
|
SnmpRequest |
getRequest()
Gets the request this sub-request belongs to.
|
MOScope |
getScope()
Gets the scope for this subrequest.
|
SnmpRequest |
getSnmpRequest() |
RequestStatus |
getStatus()
Gets the status object associated with this sub-request.
|
ManagedObject |
getTargetMO()
Gets the
ManagedObject that is responsible for processing
this sub-request. |
Object |
getUndoValue()
Gets the undo value object associated with this sub-request.
|
Object |
getUserObject()
Gets the user object that has previously associated with this sub-request.
|
org.snmp4j.smi.VariableBinding |
getVariableBinding()
Returns the variable binding associated with the sub-request.
|
boolean |
hasError()
Indicates whether this (sub-)request has an error.
|
boolean |
isComplete()
Checks whether the sub-request has been completed and needs no further
processing.
|
SubRequestIterator<? extends SubRequest> |
repetitions()
Returns an iterator on the repetitions of this sub-request.
|
void |
requestStatusChanged(RequestStatusEvent event) |
void |
setErrorStatus(int errorStatus)
Sets the error status for this sub-request.
|
void |
setQuery(MOQuery query)
Sets the query associated with this subrequest.
|
void |
setStatus(RequestStatus status) |
void |
setTargetMO(ManagedObject managedObject)
Sets the
ManagedObject that is determined as the target object
of this sub-request by the agent framework. |
void |
setUndoValue(Object undoInformation)
Associates an undo value object with this sub-request.
|
void |
setUserObject(Object userObject)
Sets the user object.
|
String |
toString() |
void |
updateNextRepetition()
Updates the next repetition's scope and reset any previously set query
to
null . |
protected SnmpSubRequest(org.snmp4j.smi.VariableBinding subrequest, int index)
protected SnmpSubRequest(SnmpRequest.SnmpSubRequest predecessor, int index)
protected MOScope getNextScope(org.snmp4j.smi.OID previousOID)
public SnmpRequest getRequest()
SubRequest
getRequest
in interface SubRequest
public RequestStatus getStatus()
SubRequest
getStatus
in interface SnmpSubRequest
getStatus
in interface SubRequest
public org.snmp4j.smi.VariableBinding getVariableBinding()
SubRequest
getVariableBinding
in interface SnmpSubRequest
getVariableBinding
in interface SubRequest
VariableBinding
that holds the sub-request result
or operation parameter (in case of a SET request).public void setStatus(RequestStatus status)
setStatus
in interface SnmpSubRequest
public Object getUndoValue()
SubRequest
getUndoValue
in interface SubRequest
SubRequest.setUndoValue(java.lang.Object)
.public void setUndoValue(Object undoInformation)
SubRequest
ManagedObject
interface that does not extend any other
API class.setUndoValue
in interface SubRequest
undoInformation
- an object that represents/contains all necessary information to undo
this sub-request.public void requestStatusChanged(RequestStatusEvent event)
requestStatusChanged
in interface RequestStatusListener
public MOScope getScope()
SubRequest
getScope
in interface SubRequest
MOScope
instance.public void completed()
SubRequest
SubRequest.getStatus()
and then
RequestStatus.setPhaseComplete(boolean)
to true
.completed
in interface SubRequest
public boolean hasError()
SubRequest
hasError
in interface SubRequest
true
if this request (and thus also this sub-request) has
an error status greater than zero.public boolean isComplete()
SubRequest
isComplete
in interface SubRequest
true
if the sub-request has been finished and should not
be processed any more.public void setTargetMO(ManagedObject managedObject)
SubRequest
ManagedObject
that is determined as the target object
of this sub-request by the agent framework. For SET requests the target
managed object is locked and referenced here to make sure that all locks
are released when a request is answered. In addition, SET requests are
processed in multiple phases and referencing the target managed objects
increases performance.setTargetMO
in interface SubRequest
managedObject
- the ManagedObject
responsible for processing this sub-
request.public ManagedObject getTargetMO()
SubRequest
ManagedObject
that is responsible for processing
this sub-request.getTargetMO
in interface SubRequest
ManagedObject
instance.public SnmpRequest getSnmpRequest()
getSnmpRequest
in interface SnmpSubRequest
public void setErrorStatus(int errorStatus)
SubRequest
SubRequest.getStatus()
.setErrorStatus(int errorStatus)
.setErrorStatus
in interface SnmpSubRequest
setErrorStatus
in interface SubRequest
errorStatus
- a SNMPv2/v3 error status.public int getIndex()
SubRequest
getIndex
in interface SubRequest
public void setQuery(MOQuery query)
SubRequest
setQuery
in interface SubRequest
query
- a MOQuery
instance representing the query resulting from
this sub-request.public MOQuery getQuery()
SubRequest
getQuery
in interface SubRequest
MOQuery
that describes which manage objects match
this sub-request.public SubRequestIterator<? extends SubRequest> repetitions()
SubRequest
repetitions
in interface SubRequest
public void updateNextRepetition()
SubRequest
null
. The scope of the next repetition is updated
according to the value of this variable binding. If this sub-request
has an error status or exception value, the following repetitions are
set to the same value and exception. Otherwise, the scope of the following
sub-request is the open interval from this sub-request's OID
(not-including) to any OID value.updateNextRepetition
in interface SubRequest
public final int getErrorStatus()
SubRequest
SubRequest.getStatus()
.getErrorStatus()
.getErrorStatus
in interface SubRequest
public Object getUserObject()
SubRequest
getUserObject
in interface SubRequest
public void setUserObject(Object userObject)
SubRequest
null
.setUserObject
in interface SubRequest
userObject
- an object that is not processed or interpreted by the agent API.Copyright © 2017 SNMP4J.org. All rights reserved.