Package net.shibboleth.idp.saml.profile.impl

# Class InitializeOutboundMessageContextForError

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.profile.impl.InitializeOutboundMessageContextForError

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class InitializeOutboundMessageContextForError extends AbstractProfileAction
Action that prepares an outbound `MessageContext` and related SAML contexts in the event that they are not already prepared, to allow error responses to be generated in the case of synchronous bindings (i.e., SOAP).

This is a "make-up" action that fills in missing information that may not have been populated in the course of normal processing, if an error occurs early in profile processing. It does nothing if an outbound message context already exists.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_MSG_CTX`
Postcondition:

      ProfileRequestContext.getOutboundMessageContext() != null

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,SAMLBindingContext>`
`bindingContextLookupStrategy`
Strategy function for access to `SAMLBindingContext` to populate.
`private final org.slf4j.Logger`
`log`
Class logger.
`private BindingDescriptor`
`outboundBinding`
Outbound binding to use.
`private SAMLPeerEntityContext`
`peerEntityCtx`
The `SAMLPeerEntityContext` to base the outbound context on, if any.
`private Function<ProfileRequestContext,RelyingPartyContext>`
`relyingPartyContextLookupStrategy`
Relying party context lookup strategy.

## Constructor Summary

Constructors
Constructor
Description
`InitializeOutboundMessageContextForError()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`void`
`setBindingContextLookupStrategy(Function<ProfileRequestContext,SAMLBindingContext> strategy)`
Set lookup strategy for `SAMLBindingContext` to populate.
`void`
`setOutboundBinding(BindingDescriptor binding)`
Set the outbound binding to use for the error response.
`void`
`setRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)`
Set the relying party context lookup strategy.

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy`

### Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

`getActivationCondition, setActivationCondition`

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### bindingContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SAMLBindingContext> bindingContextLookupStrategy
Strategy function for access to `SAMLBindingContext` to populate.

### relyingPartyContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Relying party context lookup strategy.

### outboundBinding

@NonnullAfterInit private BindingDescriptor outboundBinding
Outbound binding to use.

### peerEntityCtx

@Nullable private SAMLPeerEntityContext peerEntityCtx
The `SAMLPeerEntityContext` to base the outbound context on, if any.

## Constructor Details

### InitializeOutboundMessageContextForError

public InitializeOutboundMessageContextForError()
Constructor.

## Method Details

### setBindingContextLookupStrategy

public void setBindingContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLBindingContext> strategy)
Set lookup strategy for `SAMLBindingContext` to populate.

Parameters:
  `strategy` - lookup strategy

### setRelyingPartyContextLookupStrategy

public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
Set the relying party context lookup strategy.

Parameters:
  `strategy` - lookup strategy

### setOutboundBinding

public void setOutboundBinding(@Nonnull @NotEmpty BindingDescriptor binding)
Set the outbound binding to use for the error response.

Parameters:
  `binding` - binding descriptor

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`