com.adventnet.snmp.snmp2
Class SnmpProxyModule

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.SnmpProxyModule

public class SnmpProxyModule
extends java.lang.Object

The SnmpProxyModule maintains the SnmpTargetAddrTable, SnmpTargetParamsTable and SnmpProxyTable. The API user need not instantiate these classes. It also has some method to validate the tagValues.


Field Summary
static byte CR_DELIMIT
          Constant for the ASCII carriage return(CR) delimiter character
static byte INFORM
          Constant for the SnmpProxyType inform
static byte LF_DELIMIT
          Constant for the ASCII line feed(LF) delimiter character
(package private)  SnmpProxyTable proxyTable
           
static byte READ
          Constant for the SnmpProxyType read
static byte SNMP_UDP_DOMAIN
          Constant for the SnmpUDPDomain
static byte SPACE_DELIMIT
          Constant for the ASCII space delimiter character
static byte TAB_DELIMIT
          Constant for the ASCII tab delimiter character
(package private)  SnmpTargetAddrTable targetAddrTable
           
(package private)  SnmpTargetParamsTable targetParamsTable
           
static byte TRAP
          Constant for the SnmpProxyType trap
static byte WRITE
          Constant for the SnmpProxyType write
 
Constructor Summary
SnmpProxyModule()
          Instantiates the SnmpTargetAddrTable, SnmpTargetParamsTable and SnmpProxyTable.
 
Method Summary
static int compareTo(byte[] first, byte[] second)
          Compares two byte arrays
(package private) static int getMinSize(byte[] a, byte[] b)
          Give the minimum size of two byte arrays.
 SnmpProxyTable getSnmpProxyTable()
          Returns the SnmpProxyTable associated with this instance.
 SnmpTargetAddrTable getTargetAddrTable()
          Returns the SnmpTargetAddrTable associated with this instance.
 SnmpTargetParamsTable getTargetParamsTable()
          Returns the SnmpTargetParamsTable associated with this instance.
static boolean validateTagValue(byte[] tag)
          Method to validate the SnmpTagValue.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SNMP_UDP_DOMAIN

public static final byte SNMP_UDP_DOMAIN
Constant for the SnmpUDPDomain

READ

public static final byte READ
Constant for the SnmpProxyType read

WRITE

public static final byte WRITE
Constant for the SnmpProxyType write

TRAP

public static final byte TRAP
Constant for the SnmpProxyType trap

INFORM

public static final byte INFORM
Constant for the SnmpProxyType inform

SPACE_DELIMIT

public static final byte SPACE_DELIMIT
Constant for the ASCII space delimiter character

TAB_DELIMIT

public static final byte TAB_DELIMIT
Constant for the ASCII tab delimiter character

CR_DELIMIT

public static final byte CR_DELIMIT
Constant for the ASCII carriage return(CR) delimiter character

LF_DELIMIT

public static final byte LF_DELIMIT
Constant for the ASCII line feed(LF) delimiter character

targetAddrTable

SnmpTargetAddrTable targetAddrTable

targetParamsTable

SnmpTargetParamsTable targetParamsTable

proxyTable

SnmpProxyTable proxyTable
Constructor Detail

SnmpProxyModule

public SnmpProxyModule()
Instantiates the SnmpTargetAddrTable, SnmpTargetParamsTable and SnmpProxyTable.
Method Detail

getTargetAddrTable

public SnmpTargetAddrTable getTargetAddrTable()
Returns the SnmpTargetAddrTable associated with this instance.
Returns:
The SnmpTargetAddrTable corresponding to this object.

getTargetParamsTable

public SnmpTargetParamsTable getTargetParamsTable()
Returns the SnmpTargetParamsTable associated with this instance.
Returns:
The SnmpTargetParamsTable corresponding to this object.

getSnmpProxyTable

public SnmpProxyTable getSnmpProxyTable()
Returns the SnmpProxyTable associated with this instance.
Returns:
The SnmpProxyTable corresponding to this object.

compareTo

public static int compareTo(byte[] first,
                            byte[] second)
Compares two byte arrays
Parameters:
first - The first array of bytes used for comparison.
second - The second array of bytes used for comparison.
Returns:
  • -1 if first param is lesser than second
  • 0 if equal
  • 1 if first param is greater than the second param

  • getMinSize

    static int getMinSize(byte[] a,
                          byte[] b)
    Give the minimum size of two byte arrays.
    Parameters:
    oid1 - array of integer
    oid2 - array of integer
    Returns:
    the minimum length of the given oids

    validateTagValue

    public static boolean validateTagValue(byte[] tag)
    Method to validate the SnmpTagValue. This method chacks the tag value for any of the delimiter characters. The delimiter characters are defined to be one of following: An ASCII space character (0x20) An ASCII TAB character (0x09) An ASCII carriage return (CR) character (0x0D) An ASCII line feed (LF) character (0x0B) The method returns true if no delimiter characters are found, false if the tag value contains any of the delimiter character.
    Parameters:
    tag - The tagValue to be validated for delimiter characters.
    Returns:
    true if no delimiter characters are found in the tag value. False, if the tag value contains any of the delimiter character.