Package 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 Modifier and Type Class Description static class
AccessControlListHandler.Builder
-
Constructor Summary
Constructors Constructor Description AccessControlListHandler(ExchangeAttribute attribute)
AccessControlListHandler(HttpHandler next, ExchangeAttribute attribute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessControlListHandler
addAllow(String pattern)
Adds an allowed user agent peer to the ACL listAccessControlListHandler
addDeny(String pattern)
Adds an denied user agent to the ACL listAccessControlListHandler
clearRules()
HttpHandler
getNext()
void
handleRequest(HttpServerExchange exchange)
Handle the request.boolean
isDefaultAllow()
AccessControlListHandler
setDefaultAllow(boolean defaultAllow)
AccessControlListHandler
setNext(HttpHandler next)
-
-
-
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 interfaceHttpHandler
- 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 listUser 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 listUser agent may be given as regex
- Parameters:
pattern
- The user agent to add to the ACL
-
clearRules
public AccessControlListHandler clearRules()
-
-