com.zeevbelkin.web.filter.access
Class Yaaf.RegexAccessChecker

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<ComparablePattern,java.util.Set<java.lang.String>>
          extended by com.zeevbelkin.web.filter.access.Yaaf.RegexAccessChecker
All Implemented Interfaces:
Yaaf.UrlAccessChecker, java.io.Serializable, java.lang.Cloneable, java.util.Map<ComparablePattern,java.util.Set<java.lang.String>>
Enclosing class:
Yaaf

public static class Yaaf.RegexAccessChecker
extends java.util.Hashtable<ComparablePattern,java.util.Set<java.lang.String>>
implements Yaaf.UrlAccessChecker

This class is an implementation of the UrlAccessChecker based on using of regular expressions. The checker maps regular expressions to the list of the roles those have permissions to access matched URL's. If no URL's are gived the checker always returns ALLOWED. Ordinary, an access restriction file is used to initialize the filter checker.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.zeevbelkin.web.filter.access.Yaaf.UrlAccessChecker
Yaaf.UrlAccessChecker.Decision
 
Constructor Summary
Yaaf.RegexAccessChecker()
           
 
Method Summary
 void add(java.lang.String regex, java.lang.String consumer)
          adds a role to the list of roles those have permission to access URL's those match the pattern
 Yaaf.UrlAccessChecker.Decision check(Yaaf.RoleResolver resolver, java.lang.String url)
          returns the checker decision that can be ALLOWED, FORBIDDEN or AUTHENTICATION_REQUIRED
 void remove(java.lang.String regex, java.lang.String consumer)
          removes a role from the list of roles those have permission to access URL's those match the pattern
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Yaaf.RegexAccessChecker

public Yaaf.RegexAccessChecker()
Method Detail

remove

public void remove(java.lang.String regex,
                   java.lang.String consumer)
removes a role from the list of roles those have permission to access URL's those match the pattern

Parameters:
consumer - the role
regex - the regular expression

add

public void add(java.lang.String regex,
                java.lang.String consumer)
adds a role to the list of roles those have permission to access URL's those match the pattern

Parameters:
consumer - the role
regex - the regular expression

check

public Yaaf.UrlAccessChecker.Decision check(Yaaf.RoleResolver resolver,
                                            java.lang.String url)
returns the checker decision that can be ALLOWED, FORBIDDEN or AUTHENTICATION_REQUIRED

Specified by:
check in interface Yaaf.UrlAccessChecker
Parameters:
resolver - the resolver identifying the user, or null in case of an unauthenticated user
url -
Returns:
the decision