com.caucho.server.rewrite
Class MatchRule

java.lang.Object
  extended by com.caucho.server.rewrite.AbstractRule
      extended by com.caucho.server.rewrite.AbstractRuleWithConditions
          extended by com.caucho.server.rewrite.MatchRule
All Implemented Interfaces:
FilterChainMapper, Rule, AlarmListener, java.util.EventListener

public class MatchRule
extends AbstractRuleWithConditions
implements AlarmListener


Nested Class Summary
 
Nested classes/interfaces inherited from class com.caucho.server.rewrite.AbstractRule
AbstractRule.RewriteRuleAdmin
 
Constructor Summary
protected MatchRule(RewriteDispatch rewriteDispatch)
           
 
Method Summary
 void addDependency(PersistentDependency depend)
           
 void addDispatch(DispatchRule dispatch)
           
 void addForbidden(ErrorRule forbidden)
           
 void addForward(ForwardRule forward)
           
 void addGone(ErrorRule gone)
           
 void addImport(ImportRule importRule)
           
 void addLoadBalance(LoadBalanceRule loadBalance)
           
 void addMatch(MatchRule match)
           
 void addMovedPermanently(MovedRule moved)
           
 void addNotFound(ErrorRule notFound)
           
 void addProxy(ProxyRule proxy)
           
 void addRedirect(RedirectRule redirect)
           
 void addRewrite(RewriteRule rewrite)
           
 void addSet(SetRule set)
           
 DispatchRule createDispatch()
          Adds a dispatch.
 ErrorRule createForbidden()
          Adds a forbidden.
 ForwardRule createForward()
          Adds a forward.
 ErrorRule createGone()
          Adds a gone.
 ImportRule createImport()
           
 LoadBalanceRule createLoadBalance()
          Adds a load-balance
 MatchRule createMatch()
           
 MovedRule createMovedPermanently()
          Adds a moved permanently (301)
 ErrorRule createNotFound()
          Adds a not-found.
 ProxyRule createProxy()
          Adds a proxy
 RedirectRule createRedirect()
          Adds a redirect.
 RewriteRule createRewrite()
          Adds a rewrite
 SetRule createSet()
          Adds a set
 void destroy()
           
 FilterChain dispatch(java.lang.String uri, java.lang.String queryString, FilterChain accept, FilterChainMapper next)
          Returns the FilterChain to invoke if the rule is successful, null indicates that the rule does not invoke a FilterChain.
 java.lang.String getTagName()
           
 void handleAlarm(Alarm alarm)
          Handles a callback from an alarm.
 void init()
           
 boolean isModified()
           
 void register()
           
 java.lang.String rewriteUri(java.lang.String uri, java.lang.String queryString)
           
 void setPassFilterChainMapper(FilterChainMapper nextFilterChainMapper)
           
 void unregister()
           
 
Methods inherited from class com.caucho.server.rewrite.AbstractRuleWithConditions
addAnd, addNot, addOr, addUnless, addWhen, getFullUrlRegexp, getRegexp, map, mapImpl, required, rewrite, setFullUrlRegexp, setRegexp
 
Methods inherited from class com.caucho.server.rewrite.AbstractRule
clearCache, createAdmin, getFailFilterChainMapper, getLogPrefix, getName, getPassFilterChainMapper, getRewriteDispatch, isEnabled, setDisableAt, setEnableAt, setEnabled, setFailFilterChainMapper, setLogPrefix, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchRule

protected MatchRule(RewriteDispatch rewriteDispatch)
Method Detail

getTagName

public java.lang.String getTagName()
Specified by:
getTagName in interface Rule

isModified

public boolean isModified()

addDependency

public void addDependency(PersistentDependency depend)

setPassFilterChainMapper

public void setPassFilterChainMapper(FilterChainMapper nextFilterChainMapper)
Specified by:
setPassFilterChainMapper in interface Rule
Overrides:
setPassFilterChainMapper in class AbstractRule

createDispatch

public DispatchRule createDispatch()
Adds a dispatch.


addDispatch

public void addDispatch(DispatchRule dispatch)

createForbidden

public ErrorRule createForbidden()
Adds a forbidden.


addForbidden

public void addForbidden(ErrorRule forbidden)

createForward

public ForwardRule createForward()
Adds a forward.


addForward

public void addForward(ForwardRule forward)

createGone

public ErrorRule createGone()
Adds a gone.


addGone

public void addGone(ErrorRule gone)

createImport

public ImportRule createImport()

addImport

public void addImport(ImportRule importRule)

createLoadBalance

public LoadBalanceRule createLoadBalance()
Adds a load-balance


addLoadBalance

public void addLoadBalance(LoadBalanceRule loadBalance)

createProxy

public ProxyRule createProxy()
Adds a proxy


addProxy

public void addProxy(ProxyRule proxy)

createMatch

public MatchRule createMatch()

addMatch

public void addMatch(MatchRule match)

createMovedPermanently

public MovedRule createMovedPermanently()
Adds a moved permanently (301)


addMovedPermanently

public void addMovedPermanently(MovedRule moved)

createNotFound

public ErrorRule createNotFound()
Adds a not-found.


addNotFound

public void addNotFound(ErrorRule notFound)

createRedirect

public RedirectRule createRedirect()
Adds a redirect.


addRedirect

public void addRedirect(RedirectRule redirect)

createRewrite

public RewriteRule createRewrite()
Adds a rewrite


addRewrite

public void addRewrite(RewriteRule rewrite)

createSet

public SetRule createSet()
Adds a set


addSet

public void addSet(SetRule set)

init

@PostConstruct
public void init()
Overrides:
init in class AbstractRuleWithConditions

rewriteUri

public java.lang.String rewriteUri(java.lang.String uri,
                                   java.lang.String queryString)

dispatch

public FilterChain dispatch(java.lang.String uri,
                            java.lang.String queryString,
                            FilterChain accept,
                            FilterChainMapper next)
                     throws ServletException
Description copied from class: AbstractRuleWithConditions
Returns the FilterChain to invoke if the rule is successful, null indicates that the rule does not invoke a FilterChain.

Specified by:
dispatch in class AbstractRuleWithConditions
Parameters:
uri - the target uri, possibly rewritten
accept - a FilterChain that stops evaluation of rewrite rules and
Throws:
ServletException

register

public void register()
Specified by:
register in interface Rule
Overrides:
register in class AbstractRule

unregister

public void unregister()
Specified by:
unregister in interface Rule
Overrides:
unregister in class AbstractRule

handleAlarm

public void handleAlarm(Alarm alarm)
Description copied from interface: AlarmListener
Handles a callback from an alarm.

Specified by:
handleAlarm in interface AlarmListener

destroy

public void destroy()
Specified by:
destroy in interface Rule
Overrides:
destroy in class AbstractRuleWithConditions