Class AbstractProfileAction

  • 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
    Direct Known Subclasses:
    AbstractConditionalProfileAction

    @Prototype
    public abstract class AbstractProfileAction
    extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
    implements ProfileAction
    Base class for profile actions. This base class is annotated with Prototype to indicate that it is stateful.
    • Field Detail

      • logPrefix

        @Nullable
        private String logPrefix
        Cached log prefix.
      • httpServletRequest

        @Nullable
        private javax.servlet.http.HttpServletRequest httpServletRequest
        Current HTTP request, if available.
      • httpServletResponse

        @Nullable
        private javax.servlet.http.HttpServletResponse httpServletResponse
        Current HTTP response, if available.
    • Constructor Detail

      • AbstractProfileAction

        public AbstractProfileAction()
    • Method Detail

      • getHttpServletRequest

        @Nullable
        public javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Get the current HTTP request if available.
        Returns:
        current HTTP request
      • setHttpServletRequest

        public void setHttpServletRequest​(@Nullable
                                          javax.servlet.http.HttpServletRequest request)
        Set the current HTTP request.
        Parameters:
        request - current HTTP request
      • getHttpServletResponse

        @Nullable
        public javax.servlet.http.HttpServletResponse getHttpServletResponse()
        Get the current HTTP response.
        Returns:
        current HTTP response
      • setHttpServletResponse

        public void setHttpServletResponse​(@Nullable
                                           javax.servlet.http.HttpServletResponse response)
        Set the current HTTP response.
        Parameters:
        response - current HTTP response
      • execute

        public void execute​(@Nonnull
                            ProfileRequestContext profileRequestContext)
        Performs this action.
        Specified by:
        execute in interface ProfileAction
        Parameters:
        profileRequestContext - the current IdP profile request context
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       ProfileRequestContext profileRequestContext)
        Called prior to execution, actions may override this method to perform pre-processing for a request.

        If false is returned, execution will not proceed, and the action should attach an EventContext to the context tree to signal how to continue with overall workflow processing.

        If returning successfully, the last step should be to return the result of the superclass version of this method.

        Parameters:
        profileRequestContext - the current IdP profile request context
        Returns:
        true iff execution should proceed
      • doExecute

        protected void doExecute​(@Nonnull
                                 ProfileRequestContext profileRequestContext)
        Performs this action. Actions must override this method to perform their work.
        Parameters:
        profileRequestContext - the current IdP profile request context
      • getLogPrefix

        @Nonnull
        @NotEmpty
        protected String getLogPrefix()
        Return a prefix for logging messages for this component.
        Returns:
        a string for insertion at the beginning of any log messages