SnmpCommitResult
public class CommitStatus extends Object implements SnmpCommitResult
CommitStatus
represents the status of a SNMP commit operation.
It has two lists, the first contains all the successfully committed changes and the second
holds any failed change sets.Constructor | Description |
---|---|
CommitStatus(SnmpErrorStatus snmpErrorStatus,
int errorIndex,
List<SnmpValuesChangeSet> committedChanges,
List<SnmpValuesChangeSet> failedChanges) |
Create a SNMP commit result based on an error status and index as well as a list of succeeded
(committed) changes and failed changes.
|
Modifier and Type | Method | Description |
---|---|---|
List<SnmpValuesChangeSet> |
getCommittedChanges() |
|
int |
getErrorIndex() |
Gets the error index of the SNMP error (if > 0) that points to the
VariableBinding
in SnmpCommitResult.getFailedChanges() that caused the error. |
SnmpErrorStatus |
getErrorStatus() |
|
List<SnmpValuesChangeSet> |
getFailedChanges() |
|
boolean |
isSuccess() |
Returns
true if the commit operation succeeded. |
String |
toString() |
public CommitStatus(SnmpErrorStatus snmpErrorStatus, int errorIndex, List<SnmpValuesChangeSet> committedChanges, List<SnmpValuesChangeSet> failedChanges)
snmpErrorStatus
- the SNMP error status that caused the first failure as defined by SnmpErrorStatus
.errorIndex
- the index of the value that failed. Counting starts from the first change set's first element (=1) until the last
changes set's last value.committedChanges
- the (possibly empty) list of successfully committed changes.failedChanges
- the (possibly empty) list of uncommitted changes or changes that caused an error.public boolean isSuccess()
SnmpCommitResult
true
if the commit operation succeeded.isSuccess
in interface SnmpCommitResult
true
if the commit operation succeeded, false
if a timeout, IO exception,
or SNMP error occurred.public SnmpErrorStatus getErrorStatus()
getErrorStatus
in interface SnmpCommitResult
public List<SnmpValuesChangeSet> getFailedChanges()
getFailedChanges
in interface SnmpCommitResult
public List<SnmpValuesChangeSet> getCommittedChanges()
getCommittedChanges
in interface SnmpCommitResult
public int getErrorIndex()
SnmpCommitResult
VariableBinding
in SnmpCommitResult.getFailedChanges()
that caused the error.getErrorIndex
in interface SnmpCommitResult
SnmpCommitResult.getFailedChanges()
that caused the error.Copyright © 2020 SNMP4J.org. All rights reserved.