Sea 0.4.0

gov.lbl.dsd.sea.nio.auth
Class SmartHostAuthorizer

java.lang.Object
  extended bygov.lbl.dsd.sea.nio.auth.SmartHostAuthorizer
All Implemented Interfaces:
HostAuthorizer, Serializable

public class SmartHostAuthorizer
extends Object
implements HostAuthorizer, Serializable

Allow/deny rule-based mechanism to configure and query whether or not a given host is allowed to perform a certain action.

Via SmartHostAuthorizationRules supports allow and deny rules based on exact or patterned DNS host names, exact or patterned IP addresses, as well as regular expressions on "hostName/IPaddress" pairs.

Version:
$Revision: 1.5 $, $Date: 2004/06/29 00:47:03 $
See Also:
Serialized Form

Constructor Summary
SmartHostAuthorizer()
          Creates a denying authorizer (isAllowed(x) returns false).
SmartHostAuthorizer(boolean allowBeforeDeny, HostAuthorizationRules allowRules, HostAuthorizationRules denyRules)
          Creates an authorizer with the given parameters.
 
Method Summary
 HostAuthorizationRules getAllowRules()
          Returns the rules used for allow checks.
 HostAuthorizationRules getDenyRules()
          Returns the rules used for deny checks.
 boolean isAllowed(InetAddress address)
          Returns whether or not the given host (aka InetAddress) is allowed to perform a certain action, depending on the current allow/deny rules.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmartHostAuthorizer

public SmartHostAuthorizer(boolean allowBeforeDeny,
                           HostAuthorizationRules allowRules,
                           HostAuthorizationRules denyRules)
Creates an authorizer with the given parameters.

Parameters:
allowBeforeDeny - apply allow rules before deny rules, or deny rules before allow rules?
allowRules - the rules used for allow checks
denyRules - the rules used for deny checks

SmartHostAuthorizer

public SmartHostAuthorizer()
Creates a denying authorizer (isAllowed(x) returns false).

Method Detail

getAllowRules

public HostAuthorizationRules getAllowRules()
Returns the rules used for allow checks.


getDenyRules

public HostAuthorizationRules getDenyRules()
Returns the rules used for deny checks.


isAllowed

public boolean isAllowed(InetAddress address)
Returns whether or not the given host (aka InetAddress) is allowed to perform a certain action, depending on the current allow/deny rules.

Specified by:
isAllowed in interface HostAuthorizer
Parameters:
address - the host attempting to be authorized

toString

public String toString()

Sea 0.4.0