Module org.snmp4j

Class StateReference<A extends Address>

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class StateReference<A extends Address>
    extends java.lang.Object
    The StateReference class represents state information associated with SNMP messages. The state reference is used to send response or report (SNMPv3 only). Depending on the security model not all fields may be filled.
    Frank Fock
    See Also:
    Serialized Form
    • Field Detail

      • retryMsgIDs

        protected java.util.List<MessageID> retryMsgIDs
    • Constructor Detail

      • StateReference

        public StateReference()
        Default constructor.
      • StateReference

        public StateReference​(PduHandle pduHandle,
                              A peerAddress,
                              TransportMapping<? super A> peerTransport,
                              SecurityModel secModel,
                              byte[] secName,
                              int errorCode)
        Creates a state reference for community based security models.
        pduHandle - PduHandle
        peerAddress - Address
        peerTransport - the TransportMapping to be used to communicate with the peer.
        secModel - SecurityModel
        secName - a community string.
        errorCode - an error code associated with the SNMP message.
      • StateReference

        public StateReference​(int msgID,
                              int msgFlags,
                              int maxSizeResponseScopedPDU,
                              PduHandle pduHandle,
                              A peerAddress,
                              TransportMapping<? super A> peerTransport,
                              byte[] secEngineID,
                              SecurityModel secModel,
                              byte[] secName,
                              int secLevel,
                              byte[] contextEngineID,
                              byte[] contextName,
                              SecurityStateReference secStateReference,
                              int errorCode)
        Creates a state reference for SNMPv3 messages.
        msgID - int
        msgFlags - int
        maxSizeResponseScopedPDU - int
        pduHandle - PduHandle
        peerAddress - Address
        peerTransport - the TransportMapping to be used to communicate with the peer.
        secEngineID - byte[]
        secModel - SecurityModel
        secName - byte[]
        secLevel - int
        contextEngineID - byte[]
        contextName - byte[]
        secStateReference - SecurityStateReference
        errorCode - int
    • Method Detail

      • isReportable

        public boolean isReportable()
      • getAddress

        public A getAddress()
      • setAddress

        public void setAddress​(A address)
      • setContextEngineID

        public void setContextEngineID​(byte[] contextEngineID)
      • getContextEngineID

        public byte[] getContextEngineID()
      • setContextName

        public void setContextName​(byte[] contextName)
      • getContextName

        public byte[] getContextName()
      • setSecurityModel

        public void setSecurityModel​(SecurityModel securityModel)
      • setSecurityName

        public void setSecurityName​(byte[] securityName)
      • getSecurityName

        public byte[] getSecurityName()
      • setSecurityLevel

        public void setSecurityLevel​(int securityLevel)
      • getSecurityLevel

        public int getSecurityLevel()
      • setSecurityStateReference

        public void setSecurityStateReference​(SecurityStateReference securityStateReference)
      • setMsgID

        public void setMsgID​(MessageID msgID)
      • setMsgID

        public void setMsgID​(int msgID)
      • setMsgFlags

        public void setMsgFlags​(int msgFlags)
      • getMsgFlags

        public int getMsgFlags()
      • setMaxSizeResponseScopedPDU

        public void setMaxSizeResponseScopedPDU​(int maxSizeResponseScopedPDU)
      • getMaxSizeResponseScopedPDU

        public int getMaxSizeResponseScopedPDU()
      • getPduHandle

        public PduHandle getPduHandle()
      • getSecurityEngineID

        public byte[] getSecurityEngineID()
      • getErrorCode

        public int getErrorCode()
      • setPduHandle

        public void setPduHandle​(PduHandle pduHandle)
      • updateRequestStatisticsPduHandle

        protected void updateRequestStatisticsPduHandle​(PduHandle pduHandle)
      • setSecurityEngineID

        public void setSecurityEngineID​(byte[] securityEngineID)
      • setErrorCode

        public void setErrorCode​(int errorCode)
      • setTransportMapping

        public void setTransportMapping​(TransportMapping<? super A> transportMapping)
      • isMatchingMessageID

        protected boolean isMatchingMessageID​(MessageID msgID)
      • isMatchingMessageID

        public boolean isMatchingMessageID​(int msgID)
      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • equalsExceptMsgID

        public boolean equalsExceptMsgID​(StateReference<?> other)
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • addMessageIDs

        public void addMessageIDs​(java.util.List<MessageID> msgIDs)
      • getMessageIDs

        public java.util.List<MessageID> getMessageIDs()
      • createMessageID

        protected MessageID createMessageID​(int msgID)