Package org.opensaml.saml.common.messaging.context

# Class SAMLMessageInfoContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
org.opensaml.saml.common.messaging.context.SAMLMessageInfoContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

public final class SAMLMessageInfoContext extends BaseContext
A context intended to be used as a subcontext of a `MessageContext` that carries some basic information about the SAML message.

The methods `getMessageId()` and `getMessageIssueInstant()` 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 by `BaseContext.getParent()`.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## 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

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 in `MessageContext.getMessage()`.
`protected String`
`resolveMessageId()`
Dynamically resolve the message ID from the SAML protocol message held in `MessageContext.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, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, 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`

## Field Details

### messageId

@Nullable @NotEmpty private String messageId
The ID of the message.

### issueInstant

@Nullable private Instant issueInstant
The issue instant of the message.

## Constructor Details

### SAMLMessageInfoContext

public SAMLMessageInfoContext()

## Method Details

### 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 in `MessageContext.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 in `MessageContext.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