Class OutputManagerImpl

java.lang.Object
uk.ac.manchester.spinnaker.nmpi.jobmanager.OutputManagerImpl
All Implemented Interfaces:
OutputManager

public class OutputManagerImpl
extends Object
implements OutputManager
Service for managing Job output files.
  • Constructor Details

    • OutputManagerImpl

      public OutputManagerImpl​(URL baseServerUrl)
      Instantiate the output manager.
      Parameters:
      baseServerUrl - The base URL of the overall service, used when generating internal URLs.
  • Method Details

    • addOutputs

      public List<DataItem> addOutputs​(String projectId, int id, File baseDirectory, Collection<File> outputs) throws IOException
      Description copied from interface: OutputManager
      Adds outputs to be hosted for a given id, returning a matching list of URLs on which the files are hosted.
      Specified by:
      addOutputs in interface OutputManager
      Parameters:
      projectId - The id of the project
      id - The id of the job
      baseDirectory - The root directory containing all the files
      outputs - The files to add
      Returns:
      A list of DataItem instances for adding to the job
      Throws:
      IOException - If anything goes wrong.
    • getResultFile

      public Response getResultFile​(String projectId, int id, String filename, boolean download)
      Description copied from interface: OutputManager
      Gets a results file.
      Specified by:
      getResultFile in interface OutputManager
      Parameters:
      projectId - The id of the project which owns the file.
      id - The id of the job which produced the file.
      filename - The name of the file.
      download - Whether to mark the retrieval as a download to the browser.
      Returns:
      A response containing the file, or a "NOT FOUND" response if the file does not exist.
    • getResultFile

      public Response getResultFile​(int id, String filename, boolean download)
      Description copied from interface: OutputManager
      Gets a results file.
      Specified by:
      getResultFile in interface OutputManager
      Parameters:
      id - The id of the job which produced the file.
      filename - The name of the file.
      download - Whether to mark the retrieval as a download to the browser.
      Returns:
      A response containing the file, or a "NOT FOUND" response if the file does not exist.
    • uploadResultsToHPCServer

      public Response uploadResultsToHPCServer​(String projectId, int id, String serverUrl, String storageId, String filePath, String userId, String token)
      Description copied from interface: OutputManager
      Upload a file to the HPC store.
      Specified by:
      uploadResultsToHPCServer in interface OutputManager
      Parameters:
      projectId - The project ID
      id - The job ID
      serverUrl - The HPC storage service
      storageId - The ID for the storage on the HPC service
      filePath - The path within the storage
      userId - The HPC user ID
      token - The auth token
      Returns:
      Description of whether the upload was successful.