Package org.opensaml.profile.action.impl

# Class ValidateHttpServletRequest

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

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`

public class ValidateHttpServletRequest extends AbstractConditionalProfileAction
Profile action that validates an HTTP request via an instance of `HttpServletRequestValidator`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`checkDuringInit`
Flag for whether to check for servlet request during init.
`private org.slf4j.Logger`
`log`
Logger.
`private HttpServletRequestValidator`
`validator`
Request validator.

## Constructor Summary

Constructors
Constructor
Description
`ValidateHttpServletRequest()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileContext)`
Performs this action.
`protected void`
`doInitialize()`
`HttpServletRequestValidator`
`getValidator()`
Get the request validator.
`void`
`setCheckDuringInit(boolean flag)`
Set whether {`AbstractInitializableComponent.initialize()` should throw an exception if `AbstractProfileAction.getHttpServletRequest()` returns null.
`void`
`setValidator(HttpServletRequestValidator newValidator)`
Set the request validator.

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

`doPreExecute, 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 org.slf4j.Logger log
Logger.

### checkDuringInit

private boolean checkDuringInit
Flag for whether to check for servlet request during init.

### validator

@NonnullAfterInit private HttpServletRequestValidator validator
Request validator.

## Constructor Details

### ValidateHttpServletRequest

public ValidateHttpServletRequest()
Constructor.

## Method Details

### getValidator

@NonnullAfterInit public HttpServletRequestValidator getValidator()
Get the request validator.

Returns:
  the validator

### setValidator

public void setValidator(@Nullable HttpServletRequestValidator newValidator)
Set the request validator.

Parameters:
  `newValidator` - the request validator

### setCheckDuringInit

public void setCheckDuringInit(boolean flag)
Set whether {`AbstractInitializableComponent.initialize()` should throw an exception if `AbstractProfileAction.getHttpServletRequest()` returns null.

Defaults to true.

Parameters:
  `flag` -
Since:
  5.2.0

### doInitialize

protected void doInitialize() throws ComponentInitializationException

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

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileContext)
Performs this action. Actions must override this method to perform their work.

Overrides:
  `doExecute` in class `AbstractProfileAction`
Parameters:
  `profileContext` - the current IdP profile request context