Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » valves » [javadoc | source]
org.apache.catalina.valves
abstract public class: RequestFilterValve [javadoc | source]
java.lang.Object
   org.apache.catalina.valves.ValveBase
      org.apache.catalina.valves.RequestFilterValve

All Implemented Interfaces:
    Valve, MBeanRegistration, Contained

Direct Known Subclasses:
    RemoteHostValve, RemoteAddrValve

Implementation of a Valve that performs filtering based on comparing the appropriate request property (selected based on which subclass you choose to configure into your Container's pipeline) against a set of regular expressions configured for this Valve.

This valve is configured by setting the allow and/or deny properties to a comma-delimited list of regular expressions (in the syntax supported by the jakarta-regexp library) to which the appropriate request property will be compared. Evaluation proceeds as follows:

This Valve may be attached to any Container, depending on the granularity of the filtering you wish to perform.

Field Summary
protected static  StringManager sm    The StringManager for this package. 
protected  String allow    The comma-delimited set of allow expressions. 
protected  Pattern[] allows    The set of allow regular expressions we will evaluate. 
protected  Pattern[] denies    The set of deny regular expressions we will evaluate. 
protected  String deny    The comma-delimited set of deny expressions. 
Fields inherited from org.apache.catalina.valves.ValveBase:
container,  containerLog,  info,  next,  sm,  domain,  oname,  mserver,  controller
Method from org.apache.catalina.valves.RequestFilterValve Summary:
getAllow,   getDeny,   getInfo,   invoke,   precalculate,   process,   setAllow,   setDeny
Methods from org.apache.catalina.valves.ValveBase:
backgroundProcess,   createObjectName,   event,   getContainer,   getContainerName,   getController,   getDomain,   getInfo,   getNext,   getObjectName,   getParentName,   invoke,   postDeregister,   postRegister,   preDeregister,   preRegister,   setContainer,   setController,   setNext,   setObjectName,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.valves.RequestFilterValve Detail:
 public String getAllow() 
    Return a comma-delimited set of the allow expressions configured for this Valve, if any; otherwise, return null.
 public String getDeny() 
    Return a comma-delimited set of the deny expressions configured for this Valve, if any; otherwise, return null.
 public String getInfo() 
    Return descriptive information about this Valve implementation.
 abstract public  void invoke(Request request,
    Response response) throws IOException, ServletException
    Extract the desired request property, and pass it (along with the specified request and response objects) to the protected process() method to perform the actual filtering. This method must be implemented by a concrete subclass.
 protected Pattern[] precalculate(String list) 
    Return an array of regular expression objects initialized from the specified argument, which must be null or a comma-delimited list of regular expression patterns.
 protected  void process(String property,
    Request request,
    Response response) throws IOException, ServletException 
    Perform the filtering that has been configured for this Valve, matching against the specified request property.
 public  void setAllow(String allow) 
    Set the comma-delimited set of the allow expressions configured for this Valve, if any.
 public  void setDeny(String deny) 
    Set the comma-delimited set of the deny expressions configured for this Valve, if any.