rewrite-config-servlet 2.0.0.Alpha6

org.ocpsoft.rewrite.servlet.config
Class Header

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.Header
All Implemented Interfaces:
Condition, ConditionBuilder, ConfigurationElement, Parameterized

public class Header
extends HttpCondition
implements Parameterized

Responsible for asserting on HttpServletRequest.getHeader(String) values.

Author:
Lincoln Baxter, III

Method Summary
 boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
           
static Header exists(String name)
          Return a Header condition that matches only against the existence of a header with a name matching the given pattern.
 Set<String> getRequiredParameterNames()
           
static Header matches(String name, String value)
          Return a Header condition that matches against both header name and values.
 void setParameterStore(ParameterStore store)
           
static Header valueExists(String value)
          Return a Header condition that matches only against the existence of a header with value matching the given pattern.
 
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, toString, wait, wait, wait
 

Method Detail

matches

public static Header matches(String name,
                             String value)
Return a Header condition that matches against both header name and values.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name
value - Regular expression matching the header value

exists

public static Header exists(String name)
Return a Header condition that matches only against the existence of a header with a name matching the given pattern. The header value is ignored.

See also: HttpServletRequest.getHeader(String)

Parameters:
name - Regular expression matching the header name

valueExists

public static Header valueExists(String value)
Return a Header condition that matches only against the existence of a header with value matching the given pattern. The header name is ignored.

Parameters:
value - Regular expression matching the header value

evaluateHttp

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

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.