Version: 1.1.1

org.biomoby.registry.sync.filtering
Class ServiceFilter

java.lang.Object
  extended by org.biomoby.registry.sync.filtering.ServiceFilter

public class ServiceFilter
extends Object

Class which stores the filtering rules and checks whether a service matches with one of these rules. If so this service is then ignored in the further processing of the synchronisation process.

There are two different kind of rules. The ones marked with a + are called positive rule. The ones with a - are called negative rule. They are different in their behavior.
If one wants to ignore a service the rule has to be negative, so a negative rule ignores all services which match for the given rule.
A positive rule guarantees that only the services which match this rule are taken into account, all other services are ignored.

Rule examples:
  1. to ignore services from the authority mpiz-koeln.de:
    -mpiz-koeln.de
  2. to ignore services from the authority mpiz-koeln.de AND mips.gsf.de:
    -mpiz-koeln,mips.gsf
  3. only take the services from the authority mips.gsf.de into account:
    +mips.gsf.de
  4. take only services from the authority mips.gsf.de into account BUT non which service names contains FASTA:
    +mips.gsf.de
    -FASTA

The recognition of a rule is done via regular expressions, so to match a phrase, only parts of it are sufficienct enough. E.g. if you want to match mpiz-koeln.mpg.de you can use the whole phrase or just parts of it like mpiz mpiz-koeln mpg.de

The filter rules are case insensitive, so MIPS and mips are the same
The special regular expression patterns like .* are not needed and can fail the filtering !

Author:
groscurt

Method Summary
 void addFilterRule(FilterRuleKeys ruleKey, String rule)
          Adds a new filtering rule.
static ServiceFilter getServiceFilter()
          The class is implemented as a singleton so this method returns the only instance
 boolean isServiceFiltered(MobyService service)
          Returns whether a service was filtered and therefore is not processed any further in the update process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServiceFilter

public static ServiceFilter getServiceFilter()
The class is implemented as a singleton so this method returns the only instance

Returns:
the instance

addFilterRule

public void addFilterRule(FilterRuleKeys ruleKey,
                          String rule)
Adds a new filtering rule.

Parameters:
ruleKey - the key to which the rule belongs
rule - the pattern

isServiceFiltered

public boolean isServiceFiltered(MobyService service)
Returns whether a service was filtered and therefore is not processed any further in the update process.

Parameters:
service - the service to check
Returns:
whether a filtering rule was applied to the service

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010