io.undertow.server.handlers

## Class AllowedMethodsHandler

- java.lang.Object
- - io.undertow.server.handlers.AllowedMethodsHandler

All Implemented Interfaces:
  HttpHandler

    public class AllowedMethodsHandler
    extends Object
    implements HttpHandler

Handler that whitelists certain HTTP methods. Only requests with a method in the allowed methods set will be allowed to continue.

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `AllowedMethodsHandler.Builder`

### Constructor Summary

Constructors
Constructor and Description
`AllowedMethodsHandler(HttpHandler next, HttpString... allowedMethods)`
`AllowedMethodsHandler(HttpHandler next, Set<HttpString> allowedMethods)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Set<HttpString>` `getAllowedMethods()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`String` `toString()`

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

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

### Constructor Detail

#### AllowedMethodsHandler

    public AllowedMethodsHandler(HttpHandler next,
                                 Set<HttpString> allowedMethods)

#### AllowedMethodsHandler

    public AllowedMethodsHandler(HttpHandler next,
                                 HttpString... allowedMethods)

### Method Detail

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`

#### getAllowedMethods

    public Set<HttpString> getAllowedMethods()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`