com.cafesoft.core.regex
Class PropertiesRegexFilterFactory

java.lang.Object
  extended by com.cafesoft.core.regex.PropertiesRegexFilterFactory

public class PropertiesRegexFilterFactory
extends Object

PropertiesRegexFilterFactory implements a factory for RegexFilter instances configured via a Properties values. Inclusion regular expressions and exclusion regular expressions are configured with property names that * end with "include.N" and "exclude.N" where N is an integer starting with 1 and continuing in sequence for as many values as needed. The value of each "include" and "exclude" property is a regular expression used to match a String.


Constructor Summary
PropertiesRegexFilterFactory()
           
 
Method Summary
static RegexFilter create(Properties properties, String prefix, boolean failOnError, Logger logger, boolean debug)
          Create a RegexFilter from values in a Properties object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesRegexFilterFactory

public PropertiesRegexFilterFactory()
Method Detail

create

public static RegexFilter create(Properties properties,
                                 String prefix,
                                 boolean failOnError,
                                 Logger logger,
                                 boolean debug)
                          throws RegexFilterConfigException
Create a RegexFilter from values in a Properties object. Allocate the RegexFilter and nested objects on a memory pool (if specified) or on the general memory heap if the pool is NULL. NOTE: PropertiesRegexFilterFactory.class factory uses configuration property names of the form: {prefix}include.[1-N]= For example: cams.http.headers.filter.regex.include.1= cams.http.headers.filter.regex.include.2= cams.http.headers.filter.regex.exclude.1= where: prefix=cams.http.headers.filter.regex. and: [1-N]=1, 2, 3

Parameters:
properties - the Properties object providing the configuration data for creating the RegexFilter.
prefix - the prefix of property names configuring RegexFilter instances.
failOnError - if true and a configuration error exists, throw a RegexFilterConfigException and return a null RegexFilter. If false, then log warning messages regarding configuration errors, but continue creating the RegexFilter loaded with whichever configuration options are valid.
logger - a Logger used to display DEBUG-level information (if enabled).
debug - a flag used to enable/disable DEBUG-level messages.
Returns:
a RegexFilter instance or null if a configuration error.
Throws:
RegexFilterConfigException - if unable to create the RegexFilter.


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.