com.agentpp.explorer.script.external
Interface PDU


public interface PDU

A protocol data unit (PDU) is the basic unit of information exchange between two SNMP protocol entities. It consists of a type, a list of VariableBindings, and error indicators. Since the script API of MIB Explorer does only support synchronous requests, a request ID is not part of this PDU class.

Since:
1.5
Version:
1.6.4

Method Summary
 void appendNullVariable(java.lang.String oid)
          Appends a variable binding to the PDU with a Null value.
 VariableBinding appendVariable(java.lang.String oid)
          Appends a variable binding to the PDU.
 PDU getSubPDU(int fromIndex, int maxLength)
          Gets a new PDU object from this one with a subset of its variable bindings.
 VariableBinding getVariableByOid(java.lang.String oid)
          Gets the first VariableBinding instance of the PDU whose OID matches the given OID.
 java.util.Vector getVariables()
          Gets the variable bindings of the PDU.
 boolean saveToFile(java.lang.String path)
          Saves this PDU instance as a file under the specified name.
 void setMaxRepetitions(int maxRepetitions)
          Sets the number of maximum repetitions for GETBULK requests.
 void setNonRepeaters(int nonRepeaters)
          Sets the number of non repeaters of GETBULK requests.
 

Method Detail

getVariables

java.util.Vector getVariables()
Gets the variable bindings of the PDU.

Returns:
a Vector of VariableBinding instances.

getVariableByOid

VariableBinding getVariableByOid(java.lang.String oid)
Gets the first VariableBinding instance of the PDU whose OID matches the given OID.

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"
Returns:
a VariableBinding if such an instance could be found or null otherwise.

appendVariable

VariableBinding appendVariable(java.lang.String oid)
Appends a variable binding to the PDU.

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.
Returns:
the VariableBinding instance which has been appended to the PDU, if the given oid denotes an OBJECT-TYPE definition that can be found in the currently loaded MIB modules. Otherwise, null is returned.

appendNullVariable

void appendNullVariable(java.lang.String oid)
Appends a variable binding to the PDU with a Null value.

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.
Since:
1.6.4

saveToFile

boolean saveToFile(java.lang.String path)
Saves this PDU instance as a file under the specified name. If you want to save this PDU relative to the current PDU search directory then prepend the string returned by Snmp.getPduDirectory()) to path.

Parameters:
path - the file path under which this PDU is saved.
Returns:
true when saving the PDU was successful, false otherwise.
Since:
1.6.4

setMaxRepetitions

void setMaxRepetitions(int maxRepetitions)
Sets the number of maximum repetitions for GETBULK requests.

Parameters:
maxRepetitions - an integer value > 0.
Since:
1.6.4

setNonRepeaters

void setNonRepeaters(int nonRepeaters)
Sets the number of non repeaters of GETBULK requests.

Parameters:
nonRepeaters - an integer value > 0.
Since:
1.6.4

getSubPDU

PDU getSubPDU(int fromIndex,
              int maxLength)
Gets a new PDU object from this one with a subset of its variable bindings.

Parameters:
fromIndex - the first variable binding to include in the new PDU (starting from 0).
maxLength - the number of variable bindings to include in the new PDU.
Returns:
a copy of this PDU if fromIndex is less than the number of VBs in this PDU. The number of VBs in the returned PDU is then greater than one and less or equal length. If the number of VBs in the returned PDU would be zero null will be returned.
Since:
1.6.4

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