rewrite-config-servlet 2.0.0.Beta3

org.ocpsoft.rewrite.servlet.config.rule
Class Join

java.lang.Object
  extended by org.ocpsoft.rewrite.servlet.config.rule.Join
All Implemented Interfaces:
Condition, Operation, Rule, Parameterized, JoinPath

public class Join
extends Object
implements Rule, JoinPath, Parameterized

Rule that creates a bi-directional rewrite rule between an externally facing Address and an internal server resource Address for the purposes of changing the Address with which the internal server resource is accessible.

Author:
Lincoln Baxter, III

Constructor Summary
protected Join(String pattern, boolean requestBinding)
           
 
Method Summary
 boolean evaluate(Rewrite event, EvaluationContext context)
           
static Join getCurrentJoin(HttpServletRequest request)
          Retrieve the Join that was invoked on the current HttpServletRequest; if no Join was invoked, return null.
 String getId()
           
 Set<String> getRequiredParameterNames()
           
static JoinPath path(String pattern)
          Create a Rule specifying the inbound request Address to which this Join will apply.
static JoinPath pathNonBinding(String pattern)
          Create a Rule specifying the inbound request Address to which this Join will apply.
 void perform(Rewrite event, EvaluationContext context)
           
 void setParameterStore(ParameterStore store)
           
 Join to(String resource)
          The internal server resource Address to be served when the specified path(String) is requested.
 String toString()
           
 Join withChaining()
          Enable the target of this Join, specified by to(String), to be intercepted by the path(String) of another Join instance.
 Join withInboundCorrection()
          Specifies that requests for the original internal resource path specified by to(String) will be redirected to the updated path specified by path(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Join

protected Join(String pattern,
               boolean requestBinding)
Method Detail

path

public static JoinPath path(String pattern)
Create a Rule specifying the inbound request Address to which this Join will apply. Any Parameter instances defined in the given pattern will be bound by default to the ServletRequest.getParameterMap() via the RequestParameterProvider SPI.

To disable RequestBinding parameter Binding, instead use pathNonBinding(String).

The given pattern may be parameterized:

/example/{param}
/example/{param1}/sub/{param2}
...

Parameters:
pattern - ParameterizedPattern matching the requested path.
See Also:
ConfigurationRuleParameterBuilder.where(String)

pathNonBinding

public static JoinPath pathNonBinding(String pattern)
Create a Rule specifying the inbound request Address to which this Join will apply. Any Parameter instances defined in the given pattern will NOT be bound by default to the ServletRequest.getParameterMap().

To enable RequestBinding parameter Binding, instead use path(String).

The given pattern may be parameterized:

/example/{param}
/example/{param1}/sub/{param2}
...

Parameters:
pattern - ParameterizedPattern matching the requested path.
See Also:
ConfigurationRuleParameterBuilder.where(String)

getCurrentJoin

public static Join getCurrentJoin(HttpServletRequest request)
Retrieve the Join that was invoked on the current HttpServletRequest; if no Join was invoked, return null.


to

public Join to(String resource)
Description copied from interface: JoinPath
The internal server resource Address to be served when the specified path(String) is requested.

The given resource path may be parameterized:

/example/{param}.html
/css/{value}.css
...

Specified by:
to in interface JoinPath
See Also:
ConfigurationRuleParameterBuilder#where(String)}

withInboundCorrection

public Join withInboundCorrection()
Specifies that requests for the original internal resource path specified by to(String) will be redirected to the updated path specified by path(String).


withChaining

public Join withChaining()
Enable the target of this Join, specified by to(String), to be intercepted by the path(String) of another Join instance. If not activated, subsequent matching Join instances will not be evaluated on the current InboundRewrite instance.


evaluate

public boolean evaluate(Rewrite event,
                        EvaluationContext context)
Specified by:
evaluate in interface Condition

perform

public void perform(Rewrite event,
                    EvaluationContext context)
Specified by:
perform in interface Operation

getId

public String getId()
Specified by:
getId in interface Rule

toString

public String toString()
Overrides:
toString in class Object

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.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.