SNMP Stack 4_12

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.12 $ $Date: 2002/10/22 16:55:58 $
Author:
Birgit Arkesteijn
See Also:
TestSuite, TrapTestSuite

Field Summary
static java.lang.String ADO
           
static java.lang.String APASSW
           
static java.lang.String APROTO
           
static java.lang.String AUTH
           
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 int[] interval
           
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 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.
 DefaultTrapContext createTrapContext(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)
          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

APASSW

public static final java.lang.String APASSW

APROTO

public static final java.lang.String APROTO

AUTH

public static final java.lang.String AUTH

COMMENT

public static final java.lang.String COMMENT

COMMUNITY

public static final java.lang.String COMMUNITY

CONTEXT

public static final java.lang.String CONTEXT

GET

public static final java.lang.String GET

GETBULK

public static final java.lang.String GETBULK

GETNEXT

public static final java.lang.String GETNEXT

HOST

public static final java.lang.String HOST

ID

public static final java.lang.String ID

INFORM

public static final java.lang.String INFORM

MAX_REP

public static final java.lang.String MAX_REP

NAME

public static final java.lang.String NAME

NET

public static final java.lang.String NET

NON_REP

public static final java.lang.String NON_REP

OID

public static final java.lang.String OID

PORT

public static final java.lang.String PORT

PDO

public static final java.lang.String PDO

PPASSW

public static final java.lang.String PPASSW

PRIV

public static final java.lang.String PRIV

REQUEST

public static final java.lang.String REQUEST

SET

public static final java.lang.String SET

SOCKET_TYPE

public static final java.lang.String SOCKET_TYPE

STD

public static final java.lang.String STD

TYPE

public static final java.lang.String TYPE

USERNAME

public static final java.lang.String USERNAME

USM

public static final java.lang.String USM

VALUE

public static final java.lang.String VALUE

VARIABLE

public static final java.lang.String VARIABLE

VERSION

public static final java.lang.String VERSION

SNMPv2c

public static final java.lang.String SNMPv2c

SNMPv3

public static final java.lang.String SNMPv3

VNO

public static final java.lang.String VNO

YES

public static final java.lang.String YES

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)
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

createTrapContext

public DefaultTrapContext createTrapContext(org.w3c.dom.Node node)
                                     throws java.io.IOException
Returns the trap context specified in node.
Parameters:
node - The DOM node

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

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 4_12