Package net.shibboleth.idp.profile.impl
Class WebFlowMessageHandlerAdaptor
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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
AnAbstractProfileActionsubclass that adapts an OpenSAMLMessageHandlerfor execution in a Spring WebFlow environment.The handler to run may be injected directly, or supplied via a lookup function.
The
WebFlowMessageHandlerAdaptor.Directionenum is used to indicate the target message context for the invocation of the handler:WebFlowMessageHandlerAdaptor.Direction.INBOUNDindicates to execute the handler on theInOutOperationContext.getInboundMessageContext()WebFlowMessageHandlerAdaptor.Direction.OUTBOUNDindicates to execute the handler on theInOutOperationContext.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 classWebFlowMessageHandlerAdaptor.DirectionUsed to indicate the target message context for invocation of the adapted message handler.
-
Field Summary
Fields Modifier and Type Field Description private WebFlowMessageHandlerAdaptor.DirectiondirectionThe direction of execution for this action instance.private StringerrorEventAn event to signal in the event of a handler exception.private MessageHandlerhandlerThe message handler being adapted.private Function<ProfileRequestContext,MessageHandler>handlerLookupStrategyLookup strategy for handler to run if not set directly.private org.slf4j.LoggerlogLogger.
-
Constructor Summary
Constructors Modifier Constructor Description WebFlowMessageHandlerAdaptor(Function<ProfileRequestContext,MessageHandler> lookupStrategy, WebFlowMessageHandlerAdaptor.Direction executionDirection)Constructor.privateWebFlowMessageHandlerAdaptor(WebFlowMessageHandlerAdaptor.Direction executionDirection)Constructor.WebFlowMessageHandlerAdaptor(MessageHandler messageHandler, WebFlowMessageHandlerAdaptor.Direction executionDirection)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoPostExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetErrorEvent(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, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
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
@Nullable private MessageHandler handler
The message handler being adapted.
-
direction
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 Detail
-
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 handlerexecutionDirection- 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 runexecutionDirection- the direction of execution
-
-
Method Detail
-
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:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
public void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
doPostExecute
protected void doPostExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPostExecutein classAbstractProfileAction
-
-