SNMP Stack 5_1

uk.co.westhawk.examplev2c
Class MonitorAsteriskActiveChannels

java.lang.Object
  |
  +--uk.co.westhawk.examplev2c.MonitorAsteriskActiveChannels
All Implemented Interfaces:
java.util.Observer, java.lang.Runnable

public class MonitorAsteriskActiveChannels
extends java.lang.Object
implements java.util.Observer, java.lang.Runnable

This class is written to test the Asterisk host functionality.

It walks the tree by creating a new AsteriskChanTablePdu out off the previous one, and it collects the values of all the channels.

The information will be printed to System.out .

The host, port, community name and sockettype can be configured in the properties file. The name of the properties file can be passed as first argument to this application. If there is no such argument, it will look for MonitorAsteriskActiveChannels.properties. If this file does not exist, the application will use default parameters.

Version:
$Revision: 1.1 $ $Date: 2006/03/23 13:44:57 $
Author:
Birgit Arkesteijn

Field Summary
static long SLEEPTIME
          Use 10 (sec) as interval
 
Constructor Summary
MonitorAsteriskActiveChannels(java.lang.String propertiesFilename)
          Constructor.
 
Method Summary
 void getActiveChannels(SnmpContextBasisFace con, AsteriskChanTablePdu prev)
          Sends a request, asking for the active channels.
 void init()
           
static void main(java.lang.String[] args)
          Main.
 void run()
           
 void start()
           
 void update(java.util.Observable obs, java.lang.Object ov)
          Implementing the Observer interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SLEEPTIME

public static final long SLEEPTIME
Use 10 (sec) as interval

See Also:
Constant Field Values
Constructor Detail

MonitorAsteriskActiveChannels

public MonitorAsteriskActiveChannels(java.lang.String propertiesFilename)
Constructor.

Parameters:
propertiesFilename - The name of the properties file. Can be null.
Method Detail

init

public void init()

getActiveChannels

public void getActiveChannels(SnmpContextBasisFace con,
                              AsteriskChanTablePdu prev)
Sends a request, asking for the active channels.


start

public void start()

run

public void run()
Specified by:
run in interface java.lang.Runnable

update

public void update(java.util.Observable obs,
                   java.lang.Object ov)
Implementing the Observer interface. Receiving the response from * getActiveChannels().

Specified by:
update in interface java.util.Observer
Parameters:
obs - the pdu variable
ov - the array of varbind (not used)
See Also:
AsteriskChanTablePdu, getActiveChannels(uk.co.westhawk.snmp.stack.SnmpContextBasisFace, uk.co.westhawk.examplev2c.AsteriskChanTablePdu)

main

public static void main(java.lang.String[] args)
Main. To use a properties file different from MonitorAsteriskActiveChannels.properties, pass the name as first argument.


SNMP Stack 5_1