Package net.shibboleth.idp.profile.impl

# Class WebFlowMessageHandlerAdaptor

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.profile.impl.WebFlowMessageHandlerAdaptor

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

public class WebFlowMessageHandlerAdaptor extends AbstractProfileAction
An `AbstractProfileAction` subclass that adapts an OpenSAML `MessageHandler` for execution in a Spring WebFlow environment.

The handler to run may be injected directly, or supplied via a lookup function.

The `WebFlowMessageHandlerAdaptor.Direction` enum is used to indicate the target message context for the invocation of the handler:

- `WebFlowMessageHandlerAdaptor.Direction.INBOUND` indicates to execute the handler on the `InOutOperationContext.getInboundMessageContext()`
- `WebFlowMessageHandlerAdaptor.Direction.OUTBOUND` indicates to execute the handler on the `InOutOperationContext.getOutboundMessageContext()`

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.INVALID_MSG_CTX`, any, as set

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`WebFlowMessageHandlerAdaptor.Direction`
Used to indicate the target message context for invocation of the adapted message handler.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final WebFlowMessageHandlerAdaptor.Direction`
`direction`
The direction of execution for this action instance.
`private String`
`errorEvent`
An event to signal in the event of a handler exception.
`private MessageHandler`
`handler`
The message handler being adapted.
`private Function<ProfileRequestContext,MessageHandler>`
`handlerLookupStrategy`
Lookup strategy for handler to run if not set directly.
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`WebFlowMessageHandlerAdaptor(Function<ProfileRequestContext,MessageHandler> lookupStrategy, WebFlowMessageHandlerAdaptor.Direction executionDirection)`
Constructor.
`private`
`WebFlowMessageHandlerAdaptor(WebFlowMessageHandlerAdaptor.Direction executionDirection)`
Constructor.
``
`WebFlowMessageHandlerAdaptor(MessageHandler messageHandler, WebFlowMessageHandlerAdaptor.Direction executionDirection)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doPostExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`void`
`setErrorEvent(String event)`
Set the event to signal in the event of a handler exception.

### 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, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

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

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, 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 org.slf4j.Logger log
Logger.

### handlerLookupStrategy

@Nullable private Function<ProfileRequestContext,MessageHandler> handlerLookupStrategy
Lookup strategy for handler to run if not set directly.

### handler

@NonnullBeforeExec private MessageHandler handler
The message handler being adapted.

### direction

@Nonnull private final WebFlowMessageHandlerAdaptor.Direction direction
The direction of execution for this action instance.

### errorEvent

@Nullable private String errorEvent
An event to signal in the event of a handler exception.

## Constructor Details

### WebFlowMessageHandlerAdaptor

private WebFlowMessageHandlerAdaptor(@Nonnull @ParameterName(name="executionDirection") WebFlowMessageHandlerAdaptor.Direction executionDirection)
Constructor.

Parameters:
  `executionDirection` - the direction of execution

### WebFlowMessageHandlerAdaptor

public WebFlowMessageHandlerAdaptor(@Nonnull @ParameterName(name="messageHandler") MessageHandler messageHandler, @Nonnull @ParameterName(name="executionDirection") WebFlowMessageHandlerAdaptor.Direction executionDirection)
Constructor.

Parameters:
  `messageHandler` - the adapted message handler
  `executionDirection` - the direction of execution

### WebFlowMessageHandlerAdaptor

public WebFlowMessageHandlerAdaptor(@Nonnull @ParameterName(name="lookupStrategy") Function<ProfileRequestContext,MessageHandler> lookupStrategy, @Nonnull @ParameterName(name="executionDirection") WebFlowMessageHandlerAdaptor.Direction executionDirection)
Constructor.

Parameters:
  `lookupStrategy` - lookup function for message handler to run
  `executionDirection` - the direction of execution

## Method Details

### setErrorEvent

public void setErrorEvent(@Nullable String event)
Set the event to signal in the event of a handler exception.

Parameters:
  `event` - event to signal

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

public void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### doPostExecute

protected void doPostExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPostExecute` in class `AbstractProfileAction`