com.adventnet.snmp.snmp2
Class SnmpTargetAddrTable

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

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

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

See Also:
SnmpTargetAddrEntry, SnmpAPI, Serialized Form

Constructor Summary
SnmpTargetAddrTable()
           
 
Method Summary
 boolean addEntry(SnmpTargetAddrEntry entry)
          Adds the SnmpTargetAddrEntry object to the list of SnmpTargetAddrEntry objects maintained in this class.
(package private) static boolean compare(byte[] a, byte[] b)
          A byte array comparison routine.
 void deSerialize()
          DeSerializes the SnmpTargetAddrEntry objects from the file "TargetAddrTable.ser" to get a list of SnmpTargetAddrEntry objects.
 void deSerialize(java.io.ObjectInputStream in)
          DeSerializes the SnmpTargetAddrEntry objects from the particular input Stream to the list of SnmpTargetAddrEntry objects.
 SnmpTargetAddrEntry getEntry(byte[] addrName)
          Returns the SnmpTargetAddrEntry object corresponding to the particular targetAddrName from the list of SnmpTargetAddrEntry objects.
 java.util.Enumeration getEnumeration()
          Returns an enumeration of all the SnmpTargetAddrEntry objects maintaied in this class.
 java.util.Enumeration getMatchingTagEntries(byte[] transportTag)
          Returns a Enumeration of SnmpTargetAddrEntries matching to the given transportTag.
 SnmpTargetAddrEntry getMatchingTagEntry(byte[] transportTag)
          Returns the SnmpTargetAddrEntry object corresponding to the particular transportTag from the list of SnmpTargetAddrEntry objects.
 void removeAllEntries()
          Deletes all the SnmpTargetAddrEntry objects maintained in this class.
 void removeEntry(byte[] addrName)
          Deletes the SnmpTargetAddrEntry corresponding to the addrName from the list of SnmpTargetAddrEntry objects.
 void removeEntry(SnmpTargetAddrEntry entry)
          Deletes this particlar SnmpTargetAddrEntry object from the list of SnmpTargetAddrEntry objects.
 void serialize()
          Stores the list of SnmpTargetAddrEntry objects in the serialized file "TargetAddrTable.ser"
 void serialize(java.io.ObjectOutputStream out)
          Serializes the list of SnmpTargetAddrEntry objects into particular output Stream specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpTargetAddrTable

SnmpTargetAddrTable()
Method Detail

getEnumeration

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

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

removeAllEntries

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


addEntry

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

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

getEntry

public SnmpTargetAddrEntry getEntry(byte[] addrName)
Returns the SnmpTargetAddrEntry object corresponding to the particular targetAddrName from the list of SnmpTargetAddrEntry objects.

Parameters:
addrName - The SnmpTargetAddrName for which the SnmpTargetAddrEntry object is to be retrived.
Returns:
The SnmpTargetAddrEntry object corresponding to the SnmpTargetAddrName from the list of SnmpTargetAddrEntry objects, null if the entry corresponding to the addrName is not present.

getMatchingTagEntry

public SnmpTargetAddrEntry getMatchingTagEntry(byte[] transportTag)
Returns the SnmpTargetAddrEntry object corresponding to the particular transportTag from the list of SnmpTargetAddrEntry objects.

Parameters:
transportTag - The SnmpTag for which the SnmpTargetAddrEntry object is to be retrived.
Returns:
The SnmpTargetAddrEntry object corresponding to the SnmpTag from the list of SnmpTargetAddrEntry objects, null if no match is found.

getMatchingTagEntries

public java.util.Enumeration getMatchingTagEntries(byte[] transportTag)
Returns a Enumeration of SnmpTargetAddrEntries matching to the given transportTag.

Parameters:
transportTag - The SnmpTag for which the SnmpTargetAddrEntry objects are to be retrived.
Returns:
The SnmpTargetAddrEntries matching the given tag as a Enumeration. null if no matching entry is found.

removeEntry

public void removeEntry(byte[] addrName)
Deletes the SnmpTargetAddrEntry corresponding to the addrName from the list of SnmpTargetAddrEntry objects.

Parameters:
addrName - The targetAddrName for which the SnmpTargetAddrEntry object is to be deleted.

removeEntry

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

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

serialize

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


serialize

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

Parameters:
out - The ObjectOutputStream for serialization

deSerialize

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


deSerialize

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

Parameters:
in - The ObjectInputStream for deSerialization

compare

static boolean compare(byte[] a,
                       byte[] b)
A byte array comparison routine. Returns true if equal.