SNMP Stack 5_1

uk.co.westhawk.test
Class SnmpTarget

java.lang.Object
  |
  +--uk.co.westhawk.test.SnmpTarget

public class SnmpTarget
extends java.lang.Object

The SnmpTarget class performs tests specified according to DOM node. It is the helper class of TestSuite and TrapTestSuite.

Version:
$Revision: 1.16 $ $Date: 2006/02/08 12:54:12 $
Author:
Birgit Arkesteijn
See Also:
TestSuite, TrapTestSuite

Field Summary
static int[] _interval
           
static java.lang.String ADO
           
static java.lang.String APASSW
           
static java.lang.String APROTO
           
static java.lang.String AUTH
           
static java.lang.String BIND
           
static java.lang.String COMMENT
           
static java.lang.String COMMUNITY
           
static java.lang.String CONTEXT
           
static java.lang.String GET
           
static java.lang.String GETBULK
           
static java.lang.String GETNEXT
           
static java.lang.String HOST
           
static java.lang.String ID
           
static java.lang.String INFORM
           
static java.lang.String MAX_REP
           
static java.lang.String NAME
           
static java.lang.String NET
           
static java.lang.String NON_REP
           
static java.lang.String OID
           
static java.lang.String PDO
           
static java.lang.String PORT
           
static java.lang.String PPASSW
           
static java.lang.String PRIV
           
static java.lang.String REQUEST
           
static java.lang.String SET
           
static java.lang.String SNMPv2c
           
static java.lang.String SNMPv3
           
static java.lang.String SOCKET_TYPE
           
static java.lang.String STD
           
static java.lang.String TCP
           
static java.lang.String TYPE
           
static java.lang.String USERNAME
           
static java.lang.String USM
           
static java.lang.String VALUE
           
static java.lang.String VARIABLE
           
static java.lang.String VERSION
           
static java.lang.String VNO
           
static java.lang.String YES
           
 
Constructor Summary
SnmpTarget()
          The constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a property change listener.
 SnmpContextBasisFace createContext(org.w3c.dom.Node node)
          Returns the snmp context specified in node.
 ListeningContextPool createListeningContext(org.w3c.dom.Node node)
          Returns the trap context specified in node.
 java.util.Vector getOids(org.w3c.dom.Node node)
          Returns the varbind list of OIDs specified in node.
 int getPort(org.w3c.dom.Node node, int defValue)
          Returns the port number specified in node.
 java.lang.String getSocketType(org.w3c.dom.Node node)
          Returns the socket type specified in node.
 void performGetNextRequest(SnmpContextBasisFace con, java.lang.String oid, int[] retry_intervals)
          Performs a GetNextRequest with the specified context and OID.
 void performRequest(org.w3c.dom.Element node)
          Performs one request specified by node.
 void performTest(org.w3c.dom.Node node)
          Performs one or more tests specified by node.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a property change listener.
 void setUsm(SnmpContextv3Face c, org.w3c.dom.Node node)
          Sets the USM properties in the context according to node.
 void setWriter(java.io.PrintWriter w)
          Sets the writer to be used for all output.
protected  void tellThemWeAreReady()
          Fires a property change listener when all the requests have been answered.
 java.lang.String toString()
          Returns the string representation of the current context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADO

public static final java.lang.String ADO
See Also:
Constant Field Values

APASSW

public static final java.lang.String APASSW
See Also:
Constant Field Values

APROTO

public static final java.lang.String APROTO
See Also:
Constant Field Values

AUTH

public static final java.lang.String AUTH
See Also:
Constant Field Values

BIND

public static final java.lang.String BIND
See Also:
Constant Field Values

COMMENT

public static final java.lang.String COMMENT
See Also:
Constant Field Values

COMMUNITY

public static final java.lang.String COMMUNITY
See Also:
Constant Field Values

CONTEXT

public static final java.lang.String CONTEXT
See Also:
Constant Field Values

GET

public static final java.lang.String GET
See Also:
Constant Field Values

GETBULK

public static final java.lang.String GETBULK
See Also:
Constant Field Values

GETNEXT

public static final java.lang.String GETNEXT
See Also:
Constant Field Values

HOST

public static final java.lang.String HOST
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values

INFORM

public static final java.lang.String INFORM
See Also:
Constant Field Values

MAX_REP

public static final java.lang.String MAX_REP
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

NET

public static final java.lang.String NET
See Also:
Constant Field Values

NON_REP

public static final java.lang.String NON_REP
See Also:
Constant Field Values

OID

public static final java.lang.String OID
See Also:
Constant Field Values

PORT

public static final java.lang.String PORT
See Also:
Constant Field Values

PDO

public static final java.lang.String PDO
See Also:
Constant Field Values

PPASSW

public static final java.lang.String PPASSW
See Also:
Constant Field Values

PRIV

public static final java.lang.String PRIV
See Also:
Constant Field Values

REQUEST

public static final java.lang.String REQUEST
See Also:
Constant Field Values

SET

public static final java.lang.String SET
See Also:
Constant Field Values

SOCKET_TYPE

public static final java.lang.String SOCKET_TYPE
See Also:
Constant Field Values

STD

public static final java.lang.String STD
See Also:
Constant Field Values

TCP

public static final java.lang.String TCP
See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

USERNAME

public static final java.lang.String USERNAME
See Also:
Constant Field Values

USM

public static final java.lang.String USM
See Also:
Constant Field Values

VALUE

public static final java.lang.String VALUE
See Also:
Constant Field Values

VARIABLE

public static final java.lang.String VARIABLE
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

SNMPv2c

public static final java.lang.String SNMPv2c
See Also:
Constant Field Values

SNMPv3

public static final java.lang.String SNMPv3
See Also:
Constant Field Values

VNO

public static final java.lang.String VNO
See Also:
Constant Field Values

YES

public static final java.lang.String YES
See Also:
Constant Field Values

_interval

public static final int[] _interval
Constructor Detail

SnmpTarget

public SnmpTarget()
The constructor.

Method Detail

setWriter

public void setWriter(java.io.PrintWriter w)
Sets the writer to be used for all output. If not specified, System.out will be used.

Parameters:
w - The writer

performTest

public void performTest(org.w3c.dom.Node node)
Performs one or more tests specified by node. The context will be created out off the node and all the tests will be performed.

Parameters:
node - The DOM node

performRequest

public void performRequest(org.w3c.dom.Element node)
Performs one request specified by node.

Parameters:
node - The DOM node

performGetNextRequest

public void performGetNextRequest(SnmpContextBasisFace con,
                                  java.lang.String oid,
                                  int[] retry_intervals)
Performs a GetNextRequest with the specified context and OID.

Parameters:
con - The context
oid - The OID

getOids

public java.util.Vector getOids(org.w3c.dom.Node node)
Returns the varbind list of OIDs specified in node.

Parameters:
node - The DOM node

createListeningContext

public ListeningContextPool createListeningContext(org.w3c.dom.Node node)
                                            throws java.io.IOException
Returns the trap context specified in node.

Parameters:
node - The DOM node
java.io.IOException

createContext

public SnmpContextBasisFace createContext(org.w3c.dom.Node node)
                                   throws java.io.IOException
Returns the snmp context specified in node.

Parameters:
node - The DOM node
java.io.IOException

getSocketType

public java.lang.String getSocketType(org.w3c.dom.Node node)
Returns the socket type specified in node.

Parameters:
node - The DOM node

getPort

public int getPort(org.w3c.dom.Node node,
                   int defValue)
Returns the port number specified in node.

Parameters:
node - The DOM node
defValue - The default value

setUsm

public void setUsm(SnmpContextv3Face c,
                   org.w3c.dom.Node node)
Sets the USM properties in the context according to node.

Parameters:
c - The SNMPv3 context
node - The DOM node

toString

public java.lang.String toString()
Returns the string representation of the current context.

Overrides:
toString in class java.lang.Object

tellThemWeAreReady

protected void tellThemWeAreReady()
Fires a property change listener when all the requests have been answered.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener.

Parameters:
l - The listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener.

Parameters:
l - The listener

SNMP Stack 5_1