org.acegisecurity.intercept.web
Class PathBasedFilterInvocationDefinitionMap

java.lang.Object
  extended by org.acegisecurity.intercept.web.AbstractFilterInvocationDefinitionSource
      extended by org.acegisecurity.intercept.web.PathBasedFilterInvocationDefinitionMap
All Implemented Interfaces:
ObjectDefinitionSource, FilterInvocationDefinition, FilterInvocationDefinitionMap, FilterInvocationDefinitionSource

public class PathBasedFilterInvocationDefinitionMap
extends AbstractFilterInvocationDefinitionSource
implements FilterInvocationDefinition

Maintains a List of ConfigAttributeDefinitions associated with different HTTP request URL Apache Ant path-based patterns.

Apache Ant path expressions are used to match a HTTP request URL against a ConfigAttributeDefinition.

The order of registering the Ant paths using the addSecureUrl(String,ConfigAttributeDefinition) is very important. The system will identify the first matching path for a given HTTP URL. It will not proceed to evaluate later paths if a match has already been found. Accordingly, the most specific paths should be registered first, with the most general paths registered last.

If no registered paths match the HTTP URL, null is returned.

Version:
$Id: PathBasedFilterInvocationDefinitionMap.java 1970 2007-08-28 16:53:05Z luke_t $
Author:
Ben Alex

Nested Class Summary
protected  class PathBasedFilterInvocationDefinitionMap.EntryHolder
           
 
Constructor Summary
PathBasedFilterInvocationDefinitionMap()
           
 
Method Summary
 void addSecureUrl(String antPath, ConfigAttributeDefinition attr)
           
 Iterator getConfigAttributeDefinitions()
          If available, all of the ConfigAttributeDefinitions defined by the implementing class.
 int getMapSize()
           
 boolean isConvertUrlToLowercaseBeforeComparison()
           
 ConfigAttributeDefinition lookupAttributes(String url)
          Performs the actual lookup of the relevant ConfigAttributeDefinition for the specified FilterInvocation.
 void setConvertUrlToLowercaseBeforeComparison(boolean convertUrlToLowercaseBeforeComparison)
           
 
Methods inherited from class org.acegisecurity.intercept.web.AbstractFilterInvocationDefinitionSource
getAttributes, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.acegisecurity.intercept.ObjectDefinitionSource
getAttributes, supports
 

Constructor Detail

PathBasedFilterInvocationDefinitionMap

public PathBasedFilterInvocationDefinitionMap()
Method Detail

addSecureUrl

public void addSecureUrl(String antPath,
                         ConfigAttributeDefinition attr)
Specified by:
addSecureUrl in interface FilterInvocationDefinitionMap

getConfigAttributeDefinitions

public Iterator getConfigAttributeDefinitions()
Description copied from interface: ObjectDefinitionSource
If available, all of the ConfigAttributeDefinitions defined by the implementing class.

This is used by the AbstractSecurityInterceptor to perform startup time validation of each ConfigAttribute configured against it.

Specified by:
getConfigAttributeDefinitions in interface ObjectDefinitionSource
Returns:
an iterator over all the ConfigAttributeDefinitions or null if unsupported

getMapSize

public int getMapSize()

isConvertUrlToLowercaseBeforeComparison

public boolean isConvertUrlToLowercaseBeforeComparison()
Specified by:
isConvertUrlToLowercaseBeforeComparison in interface FilterInvocationDefinitionMap

lookupAttributes

public ConfigAttributeDefinition lookupAttributes(String url)
Description copied from class: AbstractFilterInvocationDefinitionSource
Performs the actual lookup of the relevant ConfigAttributeDefinition for the specified FilterInvocation.

Provided so subclasses need only to provide one basic method to properly interface with the FilterInvocationDefinitionSource.

Public visiblity so that tablibs or other view helper classes can access the ConfigAttributeDefinition applying to a given URI pattern without needing to construct a mock FilterInvocation and retrieving the attibutes via the AbstractFilterInvocationDefinitionSource.getAttributes(Object) method.

Specified by:
lookupAttributes in class AbstractFilterInvocationDefinitionSource
Parameters:
url - the URI to retrieve configuration attributes for
Returns:
the ConfigAttributeDefinition that applies to the specified FilterInvocation

setConvertUrlToLowercaseBeforeComparison

public void setConvertUrlToLowercaseBeforeComparison(boolean convertUrlToLowercaseBeforeComparison)
Specified by:
setConvertUrlToLowercaseBeforeComparison in interface FilterInvocationDefinitionMap


Copyright © 2004-2012 Interface21, Inc. All Rights Reserved.