Class AbstractProfileAction
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
AbstractAuthenticationAction,AbstractCASProtocolAction,AbstractProfileInterceptorAction,AbstractSubjectCanonicalizationAction,ActionTestSupportAction,BaseAddAttributeStatementToAssertion,DestroySessions,DoLockoutManagerOperation,DoRevocationCacheOperation,DoStorageOperation,EnforceDisallowedSSOFeatures,ExtractSubjectFromRequest,FilterAttributes,FilterByQueriedAttributeDesignators,FilterByQueriedAttributes,FinalizeSAMLSubjectCanonicalization,InitializeAdministrativeProfileContextTree,InitializeAuthenticationContext,InitializeOutboundMessageContext,InitializeOutboundMessageContextForError,InitializeProfileRequestContext,InitializeProxyProfileRequestContext,InitializeRelyingPartyContextFromSAMLPeer,LogContextTree,LogSpringContextInfo,MapRequestedAttributesInAttributeConsumingService,OutputConfig,OutputMetrics,PopulateAuditContext,PopulateBindingAndEndpointContexts,PopulateEncryptionParameters,PopulateInboundMessageContextWithSAMLSelf,PopulateLogoutPropagationContext,PopulateMultiRPContextFromLogoutContext,PopulateSessionContext,PopulateSubjectContext,PopulateUserAgentContext,PrepareInboundMessageContext,PreProcessLogoutMessage,ProcessLogout,ProcessLogoutRequest,RecordResponseComplete,ReloadMetadata,ReloadServiceConfiguration,ResolveAttributes,RestoreProfileRequestContextTree,SaveLogoutContext,SaveProfileRequestContextTree,ScriptedAction,SelectLogoutPropagationFlow,SelectProfileConfiguration,SelectRelyingPartyConfiguration,SetRPUIInformation,SOAPLogoutRequest,UnlockDataSealers,UnlockPrivateKeys,UpdateSAMLSelfEntityContext,UpdateSessionWithSPSession,WebFlowMessageHandlerAdaptor,WebFlowProfileActionAdaptor,WriteAuditLog,WriteFTICKSLog
This base class takes care of the following:
- retrieving the
ProfileRequestContextfrom the current request environment - populating the SWF
RequestContextinto the profile context tree - starting or stopping any timers as instructed by a
MetricContextin the tree
Action implementations may override doExecute(RequestContext, ProfileRequestContext)
if they require SWF functionality, but most should override AbstractProfileAction.doExecute(ProfileRequestContext)
instead.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private MessageSourceMessageSource injected by Spring, typically the parent ApplicationContext itself.private Function<RequestContext,ProfileRequestContext> Strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EventdoExecute(RequestContext springRequestContext, ProfileRequestContext profileRequestContext) Spring-aware actions can override this method to fully control the execution of an Action by the Web Flow engine.execute(RequestContext springRequestContext) protected <T> TgetBean(ProfileRequestContext profileRequestContext, String name, Class<T> claz) Utilizes the active flow'sApplicationContextto obtain a bean of a given name and class.protected <T> TgetBean(RequestContext flowRequestContext, String name, Class<T> claz) Utilizes the active flow'sApplicationContextto obtain a bean of a given name and class.getMessage(String code, Object[] args, String defaultMessage, Locale locale) getMessage(String code, Object[] args, Locale locale) getMessage(MessageSourceResolvable resolvable, Locale locale) protected <T> TgetParameter(ProfileRequestContext profileRequestContext, String name) Return a casted parameter of a given name from the flow's flow or conversation scope (in that order).protected <T> TgetParameter(RequestContext flowRequestContext, String name) Return a casted parameter of a given name from the flow's flow or conversation scope (in that order).Get the strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext.protected RequestContextgetRequestContext(ProfileRequestContext profileRequestContext) Gets the SpringRequestContextfrom aSpringRequestContextstored in the context tree.protected EventgetResult(ProfileAction action, ProfileRequestContext profileRequestContext) Examines the profile context for an event to return, or signals a successful outcome if noEventContextis located; the EventContext will be removed upon completion.voidsetMessageSource(MessageSource source) voidSet the strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext.Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
doPreExecute, getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doExecute, doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, 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
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
profileContextLookupStrategy
Strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext. -
messageSource
MessageSource injected by Spring, typically the parent ApplicationContext itself.
-
-
Constructor Details
-
AbstractProfileAction
public AbstractProfileAction()Constructor. Initializes the ID of this action to the class name and callssetProfileContextLookupStrategy(Function)withWebflowRequestContextProfileRequestContextLookup.
-
-
Method Details
-
getProfileContextLookupStrategy
Get the strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext.- Returns:
- lookup strategy
-
setProfileContextLookupStrategy
public void setProfileContextLookupStrategy(@Nonnull Function<RequestContext, ProfileRequestContext> strategy) Set the strategy used to lookup theProfileRequestContextfrom a given WebFlowRequestContext.- Parameters:
strategy- lookup strategy
-
execute
-
doExecute
@Nullable protected Event doExecute(@Nonnull RequestContext springRequestContext, @Nonnull ProfileRequestContext profileRequestContext) Spring-aware actions can override this method to fully control the execution of an Action by the Web Flow engine.Alternatively they may override
AbstractProfileAction.doExecute(ProfileRequestContext)and access Spring information via aSpringRequestContextattached to the profile request context.The default implementation attaches the Spring Web Flow request context to the profile request context tree to "narrow" the execution signature to the basic OpenSAML
ProfileActioninterface. After execution, anEventContextis sought, and used to return a result back to the Web Flow engine. If no context exists, a "proceed" event is signaled.- Parameters:
springRequestContext- the Spring request contextprofileRequestContext- a profile request context- Returns:
- a Web Flow event produced by the action
-
getResult
@Nullable protected Event getResult(@Nonnull ProfileAction action, @Nonnull ProfileRequestContext profileRequestContext) Examines the profile context for an event to return, or signals a successful outcome if noEventContextis located; the EventContext will be removed upon completion.The EventContext must contain a Spring Web Flow
Eventor aString. Any other type of context data will be ignored.- Parameters:
action- the action signaling the eventprofileRequestContext- the profile request context to examine- Returns:
- an event based on the profile request context, or "proceed"
-
getBean
@Nullable protected <T> T getBean(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String name, @Nonnull Class<T> claz) Utilizes the active flow'sApplicationContextto obtain a bean of a given name and class.- Type Parameters:
T- the bean type- Parameters:
profileRequestContext- the profile request contextname- bean nameclaz- bean type- Returns:
- the bean or null
- Since:
- 4.3.0
-
getBean
@Nullable protected <T> T getBean(@Nonnull RequestContext flowRequestContext, @Nonnull @NotEmpty String name, @Nonnull Class<T> claz) Utilizes the active flow'sApplicationContextto obtain a bean of a given name and class.- Type Parameters:
T- the bean type- Parameters:
flowRequestContext- the active flow's request contextname- bean nameclaz- bean type- Returns:
- the bean or null
- Since:
- 4.3.0
-
getParameter
@Nullable protected <T> T getParameter(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String name) Return a casted parameter of a given name from the flow's flow or conversation scope (in that order).- Type Parameters:
T- the parameter type- Parameters:
profileRequestContext- profile request contextname- parameter name- Returns:
- the parameter or null
- Since:
- 4.3.0
-
getParameter
@Nullable protected <T> T getParameter(@Nonnull RequestContext flowRequestContext, @Nonnull @NotEmpty String name) Return a casted parameter of a given name from the flow's flow or conversation scope (in that order).- Type Parameters:
T- the parameter type- Parameters:
flowRequestContext- the active flow's request contextname- parameter name- Returns:
- the parameter or null
- Since:
- 4.3.0
-
setMessageSource
- Specified by:
setMessageSourcein interfaceMessageSourceAware
-
getMessage
@Nullable public String getMessage(@Nonnull String code, @Nullable Object[] args, @Nullable String defaultMessage, @Nonnull Locale locale) - Specified by:
getMessagein interfaceMessageSource
-
getMessage
@Nonnull public String getMessage(@Nonnull String code, @Nullable Object[] args, @Nonnull Locale locale) - Specified by:
getMessagein interfaceMessageSource
-
getMessage
@Nonnull public String getMessage(@Nonnull MessageSourceResolvable resolvable, @Nonnull Locale locale) - Specified by:
getMessagein interfaceMessageSource
-
getRequestContext
@Nullable protected RequestContext getRequestContext(@Nonnull ProfileRequestContext profileRequestContext) Gets the SpringRequestContextfrom aSpringRequestContextstored in the context tree.- Parameters:
profileRequestContext- Profile request context.- Returns:
- Spring request context.
-