Interface PolymorphicVariableFormatter
- All Known Implementing Classes:
SmiManager
public interface PolymorphicVariableFormatter
Defines a polymorphic variable formatter that is able to format a variable according to the given OID and row data
using the currently configured available polymorphic
Variable implementations. If no such implementation is
available, the variable is formatted by the given VariableTextFormat implementation.- Since:
- 2.0.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionaddPolymorphicVariableTypeMapping(org.snmp4j.smi.OID typeColumnOID, PolymorphicColumnType polymorphicColumnType) Adds a polymorphic variable type mapping.formatVariable(org.snmp4j.smi.OID oid, org.snmp4j.smi.Variable variable, List<? extends org.snmp4j.smi.VariableBinding> rowData, org.snmp4j.util.VariableTextFormat fallbackFormatter) Formats a variable according to the given OID and row data using the currently configured available polymorphicVariableimplementations.removePolymorphicVariableTypeMapping(org.snmp4j.smi.OID variableColumnOID) Removes a polymorphic variable type mapping.
-
Method Details
-
formatVariable
String formatVariable(org.snmp4j.smi.OID oid, org.snmp4j.smi.Variable variable, List<? extends org.snmp4j.smi.VariableBinding> rowData, org.snmp4j.util.VariableTextFormat fallbackFormatter) Formats a variable according to the given OID and row data using the currently configured available polymorphicVariableimplementations. If no such implementation is available, the variable is formatted by the givenVariableTextFormatimplementation.- Parameters:
oid- the instance OID of the variable.variable- the variable to format.rowData- theVariableBindings available of the same row where the variable is located. If there is another column that has been associated per configuration with this columnoidand that column OID defines a polymorphicVariabletype for this column, then thisvariableis formatted using theVariableTextFormatthat is associated with the variable value of type-defining column.fallbackFormatter- the fallback formatter to use if no polymorphic implementation is available.- Returns:
- the formatted variable.
-
addPolymorphicVariableTypeMapping
PolymorphicColumnType addPolymorphicVariableTypeMapping(org.snmp4j.smi.OID typeColumnOID, PolymorphicColumnType polymorphicColumnType) Adds a polymorphic variable type mapping.- Parameters:
typeColumnOID- the OID of the column that defines the polymorphic variable type.polymorphicColumnType- the polymorphic variable type mapping.- Returns:
- the previously registered polymorphic variable type mapping or
nullif there was no such mapping.
-
removePolymorphicVariableTypeMapping
Removes a polymorphic variable type mapping.- Parameters:
variableColumnOID- the OID of the column that defines the polymorphic variable.- Returns:
- the removed polymorphic variable type mapping.
-