Package org.snmp4j.model.snmp.spi
Interface SnmpService
- All Superinterfaces:
TransactionManager
- All Known Implementing Classes:
LocalSnmpService
,SNMP4JAgentSnmpService
The
SnmpService
provides SNMP services to SNMP command generator applications.- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionList<? extends org.snmp4j.smi.VariableBinding>
Gets the SNMP values for the specified OIDs.List<? extends org.snmp4j.smi.VariableBinding>
Gets the next following SNMP values for the specified OIDs.List<? extends org.snmp4j.smi.VariableBinding>
getSubTree
(org.snmp4j.Target target, org.snmp4j.smi.OID oid) Gets the SNMP values for the specified sub-tree root OID.getTable
(org.snmp4j.Target target, List<org.snmp4j.smi.OID> columnOIDs, org.snmp4j.smi.OID minIndex, org.snmp4j.smi.OID maxIndex) Gets the rows of a SNMP table synchronously.void
getTable
(org.snmp4j.Target target, List<org.snmp4j.smi.OID> columnOIDs, org.snmp4j.smi.OID minIndex, org.snmp4j.smi.OID maxIndex, SnmpRowListener callback, Object userObject) Gets the rows of a SNMP table asynchronously.void
Initializes the transports associated with this service.void
update
(SnmpTransaction snmpTransaction, org.snmp4j.Target target, SnmpValuesChangeSet changeSet, SnmpCommitListener snmpCommitListener) Updates (SETs) a set of changes with an atomic SET operation asynchronously.Methods inherited from interface org.snmp4j.model.transaction.TransactionManager
commit, getSnmpTransaction, isAtomic, rollback
-
Method Details
-
initTransports
Initializes the transports associated with this service. This will open the necessary network ports.- Throws:
IOException
- if an IO error occurred during initialization.
-
get
List<? extends org.snmp4j.smi.VariableBinding> get(org.snmp4j.Target target, List<org.snmp4j.smi.OID> oidList) throws SnmpException Gets the SNMP values for the specified OIDs.- Parameters:
target
- the SNMP target to send the SNMP PDUs to.oidList
- the instance object identifiers to GET values for.- Returns:
- a list of variable bindings.
- Throws:
SnmpException
- if an SNMP error or timeout occurred.
-
getNext
List<? extends org.snmp4j.smi.VariableBinding> getNext(org.snmp4j.Target target, List<org.snmp4j.smi.OID> oidList) throws SnmpException Gets the next following SNMP values for the specified OIDs.- Parameters:
target
- the SNMP target to send the SNMP PDUs to.oidList
- the instance object identifiers to GET-NEXT values for.- Returns:
- a list of variable bindings.
- Throws:
SnmpException
- if an SNMP error or timeout occurred.
-
getSubTree
List<? extends org.snmp4j.smi.VariableBinding> getSubTree(org.snmp4j.Target target, org.snmp4j.smi.OID oid) throws SnmpException Gets the SNMP values for the specified sub-tree root OID.- Parameters:
target
- the SNMP target to send the SNMP PDUs to.oid
- the root OID of the sub-tree to get values for (using GETBULK or GETNEXT).- Returns:
- a list of variable bindings.
- Throws:
SnmpException
- if an SNMP error or timeout occurred.
-
getTable
List<? extends SnmpRow> getTable(org.snmp4j.Target target, List<org.snmp4j.smi.OID> columnOIDs, org.snmp4j.smi.OID minIndex, org.snmp4j.smi.OID maxIndex) throws SnmpException Gets the rows of a SNMP table synchronously.- Parameters:
target
- the SNMP target to send the SNMP PDUs to.columnOIDs
- the OIDs of the columns to retrieve (columns might be combined from several tables although the indexes of the included tables should then contain a common prefix).minIndex
- the minimum index to return (ornull
for no limit).maxIndex
- the maximum index to return (ornull
for no limit).- Returns:
- a list of
SnmpRow
instances. - Throws:
SnmpException
- if an SNMP error or timeout occurred.
-
getTable
void getTable(org.snmp4j.Target target, List<org.snmp4j.smi.OID> columnOIDs, org.snmp4j.smi.OID minIndex, org.snmp4j.smi.OID maxIndex, SnmpRowListener callback, Object userObject) throws SnmpException Gets the rows of a SNMP table asynchronously.- Parameters:
target
- the SNMP target to send the SNMP PDUs to.columnOIDs
- the OIDs of the columns to retrieve (columns might be combined from several tables although the indexes of the included tables should then contain a common prefix).minIndex
- the minimum index to return (ornull
for no limit).maxIndex
- the maximum index to return (ornull
for no limit).callback
- the callback that receives the retrieved rows.userObject
- an optinal user object to be associated with this retrieval.- Throws:
SnmpException
- if an SNMP error or timeout occurred.
-
update
void update(SnmpTransaction snmpTransaction, org.snmp4j.Target target, SnmpValuesChangeSet changeSet, SnmpCommitListener snmpCommitListener) Updates (SETs) a set of changes with an atomic SET operation asynchronously.- Parameters:
snmpTransaction
- the transaction that controls this update.target
- the SNMP target.changeSet
- the change set to commit to the agent identified bytarget
.snmpCommitListener
- a listener for commit events.
-