io.undertow.server.handlers

## Class AccessControlListHandler

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

All Implemented Interfaces:
  HttpHandler

    public class AccessControlListHandler
    extends Object
    implements HttpHandler

Handler that can accept or reject a request based on an attribute of the remote peer todo: should we support non-regex values for performance reasons?

Author:
  Stuart Douglas, Andre Dietisheim

### Nested Class Summary

Nested Classes
`static class` `AccessControlListHandler.Builder`

### Constructor Summary

Constructors
Constructor and Description
`AccessControlListHandler(ExchangeAttribute attribute)`
`AccessControlListHandler(HttpHandler next, ExchangeAttribute attribute)`

### Method Summary

All Methods Instance Methods Concrete Methods
`AccessControlListHandler` `addAllow(String pattern)` Adds an allowed user agent peer to the ACL list
`AccessControlListHandler` `addDeny(String pattern)` Adds an denied user agent to the ACL list
`AccessControlListHandler` `clearRules()`
`HttpHandler` `getNext()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`boolean` `isDefaultAllow()`
`AccessControlListHandler` `setDefaultAllow(boolean defaultAllow)`
`AccessControlListHandler` `setNext(HttpHandler next)`

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

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

### Constructor Detail

#### AccessControlListHandler

    public AccessControlListHandler(HttpHandler next,
                                    ExchangeAttribute attribute)

#### AccessControlListHandler

    public AccessControlListHandler(ExchangeAttribute attribute)

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

#### isDefaultAllow

    public boolean isDefaultAllow()

#### setDefaultAllow

    public AccessControlListHandler setDefaultAllow(boolean defaultAllow)

#### getNext

    public HttpHandler getNext()

#### setNext

    public AccessControlListHandler setNext(HttpHandler next)

#### addAllow

    public AccessControlListHandler addAllow(String pattern)

Adds an allowed user agent peer to the ACL list

User agent may be given as regex

Parameters:
  `pattern` - The pattern to add to the ACL

#### addDeny

    public AccessControlListHandler addDeny(String pattern)

Adds an denied user agent to the ACL list

User agent may be given as regex

Parameters:
  `pattern` - The user agent to add to the ACL

#### clearRules

    public AccessControlListHandler clearRules()