org.tuckey.web.filters.urlrewrite
Class Conf

java.lang.Object
  extended by org.tuckey.web.filters.urlrewrite.Conf
Direct Known Subclasses:
SampleConfExt

public class Conf
extends java.lang.Object

Configuration object for urlrewrite filter.

Version:
$Revision: 43 $ $Date: 2006-10-31 17:29:59 +1300 (Tue, 31 Oct 2006) $
Author:
Paul Tuckey

Field Summary
protected  java.lang.String decodeUsing
           
protected  java.lang.String defaultMatchType
           
protected  boolean useContext
           
protected  boolean useQueryString
           
 
Constructor Summary
Conf()
          Empty const for testing etc.
Conf(java.io.InputStream inputStream, java.lang.String conffile)
          Constructor when run elements don't need to be initialised correctly, for docuementation etc.
Conf(javax.servlet.ServletContext context, java.io.InputStream inputStream, java.lang.String fileName, java.lang.String systemId)
          Constructor for use only when loading XML style configuration.
Conf(javax.servlet.ServletContext context, java.io.InputStream inputStream, java.lang.String fileName, java.lang.String systemId, boolean modRewriteStyleConf)
          Normal constructor.
Conf(java.net.URL confUrl)
          Constructor when run elements don't need to be initialised correctly, for docuementation etc.
 
Method Summary
 void addOutboundRule(OutboundRule outboundRule)
          Will add the rule to the rules list.
 void addRule(Rule rule)
          Will add the rule to the rules list.
 void destroy()
          Destory the conf gracefully.
 java.util.List getCatchElems()
           
 java.lang.String getDecodeUsing()
           
 java.lang.String getDefaultMatchType()
           
 java.util.List getErrors()
          Will get the List of errors.
 java.lang.String getFileName()
           
 java.util.Date getLoadedDate()
           
 java.util.List getOutboundRules()
          Will get the List of outbound rules.
 java.util.List getRules()
          Will get the List of rules.
 void initialise()
          Initialise the conf file.
 boolean isDecodeUsingCustomCharsetRequired()
           
 boolean isDecodeUsingEncodingHeader()
           
 boolean isEngineEnabled()
           
 boolean isLoadedFromFile()
           
 boolean isOk()
          true if the conf has been loaded ok.
 boolean isUseContext()
           
 boolean isUseQueryString()
           
protected  void loadDom(java.io.InputStream inputStream)
          Load the dom document from the inputstream

Note, protected so that is can be extended.

protected  void loadModRewriteStyle(java.io.InputStream inputStream)
           
protected  void processConfDoc(org.w3c.dom.Document doc)
          Process dom document and populate Conf object.
 void setDecodeUsing(java.lang.String decodeUsing)
           
 void setDefaultMatchType(java.lang.String defaultMatchType)
           
 void setEngineEnabled(boolean engineEnabled)
           
 void setUseContext(boolean useContext)
           
 void setUseQueryString(boolean useQueryString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useQueryString

protected boolean useQueryString

useContext

protected boolean useContext

decodeUsing

protected java.lang.String decodeUsing

defaultMatchType

protected java.lang.String defaultMatchType
Constructor Detail

Conf

public Conf()
Empty const for testing etc.


Conf

public Conf(javax.servlet.ServletContext context,
            java.io.InputStream inputStream,
            java.lang.String fileName,
            java.lang.String systemId)
Constructor for use only when loading XML style configuration.

Parameters:
fileName - to display on status screen

Conf

public Conf(javax.servlet.ServletContext context,
            java.io.InputStream inputStream,
            java.lang.String fileName,
            java.lang.String systemId,
            boolean modRewriteStyleConf)
Normal constructor.

Parameters:
fileName - to display on status screen
modRewriteStyleConf - true if loading mod_rewrite style conf

Conf

public Conf(java.net.URL confUrl)
Constructor when run elements don't need to be initialised correctly, for docuementation etc.


Conf

public Conf(java.io.InputStream inputStream,
            java.lang.String conffile)
Constructor when run elements don't need to be initialised correctly, for docuementation etc.

Method Detail

loadModRewriteStyle

protected void loadModRewriteStyle(java.io.InputStream inputStream)

loadDom

protected void loadDom(java.io.InputStream inputStream)
Load the dom document from the inputstream

Note, protected so that is can be extended.

Parameters:
inputStream - stream of the conf file to load

processConfDoc

protected void processConfDoc(org.w3c.dom.Document doc)
Process dom document and populate Conf object.

Note, protected so that is can be extended.


initialise

public void initialise()
Initialise the conf file. This will run initialise on each rule and condition in the conf file.


destroy

public void destroy()
Destory the conf gracefully.


addRule

public void addRule(Rule rule)
Will add the rule to the rules list.

Parameters:
rule - The Rule to add

addOutboundRule

public void addOutboundRule(OutboundRule outboundRule)
Will add the rule to the rules list.

Parameters:
outboundRule - The outbound rule to add

getErrors

public java.util.List getErrors()
Will get the List of errors.

Returns:
the List of errors

getRules

public java.util.List getRules()
Will get the List of rules.

Returns:
the List of rules

getOutboundRules

public java.util.List getOutboundRules()
Will get the List of outbound rules.

Returns:
the List of outbound rules

isOk

public boolean isOk()
true if the conf has been loaded ok.

Returns:
boolean

getLoadedDate

public java.util.Date getLoadedDate()

getFileName

public java.lang.String getFileName()

isUseQueryString

public boolean isUseQueryString()

setUseQueryString

public void setUseQueryString(boolean useQueryString)

isUseContext

public boolean isUseContext()

setUseContext

public void setUseContext(boolean useContext)

getDecodeUsing

public java.lang.String getDecodeUsing()

setDecodeUsing

public void setDecodeUsing(java.lang.String decodeUsing)

setDefaultMatchType

public void setDefaultMatchType(java.lang.String defaultMatchType)

getDefaultMatchType

public java.lang.String getDefaultMatchType()

getCatchElems

public java.util.List getCatchElems()

isDecodeUsingCustomCharsetRequired

public boolean isDecodeUsingCustomCharsetRequired()

isEngineEnabled

public boolean isEngineEnabled()

setEngineEnabled

public void setEngineEnabled(boolean engineEnabled)

isLoadedFromFile

public boolean isLoadedFromFile()

isDecodeUsingEncodingHeader

public boolean isDecodeUsingEncodingHeader()