Class AccessControlListHandler

  • All Implemented Interfaces:
    HttpHandler

    public class AccessControlListHandler
    extends java.lang.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
    • Method Detail

      • handleRequest

        public void handleRequest​(HttpServerExchange exchange)
                           throws java.lang.Exception
        Description copied from interface: HttpHandler
        Handle the request.
        Specified by:
        handleRequest in interface HttpHandler
        Parameters:
        exchange - the HTTP request/response exchange
        Throws:
        java.lang.Exception
      • isDefaultAllow

        public boolean isDefaultAllow()
      • addAllow

        public AccessControlListHandler addAllow​(java.lang.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​(java.lang.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