Package org.opensaml.profile.action
Class AbstractHandlerDelegatingProfileAction<DelegateType extends MessageHandler>
java.lang.Object
net.shibboleth.shared.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:
Component,DestructableComponent,InitializableComponent,ProfileAction
- Direct Known Subclasses:
PopulateSignatureSigningParameters,PopulateSignatureValidationParameters
public abstract class AbstractHandlerDelegatingProfileAction<DelegateType extends MessageHandler>
extends AbstractConditionalProfileAction
Base class for a profile action which just delegates to an instance of
MessageHandler.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DelegateTypeThe message handler delegate.private StringAn event to signal in the event of a handler exception.Lookup function for the message context on which to operate.private static final ParentProfileRequestContextLookup<MessageContext>Lookup function for parent ProfileRequestContext. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHandlerDelegatingProfileAction(DelegateType delegateInstance, ContextDataLookupFunction<ProfileRequestContext, MessageContext> lookup) Constructor.AbstractHandlerDelegatingProfileAction(Class<DelegateType> delegateClass, ContextDataLookupFunction<ProfileRequestContext, MessageContext> lookup) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Function<MessageContext,T> adapt(Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function.protected Predicate<MessageContext>adapt(Predicate<ProfileRequestContext> predicate) Adapt aProfileRequestContextpredicate into aMessageContextpredicate via composing with a lookup function.protected <T> Function<MessageContext,T> adaptRequired(Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function, disallowing nulls.protected voidprotected voiddoExecute(ProfileRequestContext profileRequestContext) Performs this action.protected DelegateTypeGet 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, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
PRC_LOOKUP
Lookup function for parent ProfileRequestContext. -
delegate
The message handler delegate. -
messageContextLookup
@Nonnull private ContextDataLookupFunction<ProfileRequestContext,MessageContext> messageContextLookupLookup function for the message context on which to operate. -
errorEvent
An event to signal in the event of a handler exception.
-
-
Constructor Details
-
Method Details
-
setErrorEvent
Set the event to signal in the event of a handler exception.- Parameters:
event- event to signal
-
doDestroy
protected void doDestroy()- Overrides:
doDestroyin classAbstractInitializableComponent
-
getDelegate
Get the delegate instance.- Returns:
- the delegate instance
-
adapt
@Nullable protected Predicate<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<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
-
adaptRequired
@Nonnull protected <T> Function<MessageContext,T> adaptRequired(@Nonnull Function<ProfileRequestContext, T> function) Adapt aProfileRequestContextfunction to aMessageContextfunction via composing with a lookup function, disallowing nulls.- Type Parameters:
T- the output type of the functions- Parameters:
function- the profile request context function- Returns:
- the message context function
- Since:
- 5.0.0
-
doExecute
Performs this action. Actions must override this method to perform their work.- Overrides:
doExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context
-