com.agentpp.explorer.script.external
Interface VariableBinding


public interface VariableBinding

The VariableBinding interface represents an association between an SNMP OID (object identifier) and its associated value. A PDU contains a list of VariableBindings.

Since:
1.5
Version:
2.0

Method Summary
 java.lang.String getIndex()
          Gets the index portion of the OID of this variable binding.
 java.util.Vector getIndexValues()
          Gets the index values as a Vector of Integer, Long, or String.
 IObjectID getObjectID()
          Returns the OID of the variable binding as an IObjectID.
 java.lang.String getOid()
          Gets the OID of the variable binding.
 int getSyntax()
          Gets the syntax of the variable.
 java.lang.String getValue()
          Gets a String representation of the value.
 org.snmp4j.smi.Variable getVariable()
          Returns the value as a SNMP4J Variable instance.
 void setIndex(java.lang.String index)
          Sets the index index portion of the OID of this variable binding
 void setIndexValues(java.util.Vector values)
          Sets the index for this columnar object by a given Vector of values.
 void setOid(java.lang.String oid)
          Sets the OID of the variable binding.
 void setValue(java.lang.String value)
          Sets the value of the variable binding by providing a String representation of that value.
 

Method Detail

getOid

java.lang.String getOid()
Gets the OID of the variable binding.

Returns:
a String representing an OID as dotted string with numerical subidentifiers, for example "1.3.6.1".

getObjectID

IObjectID getObjectID()
Returns the OID of the variable binding as an IObjectID.

Returns:
an IObjectID instance.
Since:
2.0

getIndex

java.lang.String getIndex()
Gets the index portion of the OID of this variable binding.

Returns:
the index portion as a dotted String, for example if this variable binding's OID has been set to "tcp.13.1.1.127.0.0.1.1028.0.0.0.0.26723" this method would return "127.0.0.1.1028.0.0.0.0.26723". If the OID is not set or unknown null will be returned.

setIndex

void setIndex(java.lang.String index)
Sets the index index portion of the OID of this variable binding

Parameters:
index - the index portion as a dotted String, for example "127.0.0.1.1028.0.0.0.0.26723" for a column of the tcpConnTable.

setIndexValues

void setIndexValues(java.util.Vector values)
Sets the index for this columnar object by a given Vector of values.

Parameters:
values - a Vector of values. Each value has to correspond to a subindex object type of the table this columnar object belongs to. If this object is not a table or the values do not match with the INDEX clause of this table, the index will not be set. The values are interpreted by their String representation using their toString() method and the subindex syntax (including its DISPLAY-HINT format).

getIndexValues

java.util.Vector getIndexValues()
Gets the index values as a Vector of Integer, Long, or String.

Returns:
a Vector of subindex values or null if the index of the OID of this variable binding cannot be interpreted according to the table definition of this columnar object or if this is not a columnar object.

setOid

void setOid(java.lang.String oid)
Sets the OID of the variable binding. When specifying an object name as first subindentifier, the corresponding MIB module need to be loaded. Otherwise an error event will logged and "0.0" will be set.

Parameters:
oid - a String representing an OID as dotted String. The first subidentifier may denote an object name - all other subidentifiers have to be numerical. Examples: "ifAdminStatus.2", "1.3.6.1.2.1.2.2.1.7", "atmVclAdminStatus.1.0.64"

getValue

java.lang.String getValue()
Gets a String representation of the value. If MIB information is available and the object identified by the OID of this VB has a DISPLAY-HINT clause, the value is formatted accordingly. See also the MIB Explorer documentation (Set Dialog) for more information on value formats.

Returns:
a String representing the variable bindings value.

getVariable

org.snmp4j.smi.Variable getVariable()
Returns the value as a SNMP4J Variable instance. For JavaDoc on Variable see http://www.snmp4j.org/doc/org/snmp4j/smi/Variable.html

Returns:
the variable bindings value.
Since:
2.0

setValue

void setValue(java.lang.String value)
Sets the value of the variable binding by providing a String representation of that value. See also the MIB Explorer documentation (Set Dialog) for more information on value formats.

Parameters:
value - a String representing the variable bindings value.

getSyntax

int getSyntax()
Gets the syntax of the variable.

Returns:
an integer value representing the BER representation of the variable's syntax.

Copyright 2003-2011, Frank Fock, All Rights Reserved. http://www.mibexplorer.com