be.unamur.inference.web
Class RegExpUserRequestFilter<T extends UserRequest>

java.lang.Object
  extended by be.unamur.inference.web.RegExpUserRequestFilter<T>
Type Parameters:
T - The UserRequest to filter.
All Implemented Interfaces:
UserRequestFilter<T>
Direct Known Subclasses:
RegExpApacheUserSessionFilter

public class RegExpUserRequestFilter<T extends UserRequest>
extends Object
implements UserRequestFilter<T>

This class is used to filter UserRequest based on their client, resource, request type and time values.

Author:
Xavier Devroey - xavier.devroey@unamur.be
See Also:
UserRequest

Constructor Summary
RegExpUserRequestFilter()
          Creates a new filter
 
Method Summary
 RegExpUserRequestFilter<T> after(Date time)
          Sets the minimal date to consider for the time field of the request.
 RegExpUserRequestFilter<T> before(Date time)
          Sets the maximal date to consider for the time field of the request.
 RegExpUserRequestFilter<T> clientMatches(String regExp)
          Sets the regular expression used to match the client field of the request.
 boolean filter(T request)
          Returns true if the given request has to be filtered.
 RegExpUserRequestFilter<T> requestTypeMatches(String regExp)
          Sets the regular expression used to match the request type field of the request.
 RegExpUserRequestFilter<T> resourceMatches(String regExp)
          Sets the regular expression used to match the resource field of the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExpUserRequestFilter

public RegExpUserRequestFilter()
Creates a new filter

Method Detail

clientMatches

public RegExpUserRequestFilter<T> clientMatches(String regExp)
                                                             throws PatternSyntaxException
Sets the regular expression used to match the client field of the request.

Parameters:
regExp - The regular expression applied to the client field.
Returns:
This object.
Throws:
PatternSyntaxException - If the regular expression can not be compiled.
See Also:
Pattern

resourceMatches

public RegExpUserRequestFilter<T> resourceMatches(String regExp)
                                                               throws PatternSyntaxException
Sets the regular expression used to match the resource field of the request.

Parameters:
regExp - The regular expression applied to the request field.
Returns:
This object.
Throws:
PatternSyntaxException - If the regular expression can not be compiled.
See Also:
Pattern

requestTypeMatches

public RegExpUserRequestFilter<T> requestTypeMatches(String regExp)
                                                                  throws PatternSyntaxException
Sets the regular expression used to match the request type field of the request.

Parameters:
regExp - The regular expression applied to the request type field.
Returns:
This object.
Throws:
PatternSyntaxException - If the regular expression can not be compiled.
See Also:
Pattern

after

public RegExpUserRequestFilter<T> after(Date time)
Sets the minimal date to consider for the time field of the request.

Parameters:
time - The minimal date.
Returns:
This object.

before

public RegExpUserRequestFilter<T> before(Date time)
Sets the maximal date to consider for the time field of the request.

Parameters:
time - The maximal date.
Returns:
This object.

filter

public boolean filter(T request)
Description copied from interface: UserRequestFilter
Returns true if the given request has to be filtered.

Specified by:
filter in interface UserRequestFilter<T extends UserRequest>
Parameters:
request - The request to consider.
Returns:
True if the given request has to be filtered.


Copyright © 2014 PReCISE, University of Namur. All rights reserved.