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
-
identity
- A name given to
SnmpVarbindList.
-
SnmpVarbindList()
- Prepares an empty list.
-
SnmpVarbindList(SnmpVarbindList)
- Similar to the copy constructor.
-
SnmpVarbindList(String)
- Prepares an empty list with a string to print while debugging.
-
addInstance(String)
- Adds the string as an instance part to all OIDs in this list.
-
addVarbindList(SnmpVarbindList)
- Appends a
SnmpVarbindList at the end of the current SnmpVarbindList
object.
-
addVariable(SnmpVar)
- Appends the given
SnmpVar object to the existing
SnmpVarbindList.
-
addVariable(String)
- Creates an
SnmpVar object from the given MIB variable
and appends it to the existing SnmpVarbindList.
-
addVariable(String[])
- Adds a array of MIB variable names to the list.
-
addVariable(String[], String)
- Prepares a Vector of
SnmpVarbindList
from an array of SNMP MIB variables and instances.
-
checkForUnspecifiedValue()
- Returns true if there is a value that is not specified.
-
checkForValidValues()
- Returns false if any of the variable does not contain a valid value.
-
clone()
- Clones the session.
-
cloneWithoutValue()
- Clones the
SnmpVarbindList.
-
cloneWithValue()
- Clones the session.
-
concat(Vector)
- Adds elements in the specified
SnmpVarbindList to this list.
-
finalize()
- Removes all the elements from the
SnmpVarbindList
-
getSnmpVarAt(int)
- This is a convenience method used to get the
SnmpVar object.
-
getTimestamp()
- Returns timestamp associated with this
SnmpVarbindList.
-
getVarbindEnumeration()
- This is a convenience function that returns an enumeration.
-
getVariableCount()
- Returns the number of elements in this list.
-
indexOfOid(SnmpOid)
- Gives the index of an OID in the
SnmpVarbindList.
-
indexOfOid(SnmpVar)
- Gives the index of an OID in the
SnmpVarbindList.
-
indexOfOid(SnmpVar, int, int)
- Gives the index of an OID in the
SnmpVarbindList.
-
oidListToString()
- Returns a string containing the ASCII representation of all
OIDs in the list.
-
replaceVariable(SnmpVar, int)
- Replaces an element at specified location with the
new element.
-
setTimestamp(Timestamp)
- Records the
sysUpTime and the actual time when this
SnmpVarbindList was changed or created.
-
setVarbindList(Vector)
- Replaces the current list of varbinds with the new varbind.
-
setVarbindList(Vector, boolean)
- Replaces the current list of varbinds with the new varbind
specified.
-
splitAt(int)
- Splits the
SnmpVarbindList.
-
vbListToString()
- Constructs a string containing details of each
SnmpVarbindList
(oid+value).
identity
public String identity
- A name given to
SnmpVarbindList. Useful for debugging.
The default name is "VarbindList".
SnmpVarbindList
public SnmpVarbindList()
- Prepares an empty list.
SnmpVarbindList
public SnmpVarbindList(String s)
- Prepares an empty list with a string to print while debugging.
SnmpVarbindList
public SnmpVarbindList(SnmpVarbindList lst)
- Similar to the copy constructor. Does a shallow copy of the elements.
Individual elements are not cloned.
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.
getTimestamp
public Timestamp getTimestamp()
- Returns timestamp associated with this
SnmpVarbindList.
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.
getVariableCount
public synchronized int getVariableCount()
- Returns the number of elements in this list.
- Returns:
- number of elements in the list.
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
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.
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.
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
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.
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
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.
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
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
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
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
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.
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.
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.
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.
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.
checkForValidValues
public synchronized boolean checkForValidValues()
- Returns false if any of the variable does not contain a valid value.
Typically, used for
SnmpSet operations.
checkForUnspecifiedValue
public synchronized boolean checkForUnspecifiedValue()
- Returns true if there is a value that is not specified.
addVarbindList
public synchronized void addVarbindList(SnmpVarbindList vblst)
- Appends a
SnmpVarbindList at the end of the current SnmpVarbindList
object.
- Parameters:
- vblst - The
SnmpVarbindList to append.
finalize
public void finalize()
- Removes all the elements from the
SnmpVarbindList
- Overrides:
- finalize in class Object
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).
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
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