Package org.jppf.job
Class RegexJobSelector
java.lang.Object
org.jppf.job.RegexJobSelector
- All Implemented Interfaces:
Serializable,JobSelector
Performs a regular expression match on either a job name or a job metadata value specified by its key.
If the specified metadata key is
null, is not part of a job's metadata, or is not a string, then this selector's accepts() method will return false.- Since:
- 6.2
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from interface org.jppf.job.JobSelector
ALL_JOBS -
Constructor Summary
ConstructorsConstructorDescriptionRegexJobSelector(Object key, String regex) Initialize this selector with a job metadata key and a regular expression.RegexJobSelector(Object key, String regex, int flags) Initialize this selector with a job metadata key and a regular expression.RegexJobSelector(String regex) Initialize this selector with a regular expression to match against job names.RegexJobSelector(String regex, int flags) Initialize this selector with a regular expression to match against job names. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether the specified job is accepted by this selector.booleaninthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.job.JobSelector
and, negate, or, xor
-
Constructor Details
-
RegexJobSelector
Initialize this selector with a regular expression to match against job names.
This constructor is equivalent to callingnew RegexJobSelector(null, regex, 0).- Parameters:
regex- the regular expression to match against.
-
RegexJobSelector
Initialize this selector with a regular expression to match against job names.
This constructor is equivalent to callingnew RegexJobSelector(null, regex, flags).- Parameters:
regex- the regular expression to match against.flags- the regex flags, as defined inPattern.
-
RegexJobSelector
Initialize this selector with a job metadata key and a regular expression.
This constructor is equivalent to callingnew RegexJobSelector(key, regex, 0).- Parameters:
key- the metadata key of the value to compare with.regex- the regular expression to match against.
-
RegexJobSelector
public RegexJobSelector(Object key, String regex, int flags) throws IllegalArgumentException, PatternSyntaxException Initialize this selector with a job metadata key and a regular expression.
This constructor will compile the regex into aPatterninstance, and throw one of the declared exceptions if that fails.- Parameters:
key- the metadata key of the value to compare with.regex- the regular expression to match against.flags- the regex flags, as defined inPattern.- Throws:
IllegalArgumentException- if the flags contain undefined bits.PatternSyntaxException- if the regex syntax is invalid.
-
-
Method Details
-
accepts
Description copied from interface:JobSelectorDetermine whether the specified job is accepted by this selector.- Parameters:
job- the job to check.- Returns:
trueif the job is acepted,falseotherwise.
-
hashCode
public int hashCode() -
equals
-