Package net.shibboleth.idp.session.impl

# Class PopulateLogoutPropagationContext

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.session.impl.PopulateLogoutPropagationContext

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class PopulateLogoutPropagationContext extends AbstractProfileAction
Profile action that creates a `LogoutPropagationContext` containing `SPSession` to be destroyed. The SP sessions may be populated:

- By reference - via SessionKey request parameter that looks up one `SPSession` from a `LogoutContext` stored in the HTTP session.
- By value - reconstitutes an encrypted `SPSession` object in SPSession request parameter.
- By lookup strategy.

Event:
  SessionNotFound, `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.UNABLE_TO_DECODE`
Postcondition:
  If an `SPSession` is found, then a `LogoutPropagationContext` will be populated.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,LogoutPropagationContext>`
`contextCreationStrategy`
Lookup/creation function for LogoutPropagationContext.
`private DataSealer`
`dataSealer`
`DataSealer` to use.
`private final org.slf4j.Logger`
`log`
Class logger.
`private SPSession`
`session`
`SPSession` to operate on.
`private static final String`
`SESSION_NOT_FOUND`
Name of parameter containing session by reference.
`private static final String`
`SESSION_PARAM_BYREF`
Name of parameter containing session by reference.
`private static final String`
`SESSION_PARAM_BYVAL`
Name of parameter containing session by value.
`private String`
`sessionKey`
The value used to look up a session by reference.
`private Function<ProfileRequestContext,SPSession>`
`sessionLookupStrategy`
Lookup strategy for session.
`private SPSessionSerializerRegistry`
`spSessionSerializerRegistry`
Mappings between a SPSession type and a serializer implementation.

## Constructor Summary

Constructors
Constructor
Description
`PopulateLogoutPropagationContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`private SPSession`
`getSessionByReference(RequestContext requestContext, String key)`
Get an `SPSession` by reference.
`private SPSession`
`getSessionByValue(String sessionVal)`
Get an `SPSession` by value.
`void`
`setDataSealer(DataSealer sealer)`
Set the `DataSealer` to use.
`void`
`setLogoutPropagationContextCreationStrategy(Function<ProfileRequestContext,LogoutPropagationContext> strategy)`
Set the creation/lookup strategy for the `LogoutPropagationContext`.
`void`
`setSessionLookupStrategy(Function<ProfileRequestContext,SPSession> strategy)`
Set a lookup strategy to use to obtain the session to populate.
`void`
`setSPSessionSerializerRegistry(SPSessionSerializerRegistry registry)`
Set the `SPSessionSerializerRegistry` to use.

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy`

### Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

`getActivationCondition, setActivationCondition`

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### SESSION_NOT_FOUND

@Nonnull @NotEmpty private static final String SESSION_NOT_FOUND
Name of parameter containing session by reference.

See Also:
  - Constant Field Values

### SESSION_PARAM_BYREF

@Nonnull @NotEmpty private static final String SESSION_PARAM_BYREF
Name of parameter containing session by reference.

See Also:
  - Constant Field Values

### SESSION_PARAM_BYVAL

@Nonnull @NotEmpty private static final String SESSION_PARAM_BYVAL
Name of parameter containing session by value.

See Also:
  - Constant Field Values

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### dataSealer

@Nullable private DataSealer dataSealer
`DataSealer` to use.

### spSessionSerializerRegistry

@Nullable private SPSessionSerializerRegistry spSessionSerializerRegistry
Mappings between a SPSession type and a serializer implementation.

### contextCreationStrategy

@Nonnull private Function<ProfileRequestContext,LogoutPropagationContext> contextCreationStrategy
Lookup/creation function for LogoutPropagationContext.

### sessionLookupStrategy

@Nullable private Function<ProfileRequestContext,SPSession> sessionLookupStrategy
Lookup strategy for session.

### session

@NonnullBeforeExec private SPSession session
`SPSession` to operate on.

### sessionKey

@Nullable private String sessionKey
The value used to look up a session by reference.

## Constructor Details

### PopulateLogoutPropagationContext

public PopulateLogoutPropagationContext()
Constructor.

## Method Details

### setDataSealer

public void setDataSealer(@Nullable DataSealer sealer)
Set the `DataSealer` to use.

Parameters:
  `sealer` - the `DataSealer` to use

### setSPSessionSerializerRegistry

public void setSPSessionSerializerRegistry(@Nullable SPSessionSerializerRegistry registry)
Set the `SPSessionSerializerRegistry` to use.

Parameters:
  `registry` - a registry of SPSession class to serializer mappings

### setLogoutPropagationContextCreationStrategy

public void setLogoutPropagationContextCreationStrategy(@Nonnull Function<ProfileRequestContext,LogoutPropagationContext> strategy)
Set the creation/lookup strategy for the `LogoutPropagationContext`.

Parameters:
  `strategy` - creation/lookup strategy

### setSessionLookupStrategy

public void setSessionLookupStrategy(@Nullable Function<ProfileRequestContext,SPSession> strategy)
Set a lookup strategy to use to obtain the session to populate.

Parameters:
  `strategy` - lookup strategy

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### getSessionByReference

@Nonnull private SPSession getSessionByReference(@Nonnull RequestContext requestContext, @Nonnull String key) throws MessageException
Get an `SPSession` by reference.

Parameters:
  `requestContext` - Spring request context
  `key` - session key identifying the SP session
Returns:
  the SP session
Throws:
  `MessageException` - if an error occurs

### getSessionByValue

@Nonnull private SPSession getSessionByValue(@Nonnull String sessionVal) throws MessageDecodingException
Get an `SPSession` by value.

Parameters:
  `sessionVal` - serialized SP session
Returns:
  the SP session
Throws:
  `MessageDecodingException` - if an error occurs