rewrite-config-servlet 2.0.0.Alpha6

org.ocpsoft.rewrite.servlet.config
Class Hostname

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultConditionBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpCondition
          extended by org.ocpsoft.rewrite.servlet.config.Hostname
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized

public class Hostname
extends HttpCondition
implements Parameterized

A Condition that inspects the value of ServletRequest.getServerName()

Author:
Lincoln Baxter, III

Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
 ParameterizedPatternParser getDomainExpression()
           
 ParameterizedPatternParser getExpression()
          Get the underlying RegexParameterizedPatternBuilder for this Hostname
 Set<String> getRequiredParameterNames()
           
static Hostname matches(String pattern)
          Inspect the current request domain, comparing against the given pattern.
 void setParameterStore(ParameterStore store)
           
 String toString()
           
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpCondition
evaluate
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultConditionBuilder
and, andNot, create, or, orNot, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

matches

public static Hostname matches(String pattern)
Inspect the current request domain, comparing against the given pattern.

The given pattern may be parameterized using the following format:

example.com {domain}.com
www.{domain}.{suffix}
... and so on

By default, matching parameter values are bound to the EvaluationContext. See also #where(String)


evaluateHttp

public boolean evaluateHttp(HttpServletRewrite event,
                            EvaluationContext context)
Specified by:
evaluateHttp in class HttpCondition

getExpression

public ParameterizedPatternParser getExpression()
Get the underlying RegexParameterizedPatternBuilder for this Hostname

See also: #where(String)


toString

public String toString()
Overrides:
toString in class Object

getDomainExpression

public ParameterizedPatternParser getDomainExpression()

getRequiredParameterNames

public Set<String> getRequiredParameterNames()
Specified by:
getRequiredParameterNames in interface Parameterized

setParameterStore

public void setParameterStore(ParameterStore store)
Specified by:
setParameterStore in interface Parameterized

rewrite-config-servlet 2.0.0.Alpha6

Copyright © 2013 OCPsoft. All Rights Reserved.