Class SAMLMessageInfoContext
- java.lang.Object
-
- org.opensaml.messaging.context.BaseContext
-
- org.opensaml.saml.common.messaging.context.SAMLMessageInfoContext
-
- All Implemented Interfaces:
Iterable<org.opensaml.messaging.context.BaseContext>
public final class SAMLMessageInfoContext extends org.opensaml.messaging.context.BaseContext
A context intended to be used as a subcontext of aMessageContext
that carries some basic information about the SAML message.The methods
getMessageId()
andgetMessageIssueInstant()
will attempt to dynamically resolve the appropriate data from the SAML message held in the message context if the data has not been set statically by the corresponding setter method. This evaluation will be attempted only if the this context instance is an immediate child of the message context, as returned byBaseContext.getParent()
.
-
-
Field Summary
Fields Modifier and Type Field Description private Instant
issueInstant
The issue instant of the message.private String
messageId
The ID of the message.
-
Constructor Summary
Constructors Constructor Description SAMLMessageInfoContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMessageId()
Gets the ID of the message.Instant
getMessageIssueInstant()
Gets the issue instant of the message.protected Instant
resolveIssueInstant()
Dynamically resolve the message issue instant from the SAML protocol message held inMessageContext.getMessage()
.protected String
resolveMessageId()
Dynamically resolve the message ID from the SAML protocol message held inMessageContext.getMessage()
.protected SAMLObject
resolveSAMLMessage()
Resolve the SAML message from the message context.void
setMessageId(String newMessageId)
Sets the ID of the message.void
setMessageIssueInstant(Instant messageIssueInstant)
Sets the issue instant of the message.-
Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeSubcontext, removeSubcontext, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getMessageId
@Nullable @NotEmpty public String getMessageId()
Gets the ID of the message.- Returns:
- ID of the message, may be null
-
setMessageId
public void setMessageId(@Nullable String newMessageId)
Sets the ID of the message.- Parameters:
newMessageId
- ID of the message
-
getMessageIssueInstant
@Nullable public Instant getMessageIssueInstant()
Gets the issue instant of the message.- Returns:
- issue instant of the message
-
setMessageIssueInstant
public void setMessageIssueInstant(@Nullable Instant messageIssueInstant)
Sets the issue instant of the message.- Parameters:
messageIssueInstant
- issue instant of the message
-
resolveMessageId
@Nullable protected String resolveMessageId()
Dynamically resolve the message ID from the SAML protocol message held inMessageContext.getMessage()
.- Returns:
- the message ID, or null if it can not be resolved
-
resolveIssueInstant
@Nullable protected Instant resolveIssueInstant()
Dynamically resolve the message issue instant from the SAML protocol message held inMessageContext.getMessage()
.- Returns:
- the message issue instant, or null if it can not be resolved
-
resolveSAMLMessage
@Nullable protected SAMLObject resolveSAMLMessage()
Resolve the SAML message from the message context.- Returns:
- the SAML message, or null if it can not be resolved
-
-