Package org.snmp4j.mp
Class StateReference<A extends Address>
java.lang.Object
org.snmp4j.mp.StateReference<A>
- All Implemented Interfaces:
 Serializable
- Direct Known Subclasses:
 MPv3.CacheEntry
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.- Version:
 - 3.1.0
 - Author:
 - Frank Fock
 - See Also:
 
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptionvoidaddMessageIDs(List<MessageID> msgIDs) static MessageIDcreateMessageID(int msgID) booleanbooleanequalsExceptMsgID(StateReference<?> other) byte[]byte[]intintintgetMsgID()byte[]intbyte[]TransportMapping<? super A>inthashCode()booleanisMatchingMessageID(int msgID) protected booleanisMatchingMessageID(MessageID msgID) booleanvoidsetAddress(A address) voidsetContextEngineID(byte[] contextEngineID) voidsetContextName(byte[] contextName) voidsetErrorCode(int errorCode) voidsetMaxSizeResponseScopedPDU(int maxSizeResponseScopedPDU) voidsetMsgFlags(int msgFlags) voidsetMsgID(int msgID) voidvoidsetPduHandle(PduHandle pduHandle) voidsetSecurityEngineID(byte[] securityEngineID) voidsetSecurityLevel(int securityLevel) voidsetSecurityModel(SecurityModel securityModel) voidsetSecurityName(byte[] securityName) voidsetSecurityStateReference(SecurityStateReference securityStateReference) voidsetTransportMapping(TransportMapping<? super A> transportMapping) toString()protected voidupdateRequestStatisticsPduHandle(PduHandle pduHandle)  
- 
Field Details
- 
retryMsgIDs
 
 - 
 - 
Constructor Details
- 
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- theTransportMappingto 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- theTransportMappingto be used to communicate with the peer.secEngineID- byte[]secModel- SecurityModelsecName- byte[]secLevel- intcontextEngineID- byte[]contextName- byte[]secStateReference- SecurityStateReferenceerrorCode- int
 
 - 
 - 
Method Details
- 
isReportable
public boolean isReportable() - 
getAddress
 - 
setAddress
 - 
setContextEngineID
public void setContextEngineID(byte[] contextEngineID)  - 
getContextEngineID
public byte[] getContextEngineID() - 
setContextName
public void setContextName(byte[] contextName)  - 
getContextName
public byte[] getContextName() - 
setSecurityModel
 - 
getSecurityModel
 - 
setSecurityName
public void setSecurityName(byte[] securityName)  - 
getSecurityName
public byte[] getSecurityName() - 
setSecurityLevel
public void setSecurityLevel(int securityLevel)  - 
getSecurityLevel
public int getSecurityLevel() - 
setSecurityStateReference
 - 
getSecurityStateReference
 - 
setMsgID
 - 
setMsgID
public void setMsgID(int msgID)  - 
getMsgID
 - 
setMsgFlags
public void setMsgFlags(int msgFlags)  - 
getMsgFlags
public int getMsgFlags() - 
setMaxSizeResponseScopedPDU
public void setMaxSizeResponseScopedPDU(int maxSizeResponseScopedPDU)  - 
getMaxSizeResponseScopedPDU
public int getMaxSizeResponseScopedPDU() - 
getPduHandle
 - 
getSecurityEngineID
public byte[] getSecurityEngineID() - 
getErrorCode
public int getErrorCode() - 
getTransportMapping
 - 
setPduHandle
 - 
updateRequestStatisticsPduHandle
 - 
setSecurityEngineID
public void setSecurityEngineID(byte[] securityEngineID)  - 
setErrorCode
public void setErrorCode(int errorCode)  - 
setTransportMapping
 - 
isMatchingMessageID
 - 
isMatchingMessageID
public boolean isMatchingMessageID(int msgID)  - 
equals
 - 
equalsExceptMsgID
 - 
hashCode
public int hashCode() - 
toString
 - 
addMessageIDs
 - 
getMessageIDs
 - 
createMessageID
 
 -