Class ExternalInterceptor


  • public abstract class ExternalInterceptor
    extends Object
    Public interface supporting external interceptor flows outside the webflow engine.
    Since:
    4.0.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String CONVERSATION_KEY
      Parameter supplied to identify the per-conversation parameter.
      static String EVENT_KEY
      Request attribute to which an event ID may be bound.
      static String SWF_KEY
      Parameter supplied to locate the SWF object needed in the servlet context.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void doFinish​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.opensaml.profile.context.ProfileRequestContext profileRequestContext, ExternalInterceptorContext externalInterceptorContext)
      Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.
      protected void doStart​(javax.servlet.http.HttpServletRequest request, org.opensaml.profile.context.ProfileRequestContext profileRequestContext, ExternalInterceptorContext externalInterceptorContext)
      Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.
      static void finishExternalInterceptor​(String key, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.
      private static ExternalInterceptorContext getExternalInterceptorContext​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
      Utility method to access the ExternalInterceptorContext.
      static String getExternalRedirect​(String baseLocation, String conversationValue)
      Computes the appropriate location to pass control to to invoke an external interceptor mechanism.
      static org.opensaml.profile.context.ProfileRequestContext getProfileRequestContext​(String key, javax.servlet.http.HttpServletRequest request)
      Get the ProfileRequestContext associated with a request.
      static String startExternalInterceptor​(javax.servlet.http.HttpServletRequest request)
      Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.
    • Field Detail

      • SWF_KEY

        @Nonnull
        @NotEmpty
        public static final String SWF_KEY
        Parameter supplied to locate the SWF object needed in the servlet context.
        See Also:
        Constant Field Values
      • CONVERSATION_KEY

        @Nonnull
        @NotEmpty
        public static final String CONVERSATION_KEY
        Parameter supplied to identify the per-conversation parameter.
        See Also:
        Constant Field Values
      • EVENT_KEY

        @Nonnull
        @NotEmpty
        public static final String EVENT_KEY
        Request attribute to which an event ID may be bound.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExternalInterceptor

        public ExternalInterceptor()
    • Method Detail

      • getExternalRedirect

        @Nonnull
        @NotEmpty
        public static String getExternalRedirect​(@Nonnull @NotEmpty
                                                 String baseLocation,
                                                 @Nonnull @NotEmpty
                                                 String conversationValue)
        Computes the appropriate location to pass control to to invoke an external interceptor mechanism.

        The input location should be suitable for use in a Spring "externalRedirect" expression, and may contain a query string. The result will include any additional parameters needed to invoke the mechanism.

        Parameters:
        baseLocation - the base location to build off of
        conversationValue - the value to include as a conversation ID
        Returns:
        the computed location
      • finishExternalInterceptor

        public static void finishExternalInterceptor​(@Nonnull @NotEmpty
                                                     String key,
                                                     @Nonnull
                                                     javax.servlet.http.HttpServletRequest request,
                                                     @Nonnull
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws ExternalInterceptorException,
                                                     IOException
        Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.
        Parameters:
        key - the value returned by startExternalInterceptor(HttpServletRequest)
        request - servlet request
        response - servlet response
        Throws:
        ExternalInterceptorException - if an error occurs
        IOException - if the redirect cannot be issued
      • doStart

        protected void doStart​(@Nonnull
                               javax.servlet.http.HttpServletRequest request,
                               @Nonnull
                               org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                               @Nonnull
                               ExternalInterceptorContext externalInterceptorContext)
                        throws ExternalInterceptorException
        Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.
        Parameters:
        request - servlet request
        profileRequestContext - profile request context
        externalInterceptorContext - external interceptor context
        Throws:
        ExternalInterceptorException - if an error occurs
      • doFinish

        protected abstract void doFinish​(@Nonnull
                                         javax.servlet.http.HttpServletRequest request,
                                         @Nonnull
                                         javax.servlet.http.HttpServletResponse response,
                                         @Nonnull
                                         org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                         @Nonnull
                                         ExternalInterceptorContext externalInterceptorContext)
                                  throws ExternalInterceptorException,
                                         IOException
        Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.
        Parameters:
        request - servlet request
        response - servlet response
        profileRequestContext - profile request context
        externalInterceptorContext - external interceptor context
        Throws:
        ExternalInterceptorException - if an error occurs
        IOException - if the redirect cannot be issued