- java.lang.Object
-
- org.snmp4j.TransportStateReference
-
- All Implemented Interfaces:
java.io.Serializable
public class TransportStateReference extends java.lang.Object implements java.io.SerializableTheTransportStateReferenceclass holds information defined by RFC 5343 for the tmStateReference ASI elements. Objects of this class are cached by security awareTransportMappings and transport awareSecurityModels.- Since:
- 2.0
- Version:
- 2.0
- Author:
- Frank Fock
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TransportStateReference(TransportMapping<?> transport, Address address, OctetString securityName, SecurityLevel requestedSecurityLevel, SecurityLevel transportSecurityLevel, boolean sameSecurity, java.lang.Object sessionID)TransportStateReference(TransportMapping<?> transport, Address address, OctetString securityName, SecurityLevel requestedSecurityLevel, SecurityLevel transportSecurityLevel, boolean sameSecurity, java.lang.Object sessionID, Target<?> target)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AddressgetAddress()CertifiedIdentitygetCertifiedIdentity()Deprecated.UsegetTarget()instead and cast toCertifiedIdentityif possible.SecurityLevelgetRequestedSecurityLevel()OctetStringgetSecurityName()java.lang.ObjectgetSessionID()Target<?>getTarget()Get the target instance that contains additional security information necessary to send a message.TransportMapping<?>getTransport()SecurityLevelgetTransportSecurityLevel()static booleanhasCertifiedIdentity(TransportStateReference transportStateReference)Check if the givenTransportStateReferencehasCertifiedIdentityinformation.booleanisSameSecurity()booleanisTransportSecurityValid()Checks if transport, address, securityName and transportSecurityLevel are valid (not null).voidsetRequestedSecurityLevel(SecurityLevel requestedSecurityLevel)voidsetSameSecurity(boolean sameSecurity)voidsetSecurityName(OctetString securityName)voidsetTransport(TransportMapping<?> transport)voidsetTransportSecurityLevel(SecurityLevel transportSecurityLevel)java.lang.StringtoString()
-
-
-
Constructor Detail
-
TransportStateReference
public TransportStateReference(TransportMapping<?> transport, Address address, OctetString securityName, SecurityLevel requestedSecurityLevel, SecurityLevel transportSecurityLevel, boolean sameSecurity, java.lang.Object sessionID)
-
TransportStateReference
public TransportStateReference(TransportMapping<?> transport, Address address, OctetString securityName, SecurityLevel requestedSecurityLevel, SecurityLevel transportSecurityLevel, boolean sameSecurity, java.lang.Object sessionID, Target<?> target)
-
-
Method Detail
-
setTransport
public void setTransport(TransportMapping<?> transport)
-
getTransport
public TransportMapping<?> getTransport()
-
getAddress
public Address getAddress()
-
getSecurityName
public OctetString getSecurityName()
-
getRequestedSecurityLevel
public SecurityLevel getRequestedSecurityLevel()
-
getTransportSecurityLevel
public SecurityLevel getTransportSecurityLevel()
-
isSameSecurity
public boolean isSameSecurity()
-
getSessionID
public java.lang.Object getSessionID()
-
setSecurityName
public void setSecurityName(OctetString securityName)
-
setRequestedSecurityLevel
public void setRequestedSecurityLevel(SecurityLevel requestedSecurityLevel)
-
setTransportSecurityLevel
public void setTransportSecurityLevel(SecurityLevel transportSecurityLevel)
-
setSameSecurity
public void setSameSecurity(boolean sameSecurity)
-
getCertifiedIdentity
public CertifiedIdentity getCertifiedIdentity()
Deprecated.UsegetTarget()instead and cast toCertifiedIdentityif possible.Get theCertifiedIdentityinstance that contains additional security information necessary to send a message usingTLSTM.- Returns:
- the certified identity instance.
-
hasCertifiedIdentity
public static boolean hasCertifiedIdentity(TransportStateReference transportStateReference)
Check if the givenTransportStateReferencehasCertifiedIdentityinformation.- Parameters:
transportStateReference- a transport state reference instance.- Returns:
trueiftransportStateReferenceis notnulland itsgetTarget()is an instance ofCertifiedIdentity.- Since:
- 3.4.0
-
getTarget
public Target<?> getTarget()
Get the target instance that contains additional security information necessary to send a message.- Returns:
- associated (optional) target instance which has been used to send a message.
- Since:
- 3.4.0
-
isTransportSecurityValid
public boolean isTransportSecurityValid()
Checks if transport, address, securityName and transportSecurityLevel are valid (not null).- Returns:
trueif the above fields are notnull.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-