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 Summary
Constructors Constructor Description OutputManagerImpl(URL baseServerUrl)
Instantiate the output manager. -
Method Summary
Modifier and Type Method Description List<DataItem>
addOutputs(String projectId, int id, File baseDirectory, Collection<File> outputs)
Adds outputs to be hosted for a given id, returning a matching list of URLs on which the files are hosted.Response
getResultFile(int id, String filename, boolean download)
Gets a results file.Response
getResultFile(String projectId, int id, String filename, boolean download)
Gets a results file.Response
uploadResultsToHPCServer(String projectId, int id, String serverUrl, String storageId, String filePath, String userId, String token)
Upload a file to the HPC store.
-
Constructor Details
-
OutputManagerImpl
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 IOExceptionDescription 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 interfaceOutputManager
- Parameters:
projectId
- The id of the projectid
- The id of the jobbaseDirectory
- The root directory containing all the filesoutputs
- The files to add- Returns:
- A list of DataItem instances for adding to the job
- Throws:
IOException
- If anything goes wrong.
-
getResultFile
Description copied from interface:OutputManager
Gets a results file.- Specified by:
getResultFile
in interfaceOutputManager
- 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
Description copied from interface:OutputManager
Gets a results file.- Specified by:
getResultFile
in interfaceOutputManager
- 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 interfaceOutputManager
- Parameters:
projectId
- The project IDid
- The job IDserverUrl
- The HPC storage servicestorageId
- The ID for the storage on the HPC servicefilePath
- The path within the storageuserId
- The HPC user IDtoken
- The auth token- Returns:
- Description of whether the upload was successful.
-