All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.jaw.snmp.manager.SnmpVarbindList

java.lang.Object
   |
   +----java.util.Vector
           |
           +----com.sun.jaw.snmp.manager.SnmpVarbindList

public class SnmpVarbindList
extends Vector
SnmpVarbindList contains a list of SnmpVar objects. This class helps create a SnmpVarbindList from a list of MIB variable names. In addition it contains methods of different form which can copy or clone the list. This list is required by the SnmpSession which specifies a list of variables to query.

See Also:
SnmpVar, SnmpSession

Variable Index

 o identity
A name given to SnmpVarbindList.

Constructor Index

 o SnmpVarbindList()
Prepares an empty list.
 o SnmpVarbindList(SnmpVarbindList)
Similar to the copy constructor.
 o SnmpVarbindList(String)
Prepares an empty list with a string to print while debugging.

Method Index

 o addInstance(String)
Adds the string as an instance part to all OIDs in this list.
 o addVarbindList(SnmpVarbindList)
Appends a SnmpVarbindList at the end of the current SnmpVarbindList object.
 o addVariable(SnmpVar)
Appends the given SnmpVar object to the existing SnmpVarbindList.
 o addVariable(String)
Creates an SnmpVar object from the given MIB variable and appends it to the existing SnmpVarbindList.
 o addVariable(String[])
Adds a array of MIB variable names to the list.
 o addVariable(String[], String)
Prepares a Vector of SnmpVarbindList from an array of SNMP MIB variables and instances.
 o checkForUnspecifiedValue()
Returns true if there is a value that is not specified.
 o checkForValidValues()
Returns false if any of the variable does not contain a valid value.
 o clone()
Clones the session.
 o cloneWithoutValue()
Clones the SnmpVarbindList.
 o cloneWithValue()
Clones the session.
 o concat(Vector)
Adds elements in the specified SnmpVarbindList to this list.
 o finalize()
Removes all the elements from the SnmpVarbindList
 o getSnmpVarAt(int)
This is a convenience method used to get the SnmpVar object.
 o getTimestamp()
Returns timestamp associated with this SnmpVarbindList.
 o getVarbindEnumeration()
This is a convenience function that returns an enumeration.
 o getVariableCount()
Returns the number of elements in this list.
 o indexOfOid(SnmpOid)
Gives the index of an OID in the SnmpVarbindList.
 o indexOfOid(SnmpVar)
Gives the index of an OID in the SnmpVarbindList.
 o indexOfOid(SnmpVar, int, int)
Gives the index of an OID in the SnmpVarbindList.
 o oidListToString()
Returns a string containing the ASCII representation of all OIDs in the list.
 o replaceVariable(SnmpVar, int)
Replaces an element at specified location with the new element.
 o setTimestamp(Timestamp)
Records the sysUpTime and the actual time when this SnmpVarbindList was changed or created.
 o setVarbindList(Vector)
Replaces the current list of varbinds with the new varbind.
 o setVarbindList(Vector, boolean)
Replaces the current list of varbinds with the new varbind specified.
 o splitAt(int)
Splits the SnmpVarbindList.
 o vbListToString()
Constructs a string containing details of each SnmpVarbindList (oid+value).

Variables

 o identity
 public String identity
A name given to SnmpVarbindList. Useful for debugging. The default name is "VarbindList".

Constructors

 o SnmpVarbindList
 public SnmpVarbindList()
Prepares an empty list.

 o SnmpVarbindList
 public SnmpVarbindList(String s)
Prepares an empty list with a string to print while debugging.

 o SnmpVarbindList
 public SnmpVarbindList(SnmpVarbindList lst)
Similar to the copy constructor. Does a shallow copy of the elements. Individual elements are not cloned.

Methods

 o setTimestamp
 public void setTimestamp(Timestamp tstamp)
Records the sysUpTime and the actual time when this SnmpVarbindList was changed or created. This needs to be set explicitly.

Parameters:
tstamp - The SnmpTimestamp of the device for which the values hold true.
when - The time when the SnmpVarbindList was updated.
 o getTimestamp
 public Timestamp getTimestamp()
Returns timestamp associated with this SnmpVarbindList.

 o getSnmpVarAt
 public final synchronized SnmpVar getSnmpVarAt(int pos)
This is a convenience method used to get the SnmpVar object.

Parameters:
pos - The position in list.
Returns:
the SnmpVar object at the specified position.
Throws: ArrayIndexOutOfBoundsException
if pos is beyond range.
 o getVariableCount
 public synchronized int getVariableCount()
Returns the number of elements in this list.

Returns:
number of elements in the list.
 o getVarbindEnumeration
 public synchronized Enumeration getVarbindEnumeration()
This is a convenience function that returns an enumeration. This can be used to traverse the list. This is advantageous as it hides the implementation of the class of the list which keeps the variables.

Returns:
Enumeration object.
See Also:
Enumeration
 o oidListToString
 public String oidListToString()
Returns a string containing the ASCII representation of all OIDs in the list.

Returns:
ASCII list of all OIDs in this list.
 o vbListToString
 public synchronized String vbListToString()
Constructs a string containing details of each SnmpVarbindList (oid+value). This is used typically in debugging.

Returns:
detailed string of all in the SnmpVarbindList.
 o setVarbindList
 public final synchronized void setVarbindList(Vector list)
Replaces the current list of varbinds with the new varbind. This method only clones the vector. It does not clone the SnmpVar object contained in the list.

Parameters:
list - Vector of SnmpVar.
See Also:
SnmpVar, SnmpSession
 o concat
 public final synchronized void concat(Vector list)
Adds elements in the specified SnmpVarbindList to this list. The elements are not cloned.

Parameters:
list - Vector of SnmpVar.
 o setVarbindList
 public final synchronized void setVarbindList(Vector list,
                                               boolean copy)
Replaces the current list of varbinds with the new varbind specified. If copy is true, it will clone each SnmpVar object contained in the list.

Parameters:
list - Vector of SnmpVar.
copy - Flag indicating whether each object in the list should be cloned.
See Also:
SnmpVar, SnmpSession
 o replaceVariable
 public final synchronized void replaceVariable(SnmpVar newvar,
                                                int pos)
Replaces an element at specified location with the new element.

Parameters:
newvar - The replacement variable.
pos - The location in the SnmpVarbindList.
Throws: ArrayIndexOutOfBoundsException
if pos is beyond range.
 o addVariable
 public final synchronized void addVariable(String vlist[],
                                            String inst) throws SnmpStatusException
Prepares a Vector of SnmpVarbindList from an array of SNMP MIB variables and instances. It does not affect the session at all (to be moved to a different class).

Parameters:
vlist - Array of String containing MIB variable names.
inst - Common instance for each of the MIB variable in vlist.
Throws: SnmpStatusException
if the MIB variable is not found.
See Also:
SnmpVar
 o addVariable
 public synchronized void addVariable(String vlist[]) throws SnmpStatusException
Adds a array of MIB variable names to the list. For example:

String mylist[] = {"sysUpTime", "ifInOctets"}
vb.addVariable(mylist) ;

Parameters:
vlist - The array of MIB variables names.
Throws: SnmpStatusException
if the MIB variable is not found.
See Also:
SnmpVar
 o addVariable
 public synchronized void addVariable(SnmpVar vars)
Appends the given SnmpVar object to the existing SnmpVarbindList. It creates a new SnmpVarbindList if it did not exist.

Parameters:
vars - An SnmpVar object to be appended.
Throws: SnmpStatusException
if session is already active.
See Also:
SnmpVar
 o addVariable
 public synchronized void addVariable(String s) throws SnmpStatusException
Creates an SnmpVar object from the given MIB variable and appends it to the existing SnmpVarbindList. It creates a new SnmpVarbindList if there it did not exist.

Parameters:
s - A MIB variable name.
Throws: SnmpStatusException
if session is already active or MIB variable not found.
See Also:
SnmpVar
 o addInstance
 public synchronized void addInstance(String inst) throws SnmpStatusException
Adds the string as an instance part to all OIDs in this list. This method should be used with caution because it affects all OIDs in the list.

Parameters:
inst - The string to add as an instance part.
Throws: SnmpStatusException
An error occurred while accessing a MIB node.
 o splitAt
 public synchronized SnmpVarbindList splitAt(int atPosition)
Splits the SnmpVarbindList.

Parameters:
atposition - The position to split the SnmpVarbindList
Returns:
The SnmpVarbindList list from the beginning up to the split position.
 o indexOfOid
 public synchronized int indexOfOid(SnmpVar svar,
                                    int start,
                                    int end)
Gives the index of an OID in the SnmpVarbindList. The index returned must be greater than or equal to the start parameter and smaller than end parameter. Otherwise the method returns -1.

Parameters:
svar - the SnmpVar object with the requested OID.
start - the min index in SnmpVarbindList.
end - the max index in SnmpVarbindList.
Returns:
The index of the OID in SnmpVarbindList.
 o indexOfOid
 public synchronized int indexOfOid(SnmpVar svar)
Gives the index of an OID in the SnmpVarbindList.

Parameters:
svar - the SnmpVar object with the requested OID.
Returns:
The index of the OID in SnmpVarbindList.
 o indexOfOid
 public synchronized int indexOfOid(SnmpOid oidarg)
Gives the index of an OID in the SnmpVarbindList.

Parameters:
oidarg - the SnmpOid object with the requested OID.
Returns:
The index of the OID in SnmpVarbindList.
 o checkForValidValues
 public synchronized boolean checkForValidValues()
Returns false if any of the variable does not contain a valid value. Typically, used for SnmpSet operations.

 o checkForUnspecifiedValue
 public synchronized boolean checkForUnspecifiedValue()
Returns true if there is a value that is not specified.

 o addVarbindList
 public synchronized void addVarbindList(SnmpVarbindList vblst)
Appends a SnmpVarbindList at the end of the current SnmpVarbindList object.

Parameters:
vblst - The SnmpVarbindList to append.
 o finalize
 public void finalize()
Removes all the elements from the SnmpVarbindList

Overrides:
finalize in class Object
 o cloneWithoutValue
 public synchronized SnmpVarbindList cloneWithoutValue()
Clones the SnmpVarbindList. It does not clone the value part of the variable. It is a deep copy (except for the value portion).

 o clone
 public synchronized Object clone()
Clones the session. A new copy of the SnmpVarbindList is created. It is a real deep copy.

Overrides:
clone in class Vector
 o cloneWithValue
 public synchronized SnmpVarbindList cloneWithValue()
Clones the session. A new copy of the SnmpVarbindList is created. It is a real deep copy.


All Packages  Class Hierarchy  This Package  Previous  Next  Index