- java.lang.Object
-
- org.snmp4j.mp.StateReference<A>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MPv3.CacheEntry
public class StateReference<A extends Address> extends java.lang.Object implements java.io.Serializable
TheStateReference
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.- Version:
- 3.1.0
- Author:
- Frank Fock
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<MessageID>
retryMsgIDs
-
Constructor Summary
Constructors Constructor Description StateReference()
Default constructor.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.StateReference(PduHandle pduHandle, A peerAddress, TransportMapping<? super A> peerTransport, SecurityModel secModel, byte[] secName, int errorCode)
Creates a state reference for community based security models.
-
Method Summary
-
-
-
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.- Parameters:
pduHandle
- PduHandlepeerAddress
- AddresspeerTransport
- theTransportMapping
to be used to communicate with the peer.secModel
- SecurityModelsecName
- 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.- Parameters:
msgID
- intmsgFlags
- intmaxSizeResponseScopedPDU
- intpduHandle
- PduHandlepeerAddress
- AddresspeerTransport
- theTransportMapping
to be used to communicate with the peer.secEngineID
- byte[]secModel
- SecurityModelsecName
- byte[]secLevel
- intcontextEngineID
- byte[]contextName
- byte[]secStateReference
- SecurityStateReferenceerrorCode
- 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)
-
getSecurityModel
public SecurityModel getSecurityModel()
-
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)
-
getSecurityStateReference
public SecurityStateReference getSecurityStateReference()
-
setMsgID
public void setMsgID(MessageID msgID)
-
setMsgID
public void setMsgID(int msgID)
-
getMsgID
public MessageID getMsgID()
-
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()
-
getTransportMapping
public TransportMapping<? super A> getTransportMapping()
-
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)
- Overrides:
equals
in classjava.lang.Object
-
equalsExceptMsgID
public boolean equalsExceptMsgID(StateReference<?> other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addMessageIDs
public void addMessageIDs(java.util.List<MessageID> msgIDs)
-
getMessageIDs
public java.util.List<MessageID> getMessageIDs()
-
createMessageID
public static MessageID createMessageID(int msgID)
-
-