com.googlecode.webutilities.filters
Class ModulesFilter.RuleMapping

java.lang.Object
  extended by com.googlecode.webutilities.filters.ModulesFilter.RuleMapping
All Implemented Interfaces:
IgnoreAcceptContext
Enclosing class:
ModulesFilter

public static class ModulesFilter.RuleMapping
extends Object
implements IgnoreAcceptContext

Class that maps the rules based on URL pattern, mime type pattern or user agent string pattern.


Method Summary
 void addModule(String name, IModule module)
           
 Collection<IModule> getAllModules()
           
 IModule getModule(String name)
           
 boolean isMIMEAccepted(String mimeType)
           
 boolean isURLAccepted(String url)
           
 boolean isUserAgentAccepted(String userAgent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isURLAccepted

public boolean isURLAccepted(String url)
Specified by:
isURLAccepted in interface IgnoreAcceptContext
Parameters:
url - - request URL string without query parameters
Returns:
isAccepted - true if given URL has to be processed

isMIMEAccepted

public boolean isMIMEAccepted(String mimeType)
Specified by:
isMIMEAccepted in interface IgnoreAcceptContext
Parameters:
mimeType - - contentType of the chained response
Returns:
isAccepted - true if it is to be processed by this filter

isUserAgentAccepted

public boolean isUserAgentAccepted(String userAgent)
Specified by:
isUserAgentAccepted in interface IgnoreAcceptContext
Parameters:
userAgent - - requesting user agent string
Returns:
isAccepted - true if request by given user agent has to be processed/filtered.

getModule

public IModule getModule(String name)

addModule

public void addModule(String name,
                      IModule module)

getAllModules

public Collection<IModule> getAllModules()


Copyright © 2011. All Rights Reserved.