Package net.shibboleth.idp.session.impl

# Class DestroySessions

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.DestroySessions

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

public class DestroySessions extends AbstractProfileAction
Profile action that destroys any `IdPSession`s found in a `LogoutContext`.

If a `SessionContext` is found, the corresponding session is also unbound from the client and the `SessionContext` is removed.

Since:
  4.0.0
Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.IO_ERROR`
Postcondition:
  The sessions are removed from the session manager., The sessions are removed from the `LogoutContext`., The `SessionContext` is removed if it matched one of the sessions destroyed.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private LogoutContext`
`logoutContext`
LogoutContext to access.
`private Function<ProfileRequestContext,LogoutContext>`
`logoutContextLookupStrategy`
Lookup function for LogoutContext.
`private SessionContext`
`sessionContext`
SessionContext to access.
`private Function<ProfileRequestContext,SessionContext>`
`sessionContextLookupStrategy`
Lookup function for SessionContext.
`private SessionManager`
`sessionManager`
Session resolver.

## Constructor Summary

Constructors
Constructor
Description
`DestroySessions()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`void`
`setLogoutContextLookupStrategy(Function<ProfileRequestContext,LogoutContext> strategy)`
Set the lookup strategy for the LogoutContext to access.
`void`
`setSessionContextLookupStrategy(Function<ProfileRequestContext,SessionContext> strategy)`
Set the lookup strategy for the SessionContext to access.
`void`
`setSessionManager(SessionManager manager)`
Set the `SessionManager` 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, 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

### log

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

### sessionManager

@NonnullAfterInit private SessionManager sessionManager
Session resolver.

### sessionContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SessionContext> sessionContextLookupStrategy
Lookup function for SessionContext.

### logoutContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,LogoutContext> logoutContextLookupStrategy
Lookup function for LogoutContext.

### sessionContext

@Nullable private SessionContext sessionContext
SessionContext to access.

### logoutContext

@NonnullBeforeExec private LogoutContext logoutContext
LogoutContext to access.

## Constructor Details

### DestroySessions

public DestroySessions()
Constructor.

## Method Details

### setSessionManager

public void setSessionManager(@Nonnull SessionManager manager)
Set the `SessionManager` to use.

Parameters:
  `manager` - session manager to use

### setSessionContextLookupStrategy

public void setSessionContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SessionContext> strategy)
Set the lookup strategy for the SessionContext to access.

Parameters:
  `strategy` - lookup strategy

### setLogoutContextLookupStrategy

public void setLogoutContextLookupStrategy(@Nonnull Function<ProfileRequestContext,LogoutContext> strategy)
Set the lookup strategy for the LogoutContext to access.

Parameters:
  `strategy` - lookup strategy

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`