Package net.shibboleth.idp.saml.saml2.profile.impl

# Class PreProcessLogoutMessage

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.saml.saml2.profile.impl.PreProcessLogoutMessage

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

public class PreProcessLogoutMessage extends AbstractProfileAction
Profile action that performs initial analysis of a `LogoutRequest` or `LogoutResponse` to dispatch it for subsequent processing.

This action is essentially three decision states in one, using some custom events.

If the inbound message is a `LogoutResponse` then the event "IsLogoutResponse" is signaled.

If the inbound message is a `LogoutRequest`, then one of two events is signaled. If the request contains the `Asynchronous` extension, then the "IsLogoutRequestAsync" event is signaled. This also occurs, provided a particular option is enabled, if the request does not contain the extension but there is no SAML metadata available for the requester or the metadata contains no `SingleLogoutService` endpoints.

Finally, `EventIds.PROCEED_EVENT_ID` is the result if neither of the above applies.

Various standard events may occur if the message is missing or isn't an appropriate type.

Since:
  4.2.0
Event:
  `IS_LOGOUT_RESPONSE`, `IS_LOGOUT_REQUEST_ASYNC`, `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.INVALID_MESSAGE`

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`assumeAsync`
Assume asynchronous in absence of metadata.
`static final String`
`IS_LOGOUT_REQUEST_ASYNC`
Event to signal for a logout response.
`static final String`
`IS_LOGOUT_RESPONSE`
Event to signal for a logout response.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,SAMLMetadataContext>`
`metadataContextLookupStrategy`
Lookup strategy for metadata context.

## Constructor Summary

Constructors
Constructor
Description
`PreProcessLogoutMessage()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`void`
`setAssumeAsynchronousLogout(boolean flag)`
Sets whether to treat logout requests as asynchronous (not requiring a response) if no metadata is available or lacks endpoints.
`void`
`setMetadataContextLookupStrategy(Function<ProfileRequestContext,SAMLMetadataContext> strategy)`
Set the lookup strategy for the `SAMLMetadataContext`.

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

### IS_LOGOUT_RESPONSE

@Nonnull public static final String IS_LOGOUT_RESPONSE
Event to signal for a logout response.

See Also:
  - Constant Field Values

### IS_LOGOUT_REQUEST_ASYNC

@Nonnull public static final String IS_LOGOUT_REQUEST_ASYNC
Event to signal for a logout response.

See Also:
  - Constant Field Values

### log

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

### assumeAsync

private boolean assumeAsync
Assume asynchronous in absence of metadata.

### metadataContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SAMLMetadataContext> metadataContextLookupStrategy
Lookup strategy for metadata context.

## Constructor Details

### PreProcessLogoutMessage

public PreProcessLogoutMessage()
Constructor.

## Method Details

### setAssumeAsynchronousLogout

public void setAssumeAsynchronousLogout(boolean flag)
Sets whether to treat logout requests as asynchronous (not requiring a response) if no metadata is available or lacks endpoints.

Defaults to false.

Parameters:
  `flag` - what to set

### setMetadataContextLookupStrategy

public void setMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLMetadataContext> strategy)
Set the lookup strategy for the `SAMLMetadataContext`.

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`