xmlBlaster 2.1.0 API

org.xmlBlaster.engine.admin.extern.snmp
Class NodeTableObserver

java.lang.Object
  extended by org.xmlBlaster.engine.admin.extern.snmp.NodeTableObserver
All Implemented Interfaces:
Observer

public class NodeTableObserver
extends java.lang.Object
implements Observer

NodeTableObserver represents the observer side of an observer pattern. When NodeTableObserver receives an update notification from NodeTableSubject, it adds or removes an entry to/from nodeTable.

Version:
@VERSION@
Author:
Udo Thalmann

Field Summary
private  java.util.BitSet indexSet
           
private static int MAXINDX
           
private  NodeEntryImpl nodeEntryImpl
           
private  java.util.Hashtable nodeHashtable
           
private  NodeTable nodeTable
           
private  NodeTableSubject nodeTableSubject
           
private  java.util.Hashtable refCounts
           
private  jax.AgentXSession session
           
 
Constructor Summary
NodeTableObserver(NodeTableSubject nodeTableSubject, jax.AgentXSession session)
          Adds itself to the nodeTableSubject as observer.
 
Method Summary
 int decrement(java.lang.Integer nodeIndex)
          Decrements the referenced client entries of this node.
 java.lang.Integer getIndex(java.lang.String key)
          Returns an index to nodeTable given a nodeName.
 int increment(java.lang.Integer nodeIndex)
          Increments the referenced client entries of this node.
 void sendTrap(jax.AgentXSession session)
          For each node table entry sendTrap checks trap condition maxClients * clientThreshold < numClients.
 void update(Subject o)
          Adds or removes a node entry to/from the node table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeTableSubject

private NodeTableSubject nodeTableSubject

session

private jax.AgentXSession session

nodeEntryImpl

private NodeEntryImpl nodeEntryImpl

nodeTable

private NodeTable nodeTable

nodeHashtable

private java.util.Hashtable nodeHashtable

indexSet

private java.util.BitSet indexSet

refCounts

private java.util.Hashtable refCounts

MAXINDX

private static final int MAXINDX
See Also:
Constant Field Values
Constructor Detail

NodeTableObserver

public NodeTableObserver(NodeTableSubject nodeTableSubject,
                         jax.AgentXSession session)
Adds itself to the nodeTableSubject as observer. Creates a new nodeTable and adds it to the agentX session. Creates a Hashtable for (node, index) entries. Creates a BitSet for available indices. Creates a Hashtable for (node, reference) entries, where reference is a counter of referenced client entries.

Parameters:
NodeTableSubject - the subject, which calls the update method.
AgentXSession - the actual agentX session between master agent and subagent.
Method Detail

increment

public int increment(java.lang.Integer nodeIndex)
Increments the referenced client entries of this node.

Parameters:
NodeIndex - identifies a node entry in the node table.
Returns:
int number of referenced client entries or -1, if nodeIndex identifies no node in the node table.

decrement

public int decrement(java.lang.Integer nodeIndex)
Decrements the referenced client entries of this node.

Parameters:
NodeIndex - identifies a node entry in the node table.
Returns:
int number of referenced client entries or -1, if nodeIndex identifies no node in the node table.

sendTrap

public void sendTrap(jax.AgentXSession session)
For each node table entry sendTrap checks trap condition maxClients * clientThreshold < numClients. Sends a ClientTableThresholdOverflow trap if the condition is fulfilled.

Parameters:
AgentXSession - the actual agentX session between master agent and subagent.

getIndex

public java.lang.Integer getIndex(java.lang.String key)
Returns an index to nodeTable given a nodeName.

Parameters:
Key - nodeName-key to nodeHashtable.
Returns:
Integer index to nodeTable.

update

public void update(Subject o)
Adds or removes a node entry to/from the node table. Updates node indexSet. Updates nodeHashtable.

Specified by:
update in interface Observer
Parameters:
Subject - clientTableSubject which calls update.

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.