Active Virtual Network Management Prediction (AVNMP) Classes

snmp.agent
Class AgentTable

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.TreeSet
                    |
                    +--snmp.agent.AgentTable
All Implemented Interfaces:
AgentTableInterface, java.lang.Cloneable, java.util.Collection, java.util.Comparator, java.io.Serializable, java.util.Set, java.util.SortedSet

public class AgentTable
extends java.util.TreeSet
implements AgentTableInterface, java.io.Serializable, java.util.Comparator

This class holds the "SubAgents" in sorted order. This research is funded by DARPA/ITO Contract Number: F30602-98-C-0230 supported by the Air Force Research Laboratory/IF.

Version:
$Revision: 1.1.1.1 $ $State: Exp $
Author:
Steve Bush
See Also:
Serialized Form

Constructor Summary
AgentTable()
          Construct empty TreeSet.
AgentTable(java.util.Collection al)
          Construct TreeSet from Collection.
AgentTable(java.util.SortedSet ss)
          Construct TreeSet from SortedSet.
 
Method Summary
 boolean add(java.lang.Object sa)
          Add a subagent to the sorted table.
 boolean addSubAgent(java.lang.String nOid, int val)
           
 boolean addSubAgent(java.lang.String nOid, long val)
           
 boolean addSubAgent(java.lang.String nOid, java.lang.String val)
           
 void addSubAgent(SubAgent sa)
          Add a managable object to this agent.
 int compare(java.lang.Object o1, java.lang.Object o2)
          This is required to keep the sub agents sorted by object id.
 void displaySubAgents()
          Display all the managed objects.
 int getIntSubAgent(java.lang.String oid)
           
 long getLongSubAgent(java.lang.String oid)
           
 SubAgent getNextSubAgent(AsnObjectId id)
          Get the next managed object based on object id.
 java.lang.String getNextSubAgent(java.lang.String oid)
           
 java.lang.String getStringSubAgent(java.lang.String oid)
           
 SubAgent getSubAgent(AsnObjectId id)
          Find the managed object by object id.
 boolean removeBranch(java.lang.String first_oid, java.lang.String last_oid)
           
 java.util.SortedSet removeBranch(SubAgent f_sa, SubAgent t_sa)
          Remove all subagents between two given subagent object ids.
 boolean removeSubAgent(java.lang.String oid)
           
 boolean updateSubAgent(java.lang.String Oid, int val, java.lang.String index)
          Add a managable object to this agent.
 boolean updateSubAgent(java.lang.String Oid, long val, java.lang.String index)
          Add a managable object to this agent.
 boolean updateSubAgent(java.lang.String Oid, java.lang.String val, java.lang.String index)
          Add a managable object to this agent.
 
Methods inherited from class java.util.TreeSet
addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

AgentTable

public AgentTable()
Construct empty TreeSet.

AgentTable

public AgentTable(java.util.Collection al)
Construct TreeSet from Collection.

AgentTable

public AgentTable(java.util.SortedSet ss)
Construct TreeSet from SortedSet.
Method Detail

updateSubAgent

public boolean updateSubAgent(java.lang.String Oid,
                              int val,
                              java.lang.String index)
Add a managable object to this agent. Replace the sub agent if it already exists in the table. This how updates are are performed.
Specified by:
updateSubAgent in interface AgentTableInterface
Parameters:
Oid - The object id for this value.
val - The value itself.

updateSubAgent

public boolean updateSubAgent(java.lang.String Oid,
                              long val,
                              java.lang.String index)
Add a managable object to this agent. Replace the sub agent if it already exists in the table. This how updates are are performed.
Specified by:
updateSubAgent in interface AgentTableInterface
Parameters:
Oid - The object id for this value.
val - The value itself.

updateSubAgent

public boolean updateSubAgent(java.lang.String Oid,
                              java.lang.String val,
                              java.lang.String index)
Add a managable object to this agent. Replace the sub agent if it already exists in the table. This how updates are are performed.
Specified by:
updateSubAgent in interface AgentTableInterface
Parameters:
Oid - The object id for this value.
val - The value itself.

addSubAgent

public boolean addSubAgent(java.lang.String nOid,
                           int val)
Specified by:
addSubAgent in interface AgentTableInterface

addSubAgent

public boolean addSubAgent(java.lang.String nOid,
                           long val)
Specified by:
addSubAgent in interface AgentTableInterface

addSubAgent

public boolean addSubAgent(java.lang.String nOid,
                           java.lang.String val)
Specified by:
addSubAgent in interface AgentTableInterface

addSubAgent

public void addSubAgent(SubAgent sa)
Add a managable object to this agent. Replace the sub agent if it already exists in the table. This how updates are are performed.
Parameters:
sa - The object information.

getIntSubAgent

public int getIntSubAgent(java.lang.String oid)
                   throws InvalidIdException
Specified by:
getIntSubAgent in interface AgentTableInterface

getLongSubAgent

public long getLongSubAgent(java.lang.String oid)
                     throws InvalidIdException
Specified by:
getLongSubAgent in interface AgentTableInterface

getStringSubAgent

public java.lang.String getStringSubAgent(java.lang.String oid)
                                   throws InvalidIdException
Specified by:
getStringSubAgent in interface AgentTableInterface

getSubAgent

public SubAgent getSubAgent(AsnObjectId id)
Find the managed object by object id.
Parameters:
id - The object id.
Returns:
The managed object information.

getNextSubAgent

public java.lang.String getNextSubAgent(java.lang.String oid)
Specified by:
getNextSubAgent in interface AgentTableInterface

getNextSubAgent

public SubAgent getNextSubAgent(AsnObjectId id)
Get the next managed object based on object id.
Parameters:
id - Object id.
Returns:
The managed object information.

displaySubAgents

public void displaySubAgents()
Display all the managed objects.

add

public boolean add(java.lang.Object sa)
Add a subagent to the sorted table.
Overrides:
add in class java.util.TreeSet

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
This is required to keep the sub agents sorted by object id.
Specified by:
compare in interface java.util.Comparator

removeSubAgent

public boolean removeSubAgent(java.lang.String oid)
Specified by:
removeSubAgent in interface AgentTableInterface

removeBranch

public boolean removeBranch(java.lang.String first_oid,
                            java.lang.String last_oid)
Specified by:
removeBranch in interface AgentTableInterface

removeBranch

public java.util.SortedSet removeBranch(SubAgent f_sa,
                                        SubAgent t_sa)
Remove all subagents between two given subagent object ids.
Parameters:
f_sa - From this subagent object id
t_sa - To this subagent object id
Returns:
The original sorted subagents with the range of sub agents removed.

Active Virtual Network Management Prediction (AVNMP) Classes