public class TaskStoreHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
EXECUTION_INFO_FILE_NAME |
static String |
EXECUTIONS_DIR_NAME |
static String |
IMPORT_PARAMETERS_FILE_NAME |
static String |
REPORTS_DIR_NAME |
static String |
SUBMISSION_INFO_FILE_NAME |
| Constructor and Description |
|---|
TaskStoreHelper(String root) |
| Modifier and Type | Method and Description |
|---|---|
org.gcube.dataanalysis.copernicus.cmems.importer.task.SubmissionInfo |
deserializeContext(String taskId)
Deserialize task submission context.
|
org.gcube.dataanalysis.copernicus.cmems.importer.task.Execution |
deserializeExecution(String taskId,
String executionId)
Deserialize an execution
|
org.gcube.dataanalysis.copernicus.cmems.importer.api.ImportOptions |
deserializeOptions(String taskId)
Deserialize task import parameters.
|
org.gcube.dataanalysis.copernicus.cmems.importer.task.ImportTask |
deserializeTask(String taskId)
Deserialize the task with the given id.
|
static File |
ensureDontExist(File f) |
File |
ensureExecutionInfo(String taskId,
String executionId) |
File |
ensureExecutionInfoMiss(String taskId,
String executionId) |
static File |
ensureExist(File f) |
File |
ensureReport(String taskId,
String executionId,
String reportName) |
File |
ensureReportMiss(String taskId,
String executionId,
String reportName) |
File |
ensureTask(String taskId) |
File |
ensureTaskMiss(String taskId) |
String[] |
getAllExecutionReports(String taskId,
String executionId)
Return all reports for a given execution.
|
String[] |
getAllExecutions(String taskId)
Return all ids of the executions for a task.
|
String[] |
getAllTasks() |
static String |
getContent(File f) |
File |
getExecutionInfoFile(String taskId,
String executionId)
Return the file containing execution info
|
File |
getExecutionReport(String taskId,
String executionId,
String reportName)
Return the root execution reports
|
File |
getExecutionReportsRoot(String taskId,
String executionId)
Return the root execution reports
|
File |
getExecutionRoot(String taskId,
String executionId)
Return the root of a given execution
|
File |
getExecutionsRoot(String taskId)
Return the root of task executions
|
String |
getLastExecution(String taskId)
Return the last execution of the task.
|
File |
getRoot()
Return the root of the task store.
|
File |
getTaskRoot(String taskId)
Return the root of the task.
|
static void |
serializeContext(File file,
org.gcube.dataanalysis.copernicus.cmems.importer.task.SubmissionInfo submissionInfo)
Serialize a submission context to the given file.
|
static void |
serializeExecution(File file,
org.gcube.dataanalysis.copernicus.cmems.importer.task.Execution execution)
Serialize execution info to the given file.
|
static void |
serializeImportParameters(File file,
org.gcube.dataanalysis.copernicus.cmems.importer.api.ImportOptions options)
Serialize import parameters to the given file.
|
static void |
serializeReport(File file,
org.gcube.dataanalysis.copernicus.cmems.importer.task.ExecutionReport report)
Serialize the report to the given file
|
static void |
serializeTask(File taskDir,
org.gcube.dataanalysis.copernicus.cmems.importer.task.ImportTask task)
Serialize a task to the given file.
|
static void |
writeContent(File f,
String content) |
public static final String IMPORT_PARAMETERS_FILE_NAME
public static final String SUBMISSION_INFO_FILE_NAME
public static final String EXECUTIONS_DIR_NAME
public static final String EXECUTION_INFO_FILE_NAME
public static final String REPORTS_DIR_NAME
public TaskStoreHelper(String root)
public File getRoot()
public String[] getAllTasks()
public File getTaskRoot(String taskId)
taskId - public File getExecutionsRoot(String taskId)
taskId - public String[] getAllExecutions(String taskId)
taskId - public String getLastExecution(String taskId)
public File getExecutionRoot(String taskId, String executionId)
taskId - public File getExecutionInfoFile(String taskId, String executionId)
taskId - public File getExecutionReportsRoot(String taskId, String executionId)
taskId - public String[] getAllExecutionReports(String taskId, String executionId)
taskId - public File getExecutionReport(String taskId, String executionId, String reportName)
taskId - public org.gcube.dataanalysis.copernicus.cmems.importer.task.ImportTask deserializeTask(String taskId) throws JAXBException, NotThereException, IOException, ParseException
taskId - IOExceptionJAXBExceptionNotThereExceptionParseExceptionpublic org.gcube.dataanalysis.copernicus.cmems.importer.api.ImportOptions deserializeOptions(String taskId) throws JAXBException, NotThereException, IOException, ParseException
taskId - IOExceptionExceptionJAXBExceptionNotThereExceptionParseExceptionpublic org.gcube.dataanalysis.copernicus.cmems.importer.task.SubmissionInfo deserializeContext(String taskId) throws NotThereException, IOException, ParseException, JAXBException
taskId - ExceptionNotThereExceptionIOExceptionParseExceptionJAXBExceptionpublic org.gcube.dataanalysis.copernicus.cmems.importer.task.Execution deserializeExecution(String taskId, String executionId) throws NotThereException, FileNotFoundException, ParseException, IOException, JAXBException
taskId - executionId - ExceptionNotThereExceptionFileNotFoundExceptionParseExceptionIOExceptionJAXBExceptionpublic static void serializeTask(File taskDir, org.gcube.dataanalysis.copernicus.cmems.importer.task.ImportTask task) throws IOException, JAXBException
taskDir - task - IOExceptionJAXBExceptionpublic static void serializeContext(File file, org.gcube.dataanalysis.copernicus.cmems.importer.task.SubmissionInfo submissionInfo) throws IOException, JAXBException
file - submissionInfo - IOExceptionJAXBExceptionpublic static void serializeImportParameters(File file, org.gcube.dataanalysis.copernicus.cmems.importer.api.ImportOptions options) throws IOException, JAXBException
file - options - IOExceptionJAXBExceptionpublic static void serializeExecution(File file, org.gcube.dataanalysis.copernicus.cmems.importer.task.Execution execution) throws IOException, JAXBException
file - execution - IOExceptionJAXBExceptionpublic static void serializeReport(File file, org.gcube.dataanalysis.copernicus.cmems.importer.task.ExecutionReport report) throws IOException
file - report - ExceptionIOExceptionpublic static String getContent(File f) throws IOException
IOExceptionpublic static void writeContent(File f, String content) throws IOException
IOExceptionpublic File ensureTask(String taskId) throws FileNotFoundException
FileNotFoundExceptionpublic File ensureTaskMiss(String taskId) throws java.nio.file.FileAlreadyExistsException
public File ensureExecutionInfo(String taskId, String executionId) throws FileNotFoundException
FileNotFoundExceptionpublic File ensureExecutionInfoMiss(String taskId, String executionId) throws FileNotFoundException, java.nio.file.FileAlreadyExistsException
public File ensureReport(String taskId, String executionId, String reportName) throws FileNotFoundException
FileNotFoundExceptionpublic File ensureReportMiss(String taskId, String executionId, String reportName) throws FileNotFoundException, java.nio.file.FileAlreadyExistsException
public static File ensureExist(File f) throws FileNotFoundException
FileNotFoundExceptionpublic static File ensureDontExist(File f) throws java.nio.file.FileAlreadyExistsException
Copyright © 2018. All Rights Reserved.