Class JPPFDriverJobPersistence

java.lang.Object
org.jppf.client.JPPFDriverJobPersistence

public class JPPFDriverJobPersistence extends Object
Instances of this class allow monitoring and managing, on the client side, the jobs persisted in a remote driver. In particular, it allows to retrieve jobs from the driver's persistence store and either process their results if they have completed, or resubmit them vith a JPPFClient.

The communication with the driver is performed via JMX, thus a working JMX connection to the driver must be provided in the constructor.

Since:
6.0
Author:
Laurent Cohen
  • Constructor Summary

    Constructors
    Constructor
    Description
    JPPFDriverJobPersistence(org.jppf.management.JMXDriverConnectionWrapper jmx)
    Initialize this persisted job manager with the specified driver JMX connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Delete the persisted job with the specified uuid.
    deleteJobs(org.jppf.job.JobSelector selector)
    Delete the persisted jobs that match the provided job selector.
    org.jppf.node.protocol.JPPFDistributedJob
    Get the description of the job with the specified uuid.
    boolean
    Determines whether the job has completed and all execution results are available.
    listJobs(org.jppf.job.JobSelector selector)
    List the persisted jobs that match the provided job selector.
    Retieve and rebuild the persisted job with the specified uuid.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JPPFDriverJobPersistence

      public JPPFDriverJobPersistence(org.jppf.management.JMXDriverConnectionWrapper jmx)
      Initialize this persisted job manager with the specified driver JMX connection.
      Parameters:
      jmx - a JMX connection wrapper to a JPPF driver.
      Throws:
      IllegalStateException - if the connection to the driver isn't working for any reason. The actual exception is set as root cause.
  • Method Details

    • listJobs

      public List<String> listJobs(org.jppf.job.JobSelector selector) throws Exception
      List the persisted jobs that match the provided job selector.
      Parameters:
      selector - the selector used to filter persisted jobs, a null selector is equivalent to JobSelector.ALL_JOBS.
      Returns:
      a list of the uuids of the matching jobs, possibly empty if no job was found.
      Throws:
      Exception - if any error occurs while communicating with the driver.
    • deleteJob

      public boolean deleteJob(String uuid) throws Exception
      Delete the persisted job with the specified uuid. This method is equivalent to calling deleteJobs(new JobUuidSelector(uuid)).
      Parameters:
      uuid - the UUID of the job to delete.
      Returns:
      true if the job was successfully deleted, false.otherwise.
      Throws:
      Exception - if any error occurs while communicating with the driver.
    • deleteJobs

      public List<String> deleteJobs(org.jppf.job.JobSelector selector) throws Exception
      Delete the persisted jobs that match the provided job selector.
      Parameters:
      selector - the selector used to filter persisted jobs, a null selector is equivalent to JobSelector.ALL_JOBS.
      Returns:
      a list of the uuids of the matching jobs that were actually deleted, possibly empty if no job was found.
      Throws:
      Exception - if any error occurs while communicating with the driver.
    • retrieveJob

      public JPPFJob retrieveJob(String uuid) throws Exception
      Retieve and rebuild the persisted job with the specified uuid.
      Parameters:
      uuid - the UUID of the job to delete.
      Returns:
      a JPPFJob instance, or null if the job could not be found.
      Throws:
      Exception - if any error occurs while communicating with the driver.
    • getJobDescription

      public org.jppf.node.protocol.JPPFDistributedJob getJobDescription(String uuid) throws Exception
      Get the description of the job with the specified uuid. This method retrieves the job's uuid, name, number of tasks, SLA and metadata.
      Parameters:
      uuid - the uuid of the job to retrieve.
      Returns:
      the job descirption as a JPPFDistributedJob instance.
      Throws:
      Exception - if any error occurs while communicating with the driver.
    • isJobComplete

      public boolean isJobComplete(String uuid) throws Exception
      Determines whether the job has completed and all execution results are available.
      Parameters:
      uuid - the UUID of the jonb to check.
      Returns:
      true if the job has completed, false otherwise.
      Throws:
      Exception - if any error occurs while communicating with the driver.