org.tuckey.web.filters.urlrewrite
Class Condition

java.lang.Object
  extended by org.tuckey.web.filters.urlrewrite.TypeConverter
      extended by org.tuckey.web.filters.urlrewrite.Condition

public class Condition
extends TypeConverter

Conditions must be met when the filter is processing a url.

Version:
$Revision: 48 $ $Date: 2006-11-27 16:53:31 +1300 (Mon, 27 Nov 2006) $
Author:
Paul Tuckey

Field Summary
 
Fields inherited from class org.tuckey.web.filters.urlrewrite.TypeConverter
error, type, TYPE_ATTRIBUTE, TYPE_AUTH_TYPE, TYPE_CHARACTER_ENCODING, TYPE_CONTENT_LENGTH, TYPE_CONTENT_TYPE, TYPE_CONTEXT_PATH, TYPE_COOKIE, TYPE_EXCEPTION, TYPE_HEADER, TYPE_LOCAL_PORT, TYPE_METHOD, TYPE_PARAMETER, TYPE_PATH_INFO, TYPE_PATH_TRANSLATED, TYPE_PROTOCOL, TYPE_QUERY_STRING, TYPE_REMOTE_ADDR, TYPE_REMOTE_HOST, TYPE_REMOTE_USER, TYPE_REQUEST_URI, TYPE_REQUEST_URL, TYPE_REQUESTED_SESSION_ID, TYPE_SCHEME, TYPE_SERVER_NAME, TYPE_SERVER_PORT, TYPE_SESSION_ATTRIBUTE, TYPE_SESSION_IS_NEW, TYPE_TIME, TYPE_TIME_AMPM, TYPE_TIME_DAY_OF_MONTH, TYPE_TIME_DAY_OF_WEEK, TYPE_TIME_HOUR_OF_DAY, TYPE_TIME_MILLISECOND, TYPE_TIME_MINUTE, TYPE_TIME_MONTH, TYPE_TIME_SECOND, TYPE_TIME_YEAR, TYPE_USER_IN_ROLE
 
Constructor Summary
Condition()
           
 
Method Summary
 ConditionMatch getConditionMatch(javax.servlet.http.HttpServletRequest hsRequest)
          Will check and see if the condition matches the request.
 java.lang.String getDisplayName()
           
 int getId()
           
 java.lang.String getName()
          Will get the name.
 java.lang.String getNext()
          Will return "add" or "or".
 java.lang.String getOperator()
          Will get the operator type.
 java.lang.String getValue()
          Will get the value.
 boolean initialise()
          Returns false on failure.
 boolean isCaseSensitive()
           
 boolean isProcessNextOr()
          True if process next is or.
 boolean matches(javax.servlet.http.HttpServletRequest hsRequest)
          Deprecated. use getConditionMatch(HttpServletRequest hsRequest)
 void setCaseSensitive(boolean caseSensitive)
           
protected  void setError(java.lang.String s)
           
 void setId(int id)
           
 void setName(java.lang.String name)
          Will set the name.
 void setNext(java.lang.String next)
          Will set next.
 void setOperator(java.lang.String operator)
          Will ste the operator.
 void setRule(RuleBase rule)
           
 void setValue(java.lang.String value)
          Will set the value.
 
Methods inherited from class org.tuckey.web.filters.urlrewrite.TypeConverter
getError, getType, getTypeShort, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Condition

public Condition()
Method Detail

matches

public boolean matches(javax.servlet.http.HttpServletRequest hsRequest)
Deprecated. use getConditionMatch(HttpServletRequest hsRequest)

Will check and see if the condition matches the request.

Parameters:
hsRequest -
Returns:
true on match

getConditionMatch

public ConditionMatch getConditionMatch(javax.servlet.http.HttpServletRequest hsRequest)
Will check and see if the condition matches the request.

Parameters:
hsRequest -
Returns:
true on match

initialise

public boolean initialise()
Returns false on failure. Use getError to get the description of the error.

Returns:
weather or not the condition was successful in initialisation.

setError

protected void setError(java.lang.String s)
Overrides:
setError in class TypeConverter

getOperator

public java.lang.String getOperator()
Will get the operator type.

Returns:
notequal, greater etc.

setOperator

public void setOperator(java.lang.String operator)
Will ste the operator.

Parameters:
operator - type

getName

public java.lang.String getName()
Will get the name.

Returns:
String

setName

public void setName(java.lang.String name)
Will set the name.

Parameters:
name - the name

getNext

public java.lang.String getNext()
Will return "add" or "or".

Returns:
"add" or "or"

setNext

public void setNext(java.lang.String next)
Will set next.

Parameters:
next - "or" or "and"

getValue

public java.lang.String getValue()
Will get the value.

Returns:
String

setValue

public void setValue(java.lang.String value)
Will set the value.

Parameters:
value - the value

isProcessNextOr

public boolean isProcessNextOr()
True if process next is or.

Returns:
boolean

setId

public void setId(int id)

getId

public int getId()

isCaseSensitive

public boolean isCaseSensitive()

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

getDisplayName

public java.lang.String getDisplayName()

setRule

public void setRule(RuleBase rule)