OpenNMS API 1.2.9

## org.opennms.protocols.snmp
Interface SnmpSyntax

All Known Implementing Classes:
  SnmpCounter64, SnmpInt32, SnmpNull, SnmpObjectId, SnmpOctetString, SnmpPduPacket, SnmpPduTrap, SnmpUInt32, SnmpV2Error, SnmpVarBind

public interface SnmpSyntax

This class defines the interface that must be implemented by all object that can be passed or received to/from a SNMP agent and manager. These include intergers, counters, strings, etc al. The interface defines the methods for encoding and decoding buffers. It also defines the methods for duplicating objects and getting the ASN.1 type.

Version:
  1.1.1.1
Author:
  Brian Weaver

Method Summary
`int` `decodeASN(byte[] buf, int offset, AsnEncoder encoder)` Decodes the ASN.1 buffer and sets the values in the SnmpSyntax object.
`SnmpSyntax` `duplicate()` Creates a duplicate (in memory) object of the caller.
`int` `encodeASN(byte[] buf, int offset, AsnEncoder encoder)` Encodes the data object in the specified buffer using the AsnEncoder object
`byte` `typeId()` Returns the ASN.1 type of the implementor object.

Method Detail

### typeId

    public byte typeId()

  Returns the ASN.1 type of the implementor object.

### encodeASN

    public int encodeASN(byte[] buf,
                         int offset,
                         AsnEncoder encoder)
                  throws AsnEncodingException

  Encodes the data object in the specified buffer using the AsnEncoder object

  Parameters:
    `buf` - The buffer to write the encoded information
    `offset` - The location to start writing the encoded data
    `encoder` - The object used to encode the data
  Returns:
    Returns the offset in buf to the byte immedantly after the last encode byte for the SnmpSyntax file
  Throws:
    `AsnEncodingException` - Thrown if an encoding error occurs

### decodeASN

    public int decodeASN(byte[] buf,
                         int offset,
                         AsnEncoder encoder)
                  throws AsnDecodingException

  Decodes the ASN.1 buffer and sets the values in the SnmpSyntax object.

  Parameters:
    `buf` - The encoded data buffer
    `offset` - The offset of the first valid byte
    `encoder` - The object used to decode the ASN.1 data
  Returns:
    Returns the index to the byte of data immedantly after the last byte of encoded data.
  Throws:
    `AsnDecodingException` - Thrown if an encoding error occurs

### duplicate

    public SnmpSyntax duplicate()

  Creates a duplicate (in memory) object of the caller. Similar to the clone() method.

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.