Package net.shibboleth.idp.profile.interceptor

# Class ExternalInterceptor

java.lang.Object
net.shibboleth.idp.profile.interceptor.ExternalInterceptor

Direct Known Subclasses:
  `ExternalInterceptorImpl`

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 final String`
`CONVERSATION_KEY`
Parameter supplied to identify the per-conversation parameter.
`static final String`
`EVENT_KEY`
Request attribute to which an event ID may be bound.
`static final String`
`SWF_KEY`
Parameter supplied to locate the SWF object needed in the servlet context.

## Constructor Summary

Constructors
Constructor
Description
`ExternalInterceptor()`

## Method Summary

Modifier and Type
Method
Description
`protected abstract void`
`doFinish(HttpServletRequest request, HttpServletResponse response, 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(HttpServletRequest request, 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, HttpServletRequest request, 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(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 ProfileRequestContext`
`getProfileRequestContext(String key, HttpServletRequest request)`
Get the `ProfileRequestContext` associated with a request.
`static String`
`startExternalInterceptor(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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 Details

### ExternalInterceptor

public ExternalInterceptor()

## Method Details

### 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

### startExternalInterceptor

@Nonnull @NotEmpty public static String startExternalInterceptor(@Nonnull HttpServletRequest request) 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
Returns:
  a handle to subsequent use of `finishExternalInterceptor(java.lang.String, HttpServletRequest, HttpServletResponse)`
Throws:
  `ExternalInterceptorException` - if an error occurs

### finishExternalInterceptor

public static void finishExternalInterceptor(@Nonnull @NotEmpty String key, @Nonnull HttpServletRequest request, @Nonnull 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

### getProfileRequestContext

@Nonnull public static ProfileRequestContext getProfileRequestContext(@Nonnull @NotEmpty String key, @Nonnull HttpServletRequest request) throws ExternalInterceptorException
Get the `ProfileRequestContext` associated with a request.

Parameters:
  `key` - the value returned by `startExternalInterceptor(HttpServletRequest)`
  `request` - servlet request
Returns:
  the profile request context
Throws:
  `ExternalInterceptorException` - if an error occurs

### getExternalInterceptorContext

@Nonnull private static ExternalInterceptorContext getExternalInterceptorContext(@Nonnull ProfileRequestContext profileRequestContext) throws ExternalInterceptorException
Utility method to access the `ExternalInterceptorContext`.

Parameters:
  `profileRequestContext` - profile request context
Returns:
  the `ExternalInterceptorContext` to operate on
Throws:
  `ExternalInterceptorException` - if the context is missing

### doStart

protected void doStart(@Nonnull HttpServletRequest request, @Nonnull 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 HttpServletRequest request, @Nonnull HttpServletResponse response, @Nonnull 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