xmlBlaster 2.2.0 API

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

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

public class ClientTableObserver
extends java.lang.Object
implements Observer

ClientTableObserver represents the observer side of an observer pattern. When ClientTableObserver receives an update notification from ClientTableSubject, it adds or removes an entry to/from clientTable.

Version:
@VERSION@
Author:
Udo Thalmann

Field Summary
private  ClientEntryImpl clientEntryImpl
           
private  java.util.Hashtable clientHashtable
           
private  ClientTable clientTable
           
private  ClientTableSubject clientTableSubject
           
private  java.util.BitSet indexSet
           
private static int MAXINDX
           
private  java.util.Hashtable refCounts
           
private  jax.AgentXSession session
           
 
Constructor Summary
ClientTableObserver(ClientTableSubject clientTableSubject, jax.AgentXSession session)
          Adds itself to the clientTableSubject as observer.
 
Method Summary
 int decrement(java.lang.Integer clientIndex)
          Decrements the referenced session entries of this client.
 java.lang.Integer getIndex(java.lang.String key)
          Returns an index to clientTable given a (nodeName + clientName)-key.
 int increment(java.lang.Integer clientIndex)
          Increments the referenced session entries of this client.
 void sendTrap(jax.AgentXSession session)
          For each client table entry sendTrap checks trap condition clientQueueMaxEntries * clientQueueThreshold < clientQueueNumEntries.
 void update(Subject o)
          Adds or removes a client entry to/from the client table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientTableSubject

private ClientTableSubject clientTableSubject

session

private jax.AgentXSession session

clientEntryImpl

private ClientEntryImpl clientEntryImpl

clientTable

private ClientTable clientTable

clientHashtable

private java.util.Hashtable clientHashtable

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

ClientTableObserver

public ClientTableObserver(ClientTableSubject clientTableSubject,
                           jax.AgentXSession session)
Adds itself to the clientTableSubject as observer. Creates a new clientTable and adds it to the agentX session. Creates a Hashtable for (client, index) entries. Creates a BitSet for available indices. Creates a Hashtable for (client, reference) entries, where reference is a counter of referenced session entries.

Parameters:
ClientTableSubject - calls the update method.
AgentXSession - between master agent and subagent.
Method Detail

increment

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

Parameters:
ClientIndex - identifies a client entry in the client table.
Returns:
ReferenceCounter number of referenced session entries. -1, if clientIndex identifies no client in the client table.

decrement

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

Parameters:
Integer - clientIndex: identifies a client entry in the client table.
Returns:
ReferenceCounter number of referenced session entries. -1, if clientIndex identifies no client in the client table.

sendTrap

public void sendTrap(jax.AgentXSession session)
For each client table entry sendTrap checks trap condition clientQueueMaxEntries * clientQueueThreshold < clientQueueNumEntries. Sends a ClientQueueThresholdOverflow trap if the condition is fulfilled. Checks trap condition maxSessions * sessionThreshold < numSessions. Sends a SessionTableThresholdOverflow trap if the condition is fulfilled.

Parameters:
AgentXSession - between master agent and subagent.

getIndex

public java.lang.Integer getIndex(java.lang.String key)
Returns an index to clientTable given a (nodeName + clientName)-key.

Parameters:
Key - nodeName/clientName-key to clientHashtable.
Returns:
Index to clientTable.

update

public void update(Subject o)
Adds or removes a client entry to/from the client table. Updates client indexSet. Updates clientHashtable. Updates reference counter in nodeTableObserver.

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

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.