Package org.snmp4j.model.snmp.proxy.impl
Class SnmpProxyObjectHelper
java.lang.Object
org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectHelper
The
SnmpProxyObjectHelper
is an utility class that helps map model values to SNMP and vice versa.- Author:
- Frank Fock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyNewValues
(VariableBindingMapper variableBindingMapper, SnmpValuesChangeSet changeSet) Convert any new model values in a change set to the corresponding SNMP value and store that SNMP value in the change set for further processing.static void
applyOldValues
(VariableBindingMapper variableBindingMapper, SnmpValuesChangeSet changeSet) Convert any old model values in a change set to the corresponding SNMP value and store that SNMP value in the change set for further processing.static List<org.snmp4j.smi.VariableBinding>
mapObjectsToVB
(VariableBindingMapper variableBindingMapper, List<org.snmp4j.smi.OID> oids, List<Object> objects) Convert a list of objects from their model representation to SNMP variable bindings.static <Type> List<Type>
mapVBsToObjects
(VariableBindingMapper variableBindingMapper, List<org.snmp4j.smi.VariableBinding> vbs, List<? extends SnmpProxyColumn> targetColumns) Convert a list of objects from their model representation to SNMP variable bindings.
-
Constructor Details
-
SnmpProxyObjectHelper
public SnmpProxyObjectHelper()
-
-
Method Details
-
mapObjectsToVB
public static List<org.snmp4j.smi.VariableBinding> mapObjectsToVB(VariableBindingMapper variableBindingMapper, List<org.snmp4j.smi.OID> oids, List<Object> objects) Convert a list of objects from their model representation to SNMP variable bindings.- Parameters:
variableBindingMapper
- the variable binding mapper used for the conversion.oids
- the object identifiers of the SNMP object types to convert (the n-th OID is associated with the n-th object ofobjects
.objects
- the mode object values. The type of the object must match the mapper type for that OID.- Returns:
- a list of variable bindings with the same size as
oids
.
-
mapVBsToObjects
public static <Type> List<Type> mapVBsToObjects(VariableBindingMapper variableBindingMapper, List<org.snmp4j.smi.VariableBinding> vbs, List<? extends SnmpProxyColumn> targetColumns) Convert a list of objects from their model representation to SNMP variable bindings.- Type Parameters:
Type
- the base type of the mapping target objects (that is common to all variable bindings).- Parameters:
variableBindingMapper
- the variable binding mapper used for the conversion.vbs
- a list of SNMP variable bindings to convert.targetColumns
- a list of columnar objects that represent the target model structure. The length of this list must match the length ofvbs
list!- Returns:
- a list of variable bindings with the same size as
oids
.
-
applyNewValues
public static void applyNewValues(VariableBindingMapper variableBindingMapper, SnmpValuesChangeSet changeSet) Convert any new model values in a change set to the corresponding SNMP value and store that SNMP value in the change set for further processing.- Parameters:
variableBindingMapper
- the variable binding mapper used for the conversion.changeSet
- the change set to be modified.
-
applyOldValues
public static void applyOldValues(VariableBindingMapper variableBindingMapper, SnmpValuesChangeSet changeSet) Convert any old model values in a change set to the corresponding SNMP value and store that SNMP value in the change set for further processing.- Parameters:
variableBindingMapper
- the variable binding mapper used for the conversion.changeSet
- the change set to be modified.
-