public class ScopedPDU extends PDU
ScopedPDU
class represents a SNMPv3 scoped 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 and Description |
---|
ScopedPDU()
Create a empty ScopedPDU.
|
ScopedPDU(ScopedPDU other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
void |
decodeBER(BERInputStream inputStream)
Decodes a
ScopedPDU from an InputStream . |
void |
encodeBER(OutputStream outputStream)
Encodes a
Variable to an OutputStream . |
boolean |
equals(Object obj) |
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.
|
String |
toString()
Returns a string representation of the object.
|
add, addAll, addAll, addAllOIDs, addOID, clear, get, getBERLength, getBERPayloadLengthPDU, getBindingList, getErrorIndex, getErrorStatus, getErrorStatusText, getMaxRepetitions, getNonRepeaters, getRequestID, getType, getTypeFromString, getTypeString, getVariable, getVariableBindings, hashCode, isConfirmedPdu, isResponsePdu, remove, set, setErrorIndex, setErrorStatus, setMaxRepetitions, setNonRepeaters, setRequestID, setType, setVariableBindings, size, toArray, toErrorStatusText, trim
public ScopedPDU()
public ScopedPDU(ScopedPDU other)
other
- a ScopedPDU
instance.public void setContextEngineID(OctetString contextEngineID)
contextEngineID
- an OctetString
instance (must not be null
).NullPointerException
- if contextEngineID == nullpublic OctetString getContextEngineID()
OctetString
instance.public void setContextName(OctetString contextName)
contextName
- an OctetString
instance (must not be null
).public OctetString getContextName()
OctetString
instance.public int getBERLength()
BERSerializable
BERSerializable
object
in bytes when encoded according to the Basic Encoding Rules (BER).getBERLength
in interface BERSerializable
getBERLength
in class PDU
public int getBERPayloadLength()
BERSerializable
BERSerializable
object
in bytes when encoded according to the Basic Encoding Rules (BER).getBERPayloadLength
in interface BERSerializable
getBERPayloadLength
in class PDU
public void encodeBER(OutputStream outputStream) throws IOException
BERSerializable
Variable
to an OutputStream
.encodeBER
in interface BERSerializable
encodeBER
in class PDU
outputStream
- an OutputStream
.IOException
- if an error occurs while writing to the stream.public void decodeBER(BERInputStream inputStream) throws IOException
ScopedPDU
from an InputStream
.decodeBER
in interface BERSerializable
decodeBER
in class PDU
inputStream
- an InputStream
containing a BER encoded
byte stream.IOException
- if there is a BER encoding error or other IO exception in the input stream.public String toString()
Copyright © 2018 SNMP4J.org. All rights reserved.