Package net.shibboleth.shared.servlet.impl

# Class BasicHttpServletRequestMethodValidator

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.servlet.impl.BasicHttpServletRequestMethodValidator

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

public class BasicHttpServletRequestMethodValidator extends AbstractInitializableComponent implements HttpServletRequestValidator
Component that validates the HTTP request method as one of an allowed set.

Since:
  9.2.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Set<String>`
`allowedMethods`
Allowed parameters.

## Constructor Summary

Constructors
Constructor
Description
`BasicHttpServletRequestMethodValidator()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Set<String>`
`getAllowedMethods()`
Get the allowed methods.
`void`
`setAllowedMethods(Collection<String> methods)`
Set the allowed methods.
`void`
`validate(HttpServletRequest request)`
Validate the request.

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

## Field Details

### allowedMethods

@Nonnull private Set<String> allowedMethods
Allowed parameters.

## Constructor Details

### BasicHttpServletRequestMethodValidator

public BasicHttpServletRequestMethodValidator()
Constructor.

## Method Details

### getAllowedMethods

@Nonnull @Unmodifiable @NotLive public Set<String> getAllowedMethods()
Get the allowed methods.

Returns:
  the allowed methods

### setAllowedMethods

public void setAllowedMethods(@Nullable Collection<String> methods)
Set the allowed methods.

Parameters:
  `methods` - the allowed methods

### validate

public void validate(@Nonnull HttpServletRequest request) throws ServletException
Validate the request.

Specified by:
  `validate` in interface `HttpServletRequestValidator`
Parameters:
  `request` - the request to validate
Throws:
  `ServletException` - if the request is determined to be invalid