Package org.opensaml.profile.testing

# Class RequestContextBuilder

java.lang.Object
org.opensaml.profile.testing.RequestContextBuilder

public class RequestContextBuilder extends Object
Builder used to construct `ProfileRequestContext` used in `ProfileAction` executions.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Object`
`inboundMessage`
The inbound message.
`private String`
`inboundMessageId`
The ID of the inbound message.
`private Instant`
`inboundMessageIssueInstant`
The issue instant of the inbound message.
`private String`
`inboundMessageIssuer`
The issuer of the inbound message.
`private final String`
`NO_VAL`
Value used to represent a string value that has not be set.
`private Object`
`outboundMessage`
The outbound message.
`private String`
`outboundMessageId`
The ID of the outbound message.
`private Instant`
`outboundMessageIssueInstant`
The issue instant of the outbound message.
`private String`
`outboundMessageIssuer`
The issuer of the outbound message.

## Constructor Summary

Constructors
Constructor
Description
`RequestContextBuilder()`
Constructor.
`RequestContextBuilder(RequestContextBuilder prototype)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected MessageContext`
`buildInboundMessageContext()`
Builds a inbound `MessageContext`.
`protected MessageContext`
`buildOutboundMessageContext()`
Builds a outbound `MessageContext`.
`ProfileRequestContext`
`buildProfileRequestContext()`
Builds a `ProfileRequestContext`.
`RequestContextBuilder`
`setInboundMessage(Object message)`
Sets the inbound message.
`RequestContextBuilder`
`setInboundMessageId(String id)`
Sets the ID of the inbound message.
`RequestContextBuilder`
`setInboundMessageIssueInstant(Instant instant)`
Sets the issue instant of the inbound message.
`RequestContextBuilder`
`setInboundMessageIssuer(String issuer)`
Sets the issuer of the inbound message.
`RequestContextBuilder`
`setOutboundMessage(Object message)`
Sets the outbound message.
`RequestContextBuilder`
`setOutboundMessageId(String id)`
Sets the ID of the outbound message.
`RequestContextBuilder`
`setOutboundMessageIssueInstant(Instant instant)`
Sets the issue instant of the outbound message.
`RequestContextBuilder`
`setOutboundMessageIssuer(String issuer)`
Sets the issuer of the outbound message.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### NO_VAL

private final String NO_VAL
Value used to represent a string value that has not be set.

See Also:
  - Constant Field Values

### inboundMessageId

private String inboundMessageId
The ID of the inbound message.

### inboundMessageIssueInstant

private Instant inboundMessageIssueInstant
The issue instant of the inbound message.

### inboundMessageIssuer

private String inboundMessageIssuer
The issuer of the inbound message.

### inboundMessage

private Object inboundMessage
The inbound message.

### outboundMessageId

private String outboundMessageId
The ID of the outbound message.

### outboundMessageIssueInstant

private Instant outboundMessageIssueInstant
The issue instant of the outbound message.

### outboundMessageIssuer

private String outboundMessageIssuer
The issuer of the outbound message.

### outboundMessage

private Object outboundMessage
The outbound message.

## Constructor Details

### RequestContextBuilder

public RequestContextBuilder()
Constructor.

### RequestContextBuilder

public RequestContextBuilder(RequestContextBuilder prototype)
Constructor.

Parameters:
  `prototype` - prototype whose properties are copied onto this builder

## Method Details

### setInboundMessageId

@Nonnull public RequestContextBuilder setInboundMessageId(@Nullable String id)
Sets the ID of the inbound message.

Parameters:
  `id` - ID of the inbound message
Returns:
  this builder

### setInboundMessageIssueInstant

@Nonnull public RequestContextBuilder setInboundMessageIssueInstant(@Nullable Instant instant)
Sets the issue instant of the inbound message.

Parameters:
  `instant` - issue instant of the inbound message
Returns:
  this builder

### setInboundMessageIssuer

@Nonnull public RequestContextBuilder setInboundMessageIssuer(@Nullable String issuer)
Sets the issuer of the inbound message.

Parameters:
  `issuer` - issuer of the inbound message
Returns:
  this builder

### setInboundMessage

@Nonnull public RequestContextBuilder setInboundMessage(@Nullable Object message)
Sets the inbound message.

Parameters:
  `message` - the inbound message
Returns:
  this builder

### setOutboundMessageId

@Nonnull public RequestContextBuilder setOutboundMessageId(@Nullable String id)
Sets the ID of the outbound message.

Parameters:
  `id` - ID of the outbound message
Returns:
  this builder

### setOutboundMessageIssueInstant

@Nonnull public RequestContextBuilder setOutboundMessageIssueInstant(@Nullable Instant instant)
Sets the issue instant of the outbound message.

Parameters:
  `instant` - issue instant of the outbound message
Returns:
  this builder

### setOutboundMessageIssuer

public RequestContextBuilder setOutboundMessageIssuer(@Nullable String issuer)
Sets the issuer of the outbound message.

Parameters:
  `issuer` - issuer of the outbound message
Returns:
  this builder

### setOutboundMessage

@Nonnull public RequestContextBuilder setOutboundMessage(@Nullable Object message)
Sets the outbound message.

Parameters:
  `message` - the outbound message
Returns:
  this builder

### buildProfileRequestContext

@Nonnull public ProfileRequestContext buildProfileRequestContext()
Builds a `ProfileRequestContext`. The default implementation builds a `ProfileRequestContext` that contains a:

- inbound message context created by `buildInboundMessageContext()`
- outbound message context created by `buildOutboundMessageContext()`

Returns:
  the constructed `ProfileRequestContext`

### buildInboundMessageContext

@Nonnull protected MessageContext buildInboundMessageContext()
Builds a inbound `MessageContext`. The default implementation builds a `MessageContext` that contains:

- the message provided by `setInboundMessage(Object)`

Returns:
  the constructed `MessageContext`

### buildOutboundMessageContext

@Nonnull protected MessageContext buildOutboundMessageContext()
Builds a outbound `MessageContext`. The default implementation builds a `MessageContext` that contains:

- the message provided by `setOutboundMessage(Object)`

Returns:
  the constructed `MessageContext`