- java.lang.Object
-
- org.snmp4j.PDU
-
- org.snmp4j.ScopedPDU
-
- All Implemented Interfaces:
java.io.Serializable,BERSerializable
public class ScopedPDU extends PDU
TheScopedPDUclass 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.Objectclone()voiddecodeBER(BERInputStream inputStream)Decodes aScopedPDUfrom anInputStream.voidencodeBER(java.io.OutputStream outputStream)Encodes aVariableto anOutputStream.booleanequals(java.lang.Object obj)intgetBERLength()Returns the length of thisBERSerializableobject in bytes when encoded according to the Basic Encoding Rules (BER).intgetBERPayloadLength()Returns the length of the payload of thisBERSerializableobject in bytes when encoded according to the Basic Encoding Rules (BER).OctetStringgetContextEngineID()Gets the context engine ID of this scoped PDU.OctetStringgetContextName()Gets the context name of this scoped PDU.voidsetContextEngineID(OctetString contextEngineID)Sets the context engine ID field of the scoped PDU.voidsetContextName(OctetString contextName)Sets the context name field of this scoped PDU.java.lang.StringtoString()Returns a string representation of the object.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class org.snmp4j.PDU
add, addAll, addAll, addAllOIDs, addOID, clear, decodeVariableBindings, encodeVariableBindings, 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
-
-
-
-
Constructor Detail
-
ScopedPDU
public ScopedPDU()
Create a empty ScopedPDU.
-
ScopedPDU
public ScopedPDU(ScopedPDU other)
Copy constructor.- Parameters:
other- aScopedPDUinstance.
-
-
Method Detail
-
setContextEngineID
public void setContextEngineID(OctetString contextEngineID)
Sets the context engine ID field of the scoped PDU.- Parameters:
contextEngineID- anOctetStringinstance (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
OctetStringinstance.
-
setContextName
public void setContextName(OctetString contextName)
Sets the context name field of this scoped PDU.- Parameters:
contextName- anOctetStringinstance (must not benull).
-
getContextName
public OctetString getContextName()
Gets the context name of this scoped PDU.- Returns:
- an
OctetStringinstance.
-
getBERLength
public int getBERLength()
Description copied from interface:BERSerializableReturns the length of thisBERSerializableobject in bytes when encoded according to the Basic Encoding Rules (BER).- Specified by:
getBERLengthin interfaceBERSerializable- Overrides:
getBERLengthin classPDU- Returns:
- the BER encoded length of this variable.
-
getBERPayloadLength
public int getBERPayloadLength()
Description copied from interface:BERSerializableReturns the length of the payload of thisBERSerializableobject in bytes when encoded according to the Basic Encoding Rules (BER).- Specified by:
getBERPayloadLengthin interfaceBERSerializable- Overrides:
getBERPayloadLengthin classPDU- Returns:
- the BER encoded length of this variable.
-
encodeBER
public void encodeBER(java.io.OutputStream outputStream) throws java.io.IOExceptionDescription copied from interface:BERSerializableEncodes aVariableto anOutputStream.- Specified by:
encodeBERin interfaceBERSerializable- Overrides:
encodeBERin 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 aScopedPDUfrom anInputStream.- Specified by:
decodeBERin interfaceBERSerializable- Overrides:
decodeBERin classPDU- Parameters:
inputStream- anInputStreamcontaining 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.
-
-