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

@ThreadSafe public abstract class AbstractProfileAction extends AbstractConditionalProfileAction implements Action, MessageSource, MessageSourceAware
Base class for Spring-aware profile actions.

This base class takes care of the following:

Action implementations may override doExecute(RequestContext, ProfileRequestContext) if they require SWF functionality, but most should override AbstractProfileAction.doExecute(ProfileRequestContext) instead.

  • Field Details

  • Constructor Details

  • Method Details

    • getProfileContextLookupStrategy

      @Nonnull public Function<RequestContext,ProfileRequestContext> getProfileContextLookupStrategy()
      Get the strategy used to lookup the ProfileRequestContext from a given WebFlow RequestContext.
      Returns:
      lookup strategy
    • setProfileContextLookupStrategy

      public void setProfileContextLookupStrategy(@Nonnull Function<RequestContext,ProfileRequestContext> strategy)
      Set the strategy used to lookup the ProfileRequestContext from a given WebFlow RequestContext.
      Parameters:
      strategy - lookup strategy
    • execute

      @Nullable public Event execute(@Nullable RequestContext springRequestContext)
      Specified by:
      execute in interface Action
    • 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 a SpringRequestContext attached 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 ProfileAction interface. After execution, an EventContext is 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 context
      profileRequestContext - 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 no EventContext is located; the EventContext will be removed upon completion.

      The EventContext must contain a Spring Web Flow Event or a String. Any other type of context data will be ignored.

      Parameters:
      action - the action signaling the event
      profileRequestContext - 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's ApplicationContext to obtain a bean of a given name and class.
      Type Parameters:
      T - the bean type
      Parameters:
      profileRequestContext - the profile request context
      name - bean name
      claz - 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's ApplicationContext to obtain a bean of a given name and class.
      Type Parameters:
      T - the bean type
      Parameters:
      flowRequestContext - the active flow's request context
      name - bean name
      claz - 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 context
      name - 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 context
      name - parameter name
      Returns:
      the parameter or null
      Since:
      4.3.0
    • setMessageSource

      public void setMessageSource(@Nullable MessageSource source)
      Specified by:
      setMessageSource in interface MessageSourceAware
    • getMessage

      @Nullable public String getMessage(@Nonnull String code, @Nullable Object[] args, @Nullable String defaultMessage, @Nonnull Locale locale)
      Specified by:
      getMessage in interface MessageSource
    • getMessage

      @Nonnull public String getMessage(@Nonnull String code, @Nullable Object[] args, @Nonnull Locale locale)
      Specified by:
      getMessage in interface MessageSource
    • getMessage

      @Nonnull public String getMessage(@Nonnull MessageSourceResolvable resolvable, @Nonnull Locale locale)
      Specified by:
      getMessage in interface MessageSource
    • getRequestContext

      @Nullable protected RequestContext getRequestContext(@Nonnull ProfileRequestContext profileRequestContext)
      Gets the Spring RequestContext from a SpringRequestContext stored in the context tree.
      Parameters:
      profileRequestContext - Profile request context.
      Returns:
      Spring request context.