Package org.jppf.job

Class JobNameSelector

java.lang.Object
org.jppf.job.JobNameSelector
All Implemented Interfaces:
Serializable, JobSelector

public class JobNameSelector extends Object implements JobSelector
A job selector which accepts all jobs whose names are in the set specified in one of its constructors.
Since:
6.2
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • JobNameSelector

      public JobNameSelector(Collection<String> names)
      Initiialize this selector with the specified collection of accepted job uuids.
      Parameters:
      names - a collection of job names.
    • JobNameSelector

      public JobNameSelector(String... names)
      Initiialize this selector with the specified array of accepted job uuids.
      Parameters:
      names - an array of job names.
  • Method Details

    • accepts

      public boolean accepts(JPPFDistributedJob job)
      Description copied from interface: JobSelector
      Determine whether the specified job is accepted by this selector.
      Specified by:
      accepts in interface JobSelector
      Parameters:
      job - the job to check.
      Returns:
      true if the job is acepted, false otherwise.
    • getNames

      public Set<String> getNames()
      Get the set of job uuids accepted by this selector.
      Returns:
      a set of uuids, possibly empty.