Class SnmpProxyObjectHelper

java.lang.Object
org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectHelper

public abstract class SnmpProxyObjectHelper extends Object
The SnmpProxyObjectHelper is an utility class that helps map model values to SNMP and vice versa.
Author:
Frank Fock
  • 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 of objects.
      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 of vbs 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.