- java.lang.Object
-
- org.snmp4j.PDU
-
- org.snmp4j.ScopedPDU
-
- All Implemented Interfaces:
java.io.Serializable
,BERSerializable
public class ScopedPDU extends PDU
TheScopedPDU
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
void
decodeBER(BERInputStream inputStream)
Decodes aScopedPDU
from anInputStream
.void
encodeBER(java.io.OutputStream outputStream)
Encodes aVariable
to anOutputStream
.boolean
equals(java.lang.Object obj)
int
getBERLength()
Returns the length of thisBERSerializable
object in bytes when encoded according to the Basic Encoding Rules (BER).int
getBERPayloadLength()
Returns the length of the payload of thisBERSerializable
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, 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 Detail
-
ScopedPDU
public ScopedPDU()
Create a empty ScopedPDU.
-
ScopedPDU
public ScopedPDU(ScopedPDU other)
Copy constructor.- Parameters:
other
- aScopedPDU
instance.
-
-
Method Detail
-
setContextEngineID
public void setContextEngineID(OctetString contextEngineID)
Sets the context engine ID field of the scoped PDU.- Parameters:
contextEngineID
- anOctetString
instance (must not benull
).- 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
- anOctetString
instance (must not benull
).
-
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 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
public void encodeBER(java.io.OutputStream outputStream) throws java.io.IOException
Description copied from interface:BERSerializable
Encodes aVariable
to anOutputStream
.- Specified by:
encodeBER
in interfaceBERSerializable
- Overrides:
encodeBER
in classPDU
- Parameters:
outputStream
- anOutputStream
.- Throws:
java.io.IOException
- if an error occurs while writing to the stream.
-
decodeBER
public void decodeBER(BERInputStream inputStream) throws java.io.IOException
Decodes aScopedPDU
from anInputStream
.- Specified by:
decodeBER
in interfaceBERSerializable
- Overrides:
decodeBER
in classPDU
- Parameters:
inputStream
- anInputStream
containing a BER encoded byte stream.- Throws:
java.io.IOException
- if there is a BER encoding error or other IO exception in the input stream.
-
toString
public java.lang.String toString()
Returns a string representation of the object.
-
-