com.senacor.zoning.config
Class URLMapping

java.lang.Object
  extended by com.senacor.zoning.config.URLMapping
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExcludeURLMapping, IncludeURLMapping

public abstract class URLMapping
extends java.lang.Object
implements java.io.Serializable

URLMappings are used for checking if a given request URL has to be converted into a Zoning URL directing the request to the container application or can used unchanged. This is an abstract template class used as base class for inclusive and exclusive URLMapping implementations.

Author:
Denis Pasek, Senacor Technologies AG
See Also:
Serialized Form

Constructor Summary
URLMapping()
          Creates a new instance.
URLMapping(java.lang.String pattern)
          Creates a new instance.
 
Method Summary
protected abstract  boolean encodeOnMatch()
          Method for checking if it's necessary to chnage the equest URL if this URLMapping matches, inclusive URLMappings will return true , exclusive false.
static boolean isEncodingNecessary(java.lang.String requestPath, java.util.List urlMappings)
          Method for checking the request path against the List od URLMappings.
 boolean isURLRewritingNecessary(java.lang.String requestPath)
          Checks if it's necessary to convert the given request URL into an interceptable request URL directing the request to the application container.
abstract  boolean mergeURLMappingResult(java.lang.String requestPath, boolean previousResult)
          Method to be implemented by subclass.
 void setURLPattern(java.lang.String pattern)
          Setter the URL pattern for this URLMapping complying to the mapping rules of the servlet specification.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLMapping

public URLMapping()
Creates a new instance.


URLMapping

public URLMapping(java.lang.String pattern)
Creates a new instance.

Parameters:
pattern - The URL pattern for this URLMapping.
Method Detail

isEncodingNecessary

public static final boolean isEncodingNecessary(java.lang.String requestPath,
                                                java.util.List urlMappings)
Method for checking the request path against the List od URLMappings. Returns true if the request path must be encoded.

Parameters:
requestPath - The current request path.
urlMappings - The URLMappings to check.
Returns:
true if the request path has to be encoded.

setURLPattern

public void setURLPattern(java.lang.String pattern)
Setter the URL pattern for this URLMapping complying to the mapping rules of the servlet specification.

Parameters:
pattern - The URL pattern for this URLMapping.

isURLRewritingNecessary

public boolean isURLRewritingNecessary(java.lang.String requestPath)
Checks if it's necessary to convert the given request URL into an interceptable request URL directing the request to the application container.

Parameters:
requestPath - The request URL to check.
Returns:
true if it's necessary to convert the URL.

mergeURLMappingResult

public abstract boolean mergeURLMappingResult(java.lang.String requestPath,
                                              boolean previousResult)
Method to be implemented by subclass. Used for merging the current result based of the previous checked URLMappings with the result of this URLMapping.

Parameters:
requestPath - The request URL.
previousResult - The result of the previous URLMappings.
Returns:
The logically merged result.

encodeOnMatch

protected abstract boolean encodeOnMatch()
Method for checking if it's necessary to chnage the equest URL if this URLMapping matches, inclusive URLMappings will return true , exclusive false.

Returns:
true if URL rewriting is necessary on a pattern match.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007 Senacor Technologies AG. All Rights Reserved.