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 32667 2010-03-13 00:37:06Z gjoseph $
Author:
fgiust

Constructor Summary
UrlPatternDelegate()
           
 
Method Summary
 java.lang.Object getDelegate()
          Returns the delegate.
 java.lang.String getHost()
          The configured host
 java.lang.String getUrl()
          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()
The configured Url

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()
The configured host

Returns:
the configured host

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-2010 Magnolia International Ltd.. All Rights Reserved.