java.lang.Object
org.snmp4j.PDU
org.snmp4j.ScopedPDU
- All Implemented Interfaces:
Serializable
,BERSerializable
The
ScopedPDU
class represents a SNMPv3 scoped PDU.- Version:
- 1.0
- Author:
- Frank Fock
- See Also:
-
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
-
Method Summary
Modifier and TypeMethodDescriptionclone()
void
decodeBER
(BERInputStream inputStream) Decodes aScopedPDU
from anInputStream
.void
encodeBER
(OutputStream outputStream) Encodes aVariable
to anOutputStream
.boolean
int
Returns the length of thisBERSerializable
object in bytes when encoded according to the Basic Encoding Rules (BER).int
Returns the length of the payload of thisBERSerializable
object in bytes when encoded according to the Basic Encoding Rules (BER).Gets the context engine ID of this scoped PDU.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.toString()
Returns a string representation of the object.Methods inherited from class org.snmp4j.PDU
add, addAll, addAll, addAllOIDs, addOID, clear, decodeVariableBindings, encodeVariableBindings, get, get, getAll, 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
-
Constructor Details
-
ScopedPDU
public ScopedPDU()Create a empty ScopedPDU. -
ScopedPDU
Copy constructor.- Parameters:
other
- aScopedPDU
instance.
-
-
Method Details
-
setContextEngineID
Sets the context engine ID field of the scoped PDU.- Parameters:
contextEngineID
- anOctetString
instance (must not benull
).- Throws:
NullPointerException
- if contextEngineID == null
-
getContextEngineID
Gets the context engine ID of this scoped PDU.- Returns:
- an
OctetString
instance.
-
setContextName
Sets the context name field of this scoped PDU.- Parameters:
contextName
- anOctetString
instance (must not benull
).
-
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 thisBERSerializable
object in bytes when encoded according to the Basic Encoding Rules (BER).- Specified by:
getBERLength
in interfaceBERSerializable
- Overrides:
getBERLength
in classPDU
- Returns:
- the BER encoded length of this variable.
-
getBERPayloadLength
public int getBERPayloadLength()Description copied from interface:BERSerializable
Returns the length of the payload of thisBERSerializable
object in bytes when encoded according to the Basic Encoding Rules (BER).- Specified by:
getBERPayloadLength
in interfaceBERSerializable
- Overrides:
getBERPayloadLength
in classPDU
- Returns:
- the BER encoded length of this variable.
-
encodeBER
Description copied from interface:BERSerializable
Encodes aVariable
to anOutputStream
.- Specified by:
encodeBER
in interfaceBERSerializable
- Overrides:
encodeBER
in classPDU
- Parameters:
outputStream
- anOutputStream
.- Throws:
IOException
- if an error occurs while writing to the stream.
-
clone
-
decodeBER
Decodes aScopedPDU
from anInputStream
.- Specified by:
decodeBER
in interfaceBERSerializable
- Overrides:
decodeBER
in classPDU
- Parameters:
inputStream
- anInputStream
containing a BER encoded byte stream.- Throws:
IOException
- if there is a BER encoding error or other IO exception in the input stream.
-
toString
Returns a string representation of the object. -
equals
-