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
public interface RandomAccessManagedObject<SR extends SubRequest<?>> extends ManagedObject<SR>
A random access managed object allows to import and export any instance of aManagedObjectto/from a byte array. What forms an instance (a singleVariableor a set of those) depends on the particularManagedObjectimplementation but have to be consistent across all method implementation of this interface.- Version:
- 3.2.0
- Author:
- Frank Fock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<org.snmp4j.smi.VariableBinding>exportInstance(org.snmp4j.smi.OID instanceSubID)Exports the byte representation of an instance of theManagedObject.default org.snmp4j.smi.OIDgetInstanceSubID(org.snmp4j.smi.OID instanceOID)Returns the instance sub-identifier suffix for the given instance OID.booleanimportInstance(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 suffixinstanceIDfrom the byte data provided which can be encoded in any representation theManagedObjectis able to understand.intinstanceCount()Returns the number of instances managed by thisManagedObject.Iterator<org.snmp4j.smi.OID>instanceIterator()booleanisVolatile()Tests if this instance of a SerializableManagedObject should be serialized or deserialized through persistent storage load or save operation.default booleanisVolatile(org.snmp4j.smi.OID instanceSubID)Tests if the specified instance should be serialized or deserialized through persistent storage load or save operation.
-
-
-
Method Detail
-
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 suffixinstanceIDfrom the byte data provided which can be encoded in any representation theManagedObjectis 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:
trueif the import was successful,falseotherwise.
-
exportInstance
List<org.snmp4j.smi.VariableBinding> exportInstance(org.snmp4j.smi.OID instanceSubID)
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:
trueif 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:
trueif persistent storage operations should ignore thisManagedObjectandfalseif 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 qualifiedOIDof a SNMPVariable.- Returns:
- the instance ID that uniquely identifies the object instance the specified
Variablebelongs to within thisRandomAccessManagedObject.
-
-