sunlabs.brazil.handler
Class RestrictClientHandler
public
class
RestrictClientHandler
extends Object
implements Handler
Simple access control hander based on source ip addresses.
Compare the ip address of the client with a regular expression.
Only allow access to the specified url prefix if there is a match.
Properties:
- prefix, suffix, glob, match
- Specify the URL that triggers this handler.
(See MatchString).
- allow
- The regular expression that matches the
ip addresses of clients (in xxx.xxx.xxx.xxx format)
that are permitted to access url's starting with
prefix
.
- deny
- The regular expression that matches the set of ip
names that should be denied access. This is to
make complying with silly EAR requirements easier. The use
of this option implies a reverse DNS lookup, which could be
expensive, as DNS names (and not ip addresses) are used for
the comparison. Case insensitive matching is used.
- redirect
- Name of the url to re-direct to if permission is denied.
If not specified, a simple message is sent to the client.
Version: 2.2, 06/11/13
Author: Stephen Uhler
public boolean init(
Server server, String prefix)
public boolean respond(
Request request)