Class NMPIQueueManagerCompat

java.lang.Object
uk.ac.manchester.spinnaker.nmpi.nmpi.NMPIQueueManagerCompat
All Implemented Interfaces:
NMPIQueueManager

public class NMPIQueueManagerCompat extends Object implements NMPIQueueManager
Manages the NMPI queue, receiving jobs and submitting them to be run.
  • Field Details

  • Constructor Details

    • NMPIQueueManagerCompat

      public NMPIQueueManagerCompat()
  • Method Details

    • getJobs

      public List<? extends Job> getJobs()
      Description copied from interface: NMPIQueueManager
      Get jobs that are marked as running or in progress in some form.
      Specified by:
      getJobs in interface NMPIQueueManager
      Returns:
      A list of jobs.
    • addListener

      public void addListener(NMPIQueueListener listener)
      Register a listener against the manager for new jobs.
      Specified by:
      addListener in interface NMPIQueueManager
      Parameters:
      listener - The listener to register
    • processResponsesFromQueue

      public void processResponsesFromQueue()
      Description copied from interface: NMPIQueueManager
      Process responses from the queue now.
      Specified by:
      processResponsesFromQueue in interface NMPIQueueManager
    • appendJobLog

      public void appendJobLog(int id, String logToAppend)
      Appends log messages to the log.
      Specified by:
      appendJobLog in interface NMPIQueueManager
      Parameters:
      id - The ID of the job
      logToAppend - The messages to append
    • setJobRunning

      public void setJobRunning(int id)
      Mark a job as running.
      Specified by:
      setJobRunning in interface NMPIQueueManager
      Parameters:
      id - The ID of the job.
    • setJobFinished

      public void setJobFinished(int id, String logToAppend, List<DataItem> outputs, ObjectNode provenance)
      Marks a job as finished successfully.
      Specified by:
      setJobFinished in interface NMPIQueueManager
      Parameters:
      id - The ID of the job
      logToAppend - Any additional log messages to append to the existing log (null if none)
      outputs - The outputs of the job (null if none)
      provenance - JSON provenance information
    • setJobError

      public void setJobError(int id, String logToAppend, List<DataItem> outputs, Throwable error, ObjectNode provenance)
      Marks a job as finished with an error.
      Specified by:
      setJobError in interface NMPIQueueManager
      Parameters:
      id - The ID of the job
      logToAppend - Any additional log messages to append to the existing log (null if none)
      outputs - Any outputs generated, or null if none
      error - The error details
      provenance - JSON provenance information
    • close

      public void close()
      Close the manager.
      Specified by:
      close in interface NMPIQueueManager