com.amx.duet.tools.net.snmp
Class SNMPTrapConnection

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.amx.duet.tools.net.snmp.SNMPTrapConnection
All Implemented Interfaces:
java.lang.Runnable, SNMPv1TrapListener, SNMPv2TrapListener

public class SNMPTrapConnection
extends java.lang.Thread
implements SNMPv1TrapListener, SNMPv2TrapListener

This class is not complete...


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SNMPTrapConnection(java.net.InetAddress hostAddress, java.lang.String deviceMakeOID, java.lang.String community, SNMPTrapConnectionListener listener)
           
SNMPTrapConnection(int version, java.net.InetAddress hostAddress, java.lang.String deviceMakeOID, java.lang.String community, SNMPTrapConnectionListener listener)
           
SNMPTrapConnection(int version, java.lang.String hostAddress, java.lang.String deviceMakeOID, java.lang.String community, SNMPTrapConnectionListener listener)
           
SNMPTrapConnection(java.lang.String hostAddress, java.lang.String deviceMakeOID, java.lang.String community, SNMPTrapConnectionListener listener)
           
 
Method Summary
 void dispose()
           
 int getDebugState()
          Gets the current diagnostic state.
 java.lang.String getDeviceMakeOID()
          Retrieves the device's company Object Identifier in a String object.
 void processv1Trap(SNMPv1TrapPDU trapPDU)
           
 void processv2Trap(SNMPv2TrapPDU trapPDU)
           
 void run()
           
 void setDebug(boolean bState)
          Deprecated. Do not use this method; use setDebugState instead
 void setDebugState(int nState)
          Puts the class into a debug diagnostic state.
 boolean setDeviceMakeOID(java.lang.String makeOID)
          Defines the device's company Object Identifier.
 void startReceiving()
           
 void stopReceiving()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SNMPTrapConnection

public SNMPTrapConnection(int version,
                          java.net.InetAddress hostAddress,
                          java.lang.String deviceMakeOID,
                          java.lang.String community,
                          SNMPTrapConnectionListener listener)
Parameters:
version -
hostAddress -
deviceMakeOID -
community -
listener -

SNMPTrapConnection

public SNMPTrapConnection(int version,
                          java.lang.String hostAddress,
                          java.lang.String deviceMakeOID,
                          java.lang.String community,
                          SNMPTrapConnectionListener listener)
Parameters:
version -
hostAddress -
deviceMakeOID -
community -
listener -

SNMPTrapConnection

public SNMPTrapConnection(java.net.InetAddress hostAddress,
                          java.lang.String deviceMakeOID,
                          java.lang.String community,
                          SNMPTrapConnectionListener listener)
Parameters:
hostAddress -
deviceMakeOID -
community -
listener -

SNMPTrapConnection

public SNMPTrapConnection(java.lang.String hostAddress,
                          java.lang.String deviceMakeOID,
                          java.lang.String community,
                          SNMPTrapConnectionListener listener)
Parameters:
hostAddress -
deviceMakeOID -
community -
listener -
Method Detail

setDeviceMakeOID

public boolean setDeviceMakeOID(java.lang.String makeOID)
Defines the device's company Object Identifier. The company OID should be the prefix used for every OID used in the device's list of managed objects in its MIB hierarchy.

The MIB hierarchy can be depicted as a tree with a nameless root, the levels of which are assigned by different organizations. Vendors usually define private branches that include managed objects for their products. The level prior to the products branch is the company's OID.

Example:

 If the OID to get to a device variable looked like this:
 
 1.3.6.1.4.1.9.3.3.1
 
 The product OID might be:
 
 1.3.6.1.4.1.9.3
 
 And the company OID might be:
 
 1.3.6.1.4
 
 The call should look like this:
 boolean success = setDeviceMakeOID("1.3.6.1.4");
 
Basically, the company OID is the prefix ID for the product ID and the product ID is the prefix for the variable OID.

Parameters:
makeOID - String containing the company OID.
Returns:
true if the OID was valid; false otherwise.

getDeviceMakeOID

public java.lang.String getDeviceMakeOID()
Retrieves the device's company Object Identifier in a String object.

Returns:
String containing the company OID.

startReceiving

public void startReceiving()

stopReceiving

public void stopReceiving()

processv1Trap

public void processv1Trap(SNMPv1TrapPDU trapPDU)
Specified by:
processv1Trap in interface SNMPv1TrapListener

processv2Trap

public void processv2Trap(SNMPv2TrapPDU trapPDU)
Specified by:
processv2Trap in interface SNMPv2TrapListener

dispose

public void dispose()

run

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

setDebug

public void setDebug(boolean bState)
Deprecated. Do not use this method; use setDebugState instead

Parameters:
bState -

setDebugState

public void setDebugState(int nState)
Puts the class into a debug diagnostic state.

Parameters:
nState -

getDebugState

public int getDebugState()
Gets the current diagnostic state.

Returns:


Copyright © 2008 AMX LLC. All Rights Reserved.