Module org.snmp4j.agent
Package org.snmp4j.agent
Interface RandomAccessManagedObject<SR extends SubRequest<?>>
- All Superinterfaces:
ManagedObject<SR>
- All Known Implementing Classes:
AgentppSimulationMib.AgentppSimDeleteRow
,AgentppSimulationMib.AgentppSimDeleteTableContents
,AgentppSimulationMib.AgentppSimMode
,DateAndTimeScalar
,DefaultMOTable
,DisplayStringScalar
,EnumeratedScalar
,MOScalar
,NotificationLogMib.NlmConfigGlobalAgeOut
,NotificationLogMib.NlmConfigGlobalEntryLimit
,Snmp4jConfigMib.Snmp4jCfgReset
,Snmp4jConfigMib.Snmp4jCfgSecSrcAddrValidation
,SnmpTsmMib.SnmpTsmConfigurationUsePrefix
,SnmpUsmDhObjectsMib.UsmDHParameters
,SNMPv2MIB.SysOREntry
,SNMPv2MIB.SysUpTimeImpl
,TestAndIncr
,TimeStampScalar
,UsmDHParametersImpl
A random access managed object allows to import and export any instance of a
ManagedObject
to/from
a byte array. What forms an instance (a single Variable
or a set of those) depends
on the particular ManagedObject
implementation but have to be consistent across all method implementation
of this interface.- Version:
- 3.2.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionList
<org.snmp4j.smi.VariableBinding> exportInstance
(org.snmp4j.smi.OID instanceSubID) Exports the byte representation of an instance of theManagedObject
.default org.snmp4j.smi.OID
getInstanceSubID
(org.snmp4j.smi.OID instanceOID) Returns the instance sub-identifier suffix for the given instance OID.boolean
importInstance
(org.snmp4j.smi.OID instanceSubID, List<org.snmp4j.smi.VariableBinding> data, ImportMode importMode) Imports the data that internally represents the instance specified by the OID suffixinstanceID
from the byte data provided which can be encoded in any representation theManagedObject
is able to understand.int
Returns the number of instances managed by thisManagedObject
.Iterator
<org.snmp4j.smi.OID> boolean
Tests if this instance of a SerializableManagedObject should be serialized or deserialized through persistent storage load or save operation.default boolean
isVolatile
(org.snmp4j.smi.OID instanceSubID) Tests if the specified instance should be serialized or deserialized through persistent storage load or save operation.
-
Method Details
-
importInstance
boolean importInstance(org.snmp4j.smi.OID instanceSubID, List<org.snmp4j.smi.VariableBinding> data, ImportMode importMode) Imports the data that internally represents the instance specified by the OID suffixinstanceID
from the byte data provided which can be encoded in any representation theManagedObject
is able to understand.- Parameters:
instanceSubID
- the OID suffix identifying the instance to export, for scalars this is "0" and for tabular objects this is the row index.data
- the SNMP data of the instance where the OID identifies the sub-instance (i.e. the column sub-ID for row instances and "0" for scalar objects).importMode
- defines the import strategy - must not benull
!- Returns:
true
if the import was successful,false
otherwise.
-
exportInstance
Exports the byte representation of an instance of theManagedObject
.- Parameters:
instanceSubID
- the OID suffix identifying the instance to export, for scalars this is "0" and for tabular objects this is the row index.- Returns:
- the SNMP data of the instance where the OID identifies the sub-instance (i.e. the column sub-ID for row instances and "0" for scalar objects).
-
isVolatile
default boolean isVolatile(org.snmp4j.smi.OID instanceSubID) Tests if the specified instance should be serialized or deserialized through persistent storage load or save operation.- Parameters:
instanceSubID
- the OID suffix identifying the instance to check, for scalars this is "0" and for tabular objects this is the row index.- Returns:
true
if the specified sub-instance exists and isStorageType.volatile_
.- Since:
- 3.2.0
-
instanceIterator
Iterator<org.snmp4j.smi.OID> instanceIterator() -
instanceCount
int instanceCount()Returns the number of instances managed by thisManagedObject
.- Returns:
- the number of instances managed by this object.
-
isVolatile
boolean isVolatile()Tests if this instance of a SerializableManagedObject should be serialized or deserialized through persistent storage load or save operation.- Returns:
true
if persistent storage operations should ignore thisManagedObject
andfalse
if this object should be saved/loaded to/from persistent storage.
-
getInstanceSubID
default org.snmp4j.smi.OID getInstanceSubID(org.snmp4j.smi.OID instanceOID) Returns the instance sub-identifier suffix for the given instance OID. Any implementations of this method must use the same instance notion of instance identifier asimportInstance(OID, List, ImportMode)
,exportInstance(OID)
, andinstanceIterator()
.- Parameters:
instanceOID
- the fully qualifiedOID
of a SNMPVariable
.- Returns:
- the instance ID that uniquely identifies the object instance the specified
Variable
belongs to within thisRandomAccessManagedObject
.
-