Package org.opensaml.profile.action
Class AbstractHandlerDelegatingProfileAction<DelegateType extends org.opensaml.messaging.handler.MessageHandler>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- org.opensaml.profile.action.AbstractHandlerDelegatingProfileAction<DelegateType>
-
- Type Parameters:
DelegateType- type of MessageHandler to which to delegate.
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,ProfileAction
public abstract class AbstractHandlerDelegatingProfileAction<DelegateType extends org.opensaml.messaging.handler.MessageHandler> extends AbstractConditionalProfileAction
Base class for a profile action which just delegates to an instance ofMessageHandler.
-
-
Field Summary
Fields Modifier and Type Field Description private DelegateTypedelegateThe message handler delegate.private StringerrorEventAn event to signal in the event of a handler exception.private org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext>messageContextLookupLookup function for the message context on which to operate.private static ParentProfileRequestContextLookup<org.opensaml.messaging.context.MessageContext>PRC_LOOKUPLookup function for parent ProfileRequestContext.
-
Constructor Summary
Constructors Constructor Description AbstractHandlerDelegatingProfileAction(DelegateType delegateInstance, org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext> lookup)Constructor.AbstractHandlerDelegatingProfileAction(Class<DelegateType> delegateClass, org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext> lookup)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> Function<org.opensaml.messaging.context.MessageContext,T>adapt(Function<ProfileRequestContext,T> function)Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.protected Predicate<org.opensaml.messaging.context.MessageContext>adapt(Predicate<ProfileRequestContext> predicate)Adapt aProfileRequestContextpredicate into aMessageContextpredicate via composing with a lookup function.protected voiddoDestroy()protected voiddoExecute(ProfileRequestContext profileRequestContext)Performs this action.protected DelegateTypegetDelegate()Get the delegate instance.voidsetErrorEvent(String event)Set the event to signal in the event of a handler exception.-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
doPreExecute, getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
PRC_LOOKUP
@Nonnull private static final ParentProfileRequestContextLookup<org.opensaml.messaging.context.MessageContext> PRC_LOOKUP
Lookup function for parent ProfileRequestContext.
-
delegate
@Nonnull private DelegateType extends org.opensaml.messaging.handler.MessageHandler delegate
The message handler delegate.
-
messageContextLookup
@Nonnull private org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext> messageContextLookup
Lookup function for the message context on which to operate.
-
errorEvent
@Nullable private String errorEvent
An event to signal in the event of a handler exception.
-
-
Constructor Detail
-
AbstractHandlerDelegatingProfileAction
public AbstractHandlerDelegatingProfileAction(@Nonnull Class<DelegateType> delegateClass, @Nonnull org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext> lookup)Constructor.- Parameters:
delegateClass- the delegate class. Must have a no-argument constructor. For those that do not, instead pass in a pre-constructed instance viaAbstractHandlerDelegatingProfileAction(DelegateType,org.opensaml.messaging.context.navigate.ContextDataLookupFunction<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.messaging.context.MessageContext>).lookup- the lookup function for the message context on which to operate, typically for either the inbound or outbound context
-
AbstractHandlerDelegatingProfileAction
public AbstractHandlerDelegatingProfileAction(@Nonnull DelegateType delegateInstance, @Nonnull org.opensaml.messaging.context.navigate.ContextDataLookupFunction<ProfileRequestContext,org.opensaml.messaging.context.MessageContext> lookup)Constructor.- Parameters:
delegateInstance- the delegate instancelookup- the lookup function for the message context on which to operate, typically for either the inbound or outbound context
-
-
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
-
doDestroy
protected void doDestroy()
- Overrides:
doDestroyin classnet.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
getDelegate
@Nonnull protected DelegateType getDelegate()
Get the delegate instance.- Returns:
- the delegate instance
-
adapt
@Nullable protected Predicate<org.opensaml.messaging.context.MessageContext> adapt(@Nullable Predicate<ProfileRequestContext> predicate)
Adapt aProfileRequestContextpredicate into aMessageContextpredicate via composing with a lookup function.- Parameters:
predicate- the profile request context predicate- Returns:
- the message context predicate
-
adapt
@Nullable protected <T> Function<org.opensaml.messaging.context.MessageContext,T> adapt(@Nullable Function<ProfileRequestContext,T> function)
Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.- Type Parameters:
T- the output type of the functions- Parameters:
function- the profile request context function- Returns:
- the message context function
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)Performs this action. Actions must override this method to perform their work.- Overrides:
doExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context
-
-