com.adventnet.snmp.snmp2
Class SnmpProxyTable

java.lang.Object
  extended by com.adventnet.snmp.snmp2.SnmpProxyTable
All Implemented Interfaces:
java.io.Serializable

public class SnmpProxyTable
extends java.lang.Object
implements java.io.Serializable

This class maintains a list of all SnmpProxyEntry objects and provides methods to operate on the list. Methods are provided to add, retrive and remove SnmpProxyEnrty objects. The API user need not instantiate this class as it is instantiated from the SnmpAPI constructor. The SnmpAPI provides methods to access the SnmpProxyTable instance. Once a new SnmpProxyEntry object is created, it has to be added to the the SnmpProxyTable using the add method provided.

See Also:
SnmpProxyEntry, SnmpAPI, Serialized Form

Field Summary
(package private)  java.util.Vector proxyList
           
 
Constructor Summary
SnmpProxyTable()
           
 
Method Summary
 boolean addEntry(SnmpProxyEntry proxyEntry)
          Adds the SnmpProxyEntry object to the list of SnmpProxyEntry objects maintained in this class.
 void deSerialize()
          DeSerializes the SnmpProxyEntry objects from the file "ProxyTable.ser" to get a list of SnmpProxyEntry objects.
 void deSerialize(java.io.ObjectInputStream in)
          DeSerializes the SnmpProxyEntry objects from the particular input Stream to the list of SnmpProxyEntry objects.
 SnmpProxyEntry getEntry(byte[] proxyName)
          Returns the SnmpProxyEntry object corresponding to the particular snmpProxyName from the list of SnmpProxyEntry objects.
 java.util.Enumeration getEnumeration()
          Returns an enumeration of all the SnmpProxyEntry objects maintaied in this class.
 void removeAllEntries()
          Deletes all the SnmpProxyEntry objects maintained in this class.
 void removeEntry(byte[] proxyName)
          Deletes the SnmpProxyEntry corresponding to the SnmpProxyName from the list of SnmpProxyEntry objects.
 void removeEntry(SnmpProxyEntry entry)
          Deletes this particlar SnmpProxyEntry object from the list of SnmpProxyEntry objects.
 void serialize()
          Stores the list of SnmpProxyTable objects in the serialized file "ProxyEntry.ser"
 void serialize(java.io.ObjectOutputStream out)
          Serializes the list of SnmpProxyEntry objects into particular output Stream specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxyList

java.util.Vector proxyList
Constructor Detail

SnmpProxyTable

SnmpProxyTable()
Method Detail

getEnumeration

public java.util.Enumeration getEnumeration()
Returns an enumeration of all the SnmpProxyEntry objects maintaied in this class.

Returns:
The enumeration of all the SnmpProxyEntry objects maintained in this class.

removeAllEntries

public void removeAllEntries()
Deletes all the SnmpProxyEntry objects maintained in this class. Thus the list which maintains the list of SnmpProxyEntry objects will be null.


addEntry

public boolean addEntry(SnmpProxyEntry proxyEntry)
Adds the SnmpProxyEntry object to the list of SnmpProxyEntry objects maintained in this class.

Parameters:
entry - The SnmpProxyEntry which needs to be added to the list of SnmpProxyEntry objects.
Returns:
True if the SnmpProxyEntry was successfully added to the list of SnmpProxyEntry objects. False if the SnmpProxyEntry object is already present in the list of SnmpProxyEntry objects.

getEntry

public SnmpProxyEntry getEntry(byte[] proxyName)
Returns the SnmpProxyEntry object corresponding to the particular snmpProxyName from the list of SnmpProxyEntry objects.

Parameters:
proxyName - The SnmpProxyName for which the SnmpProxyEntry object is to be retrived.
Returns:
The SnmpProxyEntry object corresponding to the proxyName from the list of SnmpProxyEntry objects.
Throws:
java.lang.NullPointerException - if the proxyName is null.

removeEntry

public void removeEntry(byte[] proxyName)
Deletes the SnmpProxyEntry corresponding to the SnmpProxyName from the list of SnmpProxyEntry objects.

Parameters:
proxyName - The snmpProxyName for which the SnmpProxyEntry object is to be deleted.
Throws:
java.lang.NullPointerException - if the proxyName is null.

removeEntry

public void removeEntry(SnmpProxyEntry entry)
Deletes this particlar SnmpProxyEntry object from the list of SnmpProxyEntry objects.

Parameters:
entry - The SnmpProxyEntry object that is to be deleted.

serialize

public void serialize()
Stores the list of SnmpProxyTable objects in the serialized file "ProxyEntry.ser"


serialize

public void serialize(java.io.ObjectOutputStream out)
Serializes the list of SnmpProxyEntry objects into particular output Stream specified.

Parameters:
out - The ObjectOutputStream for serialization

deSerialize

public void deSerialize()
DeSerializes the SnmpProxyEntry objects from the file "ProxyTable.ser" to get a list of SnmpProxyEntry objects.


deSerialize

public void deSerialize(java.io.ObjectInputStream in)
DeSerializes the SnmpProxyEntry objects from the particular input Stream to the list of SnmpProxyEntry objects.

Parameters:
in - The ObjectInputStream for deSerialization