com.adventnet.snmp.snmp2.vacm
Class VacmContextTable

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.vacm.VacmContextTable

public class VacmContextTable
extends java.lang.Object

This class maintains a list of VacmContextEntry Objects for each contextName in the VacmContextEntry. It has methods to get, add and remove entries. The methods getEntry, addEntry and removeEntry relay on the getKey method in the VacmContextEntry to perform the respective operations. The API user need not instaniate this class as it is instantiated by the SnmpAPI constructor. The SnmpAPI provides methods to access the VacmContextTable.

See Also:
SnmpAPI

Method Summary
 boolean addEntry(VacmContextEntry entry)
          Adds the VacmContextEntry to the list of VacmContextEntry objects.
 void deSerialize(java.io.ObjectInputStream in)
          Reads the Context entries from the ObjectinputStream specified.
 VacmContextEntry getEntry(byte[] name)
          Returns the VacmContextEntry from the list of VacmContextEntry Objects corresponding to the context name specified.
 java.util.Enumeration getEnumeration()
          Returns an enumeration of the VacmContext entries
 boolean isExists(VacmContextEntry entry)
          This method returns true if this particular entry is present in the table or false otherwise.
 void removeAllEntries()
          Deletes all the VacmContext entries present in the list
 void removeEntry(byte[] name)
          Deletes the entry corresponding to contextName from the list of VacmContextEntry objects.
 void removeEntry(VacmContextEntry entry)
          Removes this contextEntry object from the list of VacmContextEntry objects.
 void serialize(java.io.ObjectOutputStream out)
          Writes the Context entries to the ObjectOutputStream specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addEntry

public boolean addEntry(VacmContextEntry entry)
Adds the VacmContextEntry to the list of VacmContextEntry objects.
Parameters:
entry - The VacmContextEntry object to be added
Returns:
true if entry is added successfully, else return false(if the entry is already present).

isExists

public boolean isExists(VacmContextEntry entry)
This method returns true if this particular entry is present in the table or false otherwise.
Parameters:
entry - The entry whose presence is to be checked in the table.
Returns:
true if this entry is present in this table or false otherwise. This method will return false if the argument is null or it's getKey method returns null.

removeAllEntries

public void removeAllEntries()
Deletes all the VacmContext entries present in the list

getEnumeration

public java.util.Enumeration getEnumeration()
Returns an enumeration of the VacmContext entries
Returns:
The enumeration of VacmContext entries

getEntry

public VacmContextEntry getEntry(byte[] name)
Returns the VacmContextEntry from the list of VacmContextEntry Objects corresponding to the context name specified.
Parameters:
name - The context name for which the entry is to be retrived
Returns:
VacmContextEntry. Returns null if the VacmContextEntry corresponding to the contextName is not present
Throws:
java.lang.NullPointerException - if name is null.

removeEntry

public void removeEntry(byte[] name)
Deletes the entry corresponding to contextName from the list of VacmContextEntry objects.
Parameters:
name - The contextName for which entry is to be removed

removeEntry

public void removeEntry(VacmContextEntry entry)
Removes this contextEntry object from the list of VacmContextEntry objects.
Parameters:
entry - The VacmContextEntry to be removed

serialize

public void serialize(java.io.ObjectOutputStream out)
Writes the Context entries to the ObjectOutputStream specified. The SnmpAPI provides a serialize method to serialize all the tables. This seriailize method is called from the SnmpAPI.

deSerialize

public void deSerialize(java.io.ObjectInputStream in)
Reads the Context entries from the ObjectinputStream specified. The SnmpAPI provides a deSerialize method to deSerialize all the tables. This deSeriailize method is called from the SnmpAPI.


Copyright (c)AdventNet Inc., 1996-2004