edu.nrao.sss.model.user
Class UserFilter

java.lang.Object
  extended by edu.nrao.sss.model.user.UserFilter
All Implemented Interfaces:
Filter<User>

public class UserFilter
extends Object
implements Filter<User>

A filter that operates on parameters.

Revision Info:

$Revision: 230 $
$Date: 2007-01-02 14:37:07 -0700 (Tue, 02 Jan 2007) $
$Author: dharland $

Since:
2006-06-27
Author:
David M. Harland

Constructor Summary
UserFilter()
          Creates a new wide-open filter that allows all parameters to pass.
 
Method Summary
 boolean allows(User param)
          Returns true if this filter allows the given parameter to pass through it.
 boolean blocks(User user)
          Returns true if this filter blocks the given parameter.
 void clearAll()
          Sets this filter to a wide-open state.
 void clearLastNamePattern()
          Sets the band criterion to its wide-open state.
 void setLastNamePattern(String regex)
          Sets a regular expression for matching the bandss of parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserFilter

public UserFilter()
Creates a new wide-open filter that allows all parameters to pass.

Method Detail

allows

public boolean allows(User param)
Returns true if this filter allows the given parameter to pass through it. Null parameters are always blocked.

The logic for allowing or blocking a parameter is somewhat complex. See blocks(User) for details.

Specified by:
allows in interface Filter<User>
Parameters:
param - the parameter to be filtered.
Returns:
true if this filter allows param to pass through it.

blocks

public boolean blocks(User user)
Returns true if this filter blocks the given parameter. Null parameters are always blocked.

Specified by:
blocks in interface Filter<User>
Parameters:
user - the parameter to be filtered.
Returns:
true if this filter blocks user.

clearAll

public void clearAll()
Sets this filter to a wide-open state. After this call all filtering criteria will be in their wide-open states and this filter will allow all parameters to pass.


clearLastNamePattern

public void clearLastNamePattern()
Sets the band criterion to its wide-open state.

See Also:
setLastNamePattern(String)

setLastNamePattern

public void setLastNamePattern(String regex)
Sets a regular expression for matching the bandss of parameters. Only parameters whose bands are matched by regex are allowed to pass through this filter. If parameters should not be filtered based on their bands, call clearLastNamePattern().

Parameters:
regex - a regular expression for matching the bandss of parameters.


Copyright © 2009. All Rights Reserved.