com.adventnet.snmp.snmp2.security.community
Class SnmpCommunityTable

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.SecurityModelTable
        |
        +--com.adventnet.snmp.snmp2.security.community.SnmpCommunityTable
All Implemented Interfaces:
java.io.Serializable

public class SnmpCommunityTable
extends SecurityModelTable
implements java.io.Serializable

This class maintains a list of all SnmpCommunityEntry objects and provides the methods to operate on the list.

See Also:
Serialized Form

Constructor Summary
SnmpCommunityTable()
           
 
Method Summary
 boolean addEntry(SecurityModelEntry entry)
          Adds the SnmpCommunityEntry object to the list of SnmpCommunityEntry objects, maintained in this class.
 void deSerialize()
          DeSerializes the file "CommunityEntry.ser" to get a list of SnmpCommunityEntry objects.
 void deSerialize(java.io.ObjectInputStream in)
          DeSerializes the SnmpCommunityEntry objects, from the particular input Stream, to the list of SnmpCommunityEntry objects.
 SnmpCommunityEntry getCommunityEntry(byte[] commName)
          Gets the SnmpCommunityEntry associated with the specified communityName.
 SnmpCommunityEntry getEntry(byte[] index)
          Gets the SnmpCommunityEntry associated with the specified key.
 SecurityModelEntry getEntry(java.lang.Object key)
          Gets the SnmpCommunityEntry associated with the specified key.
 java.util.Enumeration getEnumeration()
          Returns an enumeration of all the SnmpCommunityEntry objects maintained in this class.
 boolean modifyEntry(SecurityModelEntry entry)
          This method should locate an entry, using the key specified in the argument entry and modify the non-key parameters that are available in the entry.
 void removeAllEntries()
          Deletes all the SnmpCommunityEntry objects maintained in this class.
 boolean removeEntry(byte[] index)
          Deletes the SnmpCommunityEntry corresponding to the index, from the list of SnmpCommunityEntry objects.
 boolean removeEntry(SecurityModelEntry entry)
          Deletes this particlar SnmpCommunityEntry object, from the list of SnmpCommunityEntry objects.
 void serialize()
          Stores the list of SnmpCommunityEntry objects in the serialized file "CommunityEntry.ser"
 void serialize(java.io.ObjectOutputStream out)
          Serializes the list of SnmpCommunityEntry objects into particular output Stream specified.
 
Methods inherited from class com.adventnet.snmp.snmp2.SecurityModelTable
setDBOperations, setV3ConfigFlag, setV3DatabaseFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpCommunityTable

public SnmpCommunityTable()
Method Detail

getEnumeration

public java.util.Enumeration getEnumeration()
Returns an enumeration of all the SnmpCommunityEntry objects maintained in this class.
Overrides:
getEnumeration in class SecurityModelTable
Returns:
The enumeration of all the SnmpCommunityEntry objects maintained in this class.

removeAllEntries

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

addEntry

public boolean addEntry(SecurityModelEntry entry)
Adds the SnmpCommunityEntry object to the list of SnmpCommunityEntry objects, maintained in this class.
Overrides:
addEntry in class SecurityModelTable
Parameters:
entry - The SnmpCommunityEntry which needs to be added to the list of SnmpCommunityEntry objects.
Returns:
True, if the SnmpCommunityEntry was successfully added to the list of SnmpCommunityEntry objects. False, if the SnmpCommunityEntry object is already present in the list of SnmpCommunityEntry objects.

getEntry

public SecurityModelEntry getEntry(java.lang.Object key)
Gets the SnmpCommunityEntry associated with the specified key.
Overrides:
getEntry in class SecurityModelTable
Parameters:
key - The key corresponding to which, the SnmpCommunityEntry is to be retrieved.
Returns:
The SnmpCommunityEntry corresponding to the specified key, null, if the key does not map to any entry or the key is null.

getEntry

public SnmpCommunityEntry getEntry(byte[] index)
Gets the SnmpCommunityEntry associated with the specified key.
Parameters:
index - The index corresponding to which, the SnmpCommunityEntry is to be retrieved.
Returns:
The SnmpCommunityEntry corresponding to the specified key, null, if the index does not map to any entry or index value is null.

removeEntry

public boolean removeEntry(byte[] index)
Deletes the SnmpCommunityEntry corresponding to the index, from the list of SnmpCommunityEntry objects.
Parameters:
index - The index for which, the SnmpCommunityEntry object is to be deleted.
Returns:
true, if the entry corresponding to the index is deleted, otherwise false.

removeEntry

public boolean removeEntry(SecurityModelEntry entry)
Deletes this particlar SnmpCommunityEntry object, from the list of SnmpCommunityEntry objects.
Overrides:
removeEntry in class SecurityModelTable
Parameters:
entry - The SnmpCommunityEntry object that is to be deleted.
Returns:
true, if the entry is successfully deleted, otherwise false.

serialize

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

deSerialize

public void deSerialize()
DeSerializes the file "CommunityEntry.ser" to get a list of SnmpCommunityEntry objects.

modifyEntry

public boolean modifyEntry(SecurityModelEntry entry)
This method should locate an entry, using the key specified in the argument entry and modify the non-key parameters that are available in the entry. Note : API users should not call this method. This method has default implementation and returns false.
Overrides:
modifyEntry in class SecurityModelTable

serialize

public void serialize(java.io.ObjectOutputStream out)
Serializes the list of SnmpCommunityEntry objects into particular output Stream specified.
Overrides:
serialize in class SecurityModelTable
Parameters:
out - The ObjectOutputStream for serialization

deSerialize

public void deSerialize(java.io.ObjectInputStream in)
DeSerializes the SnmpCommunityEntry objects, from the particular input Stream, to the list of SnmpCommunityEntry objects.
Overrides:
deSerialize in class SecurityModelTable
Parameters:
in - The ObjectInputStream for deSerialization

getCommunityEntry

public SnmpCommunityEntry getCommunityEntry(byte[] commName)
Gets the SnmpCommunityEntry associated with the specified communityName.
Parameters:
commName - The communityName corresponding to which, the SnmpCommunityEntry is to be retrieved.
Returns:
The SnmpCommunityEntry, corresponding to the specified communityName. Null, if SnmpCommunityEntry is not present.


Copyright (c)AdventNet Inc., 1996-2004