info.magnolia.cms.util
Class UrlPatternDelegate

java.lang.Object
  extended by info.magnolia.cms.util.UrlPatternDelegate
All Implemented Interfaces:
PatternDelegate

public class UrlPatternDelegate
extends java.lang.Object
implements PatternDelegate

An implementation of PatternDelegate that evaluates as condition a request uri patter or a hostname pattern.

Version:
$Id: UrlPatternDelegate.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
fgiust

Constructor Summary
UrlPatternDelegate()
           
 
Method Summary
 java.lang.Object getDelegate()
          Returns the delegate.
 java.lang.String getHost()
           
 java.lang.String getUrl()
          Returns the configured Url.
 boolean match(javax.servlet.http.HttpServletRequest request)
          Compares the reques with the url and host patterns.
 void setDelegate(java.lang.Object delegate)
          Sets the delegate.
 void setHost(java.lang.String host)
          Sets the host pattern (using SimpleUrlPattern internally).
 void setUrl(java.lang.String pattern)
          Sets the Url pattern (using SimpleUrlPattern internally).
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlPatternDelegate

public UrlPatternDelegate()
Method Detail

getUrl

public java.lang.String getUrl()
Returns the configured Url.


setUrl

public void setUrl(java.lang.String pattern)
Sets the Url pattern (using SimpleUrlPattern internally).

Parameters:
pattern - url pattern

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)
Sets the host pattern (using SimpleUrlPattern internally).

Parameters:
host - host pattern

match

public boolean match(javax.servlet.http.HttpServletRequest request)
Compares the reques with the url and host patterns.

Specified by:
match in interface PatternDelegate
Parameters:
request - HttpServletRequest
Returns:
true if the pattern matches the configured host (if set) and url (if set)

setDelegate

public void setDelegate(java.lang.Object delegate)
Sets the delegate.

Parameters:
delegate - the delegate to set

getDelegate

public java.lang.Object getDelegate()
Returns the delegate.

Specified by:
getDelegate in interface PatternDelegate
Returns:
the delegate

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.