org.snmp4j
Class ScopedPDU

java.lang.Object
  extended by org.snmp4j.PDU
      extended by org.snmp4j.ScopedPDU
All Implemented Interfaces:
java.io.Serializable, BERSerializable

public class ScopedPDU
extends PDU

The ScopedPDU class represents a SNMPv3 scoped PDU.

Version:
1.0
Author:
Frank Fock
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.snmp4j.PDU
authorizationError, badValue, commitFailed, errorIndex, errorStatus, genErr, GET, GETBULK, GETNEXT, inconsistentName, inconsistentValue, INFORM, noAccess, noCreation, noError, noSuchName, NOTIFICATION, notWritable, readOnly, REPORT, requestID, resourceUnavailable, RESPONSE, SET, tooBig, TRAP, type, undoFailed, V1TRAP, variableBindings, wrongEncoding, wrongLength, wrongType, wrongValue
 
Constructor Summary
ScopedPDU()
          Create a empty ScopedPDU.
ScopedPDU(ScopedPDU other)
          Copy constructor.
 
Method Summary
 java.lang.Object clone()
           
 void decodeBER(BERInputStream inputStream)
          Decodes a ScopedPDU from an InputStream.
 void encodeBER(java.io.OutputStream outputStream)
          Encodes a Variable to an OutputStream.
 int getBERLength()
          Returns the length of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).
 int getBERPayloadLength()
          Returns the length of the payload of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).
 OctetString getContextEngineID()
          Gets the context engine ID of this scoped PDU.
 OctetString getContextName()
          Gets the context name of this scoped PDU.
 void setContextEngineID(OctetString contextEngineID)
          Sets the context engine ID field of the scoped PDU.
 void setContextName(OctetString contextName)
          Sets the context name field of this scoped PDU.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.snmp4j.PDU
add, addAll, addAllOIDs, addOID, clear, get, getBERPayloadLengthPDU, getErrorIndex, getErrorStatus, getErrorStatusText, getMaxRepetitions, getNonRepeaters, getRequestID, getType, getTypeFromString, getTypeString, getVariableBindings, isConfirmedPdu, remove, set, setErrorIndex, setErrorStatus, setMaxRepetitions, setNonRepeaters, setRequestID, setType, size, toArray, toErrorStatusText, trim
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopedPDU

public ScopedPDU()
Create a empty ScopedPDU.


ScopedPDU

public ScopedPDU(ScopedPDU other)
Copy constructor.

Parameters:
other - a ScopedPDU instance.
Method Detail

setContextEngineID

public void setContextEngineID(OctetString contextEngineID)
Sets the context engine ID field of the scoped PDU.

Parameters:
contextEngineID - an OctetString instance (must not be null).
Throws:
java.lang.NullPointerException - if contextEngineID == null

getContextEngineID

public OctetString getContextEngineID()
Gets the context engine ID of this scoped PDU.

Returns:
an OctetString instance.

setContextName

public void setContextName(OctetString contextName)
Sets the context name field of this scoped PDU.

Parameters:
contextName - an OctetString instance (must not be null).

getContextName

public OctetString getContextName()
Gets the context name of this scoped PDU.

Returns:
an OctetString instance.

getBERLength

public int getBERLength()
Description copied from interface: BERSerializable
Returns the length of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).

Specified by:
getBERLength in interface BERSerializable
Overrides:
getBERLength in class PDU
Returns:
the BER encoded length of this variable.

getBERPayloadLength

public int getBERPayloadLength()
Description copied from interface: BERSerializable
Returns the length of the payload of this BERSerializable object in bytes when encoded according to the Basic Encoding Rules (BER).

Specified by:
getBERPayloadLength in interface BERSerializable
Overrides:
getBERPayloadLength in class PDU
Returns:
the BER encoded length of this variable.

encodeBER

public void encodeBER(java.io.OutputStream outputStream)
               throws java.io.IOException
Description copied from interface: BERSerializable
Encodes a Variable to an OutputStream.

Specified by:
encodeBER in interface BERSerializable
Overrides:
encodeBER in class PDU
Parameters:
outputStream - an OutputStream.
Throws:
java.io.IOException - if an error occurs while writing to the stream.

clone

public java.lang.Object clone()
Overrides:
clone in class PDU

decodeBER

public void decodeBER(BERInputStream inputStream)
               throws java.io.IOException
Decodes a ScopedPDU from an InputStream.

Specified by:
decodeBER in interface BERSerializable
Overrides:
decodeBER in class PDU
Parameters:
inputStream - an InputStream containing a BER encoded byte stream.
Throws:
java.io.IOException

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class PDU
Returns:
a string representation of the object.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.