Module org.snmp4j
Package org.snmp4j

Class ScopedPDU

    • 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:
        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.
      • decodeBER

        public void decodeBER​(BERInputStream inputStream)
                       throws 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:
        IOException - if there is a BER encoding error or other IO exception in the input stream.
      • toString

        public String toString()
        Returns a string representation of the object.
        Overrides:
        toString in class PDU
        Returns:
        a string representation of the object.
      • equals

        public boolean equals​(Object obj)
        Overrides:
        equals in class PDU