Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
blast_service_job.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 /*
22  * blast_service_job.h
23  *
24  * Created on: 21 Jan 2016
25  * Author: tyrrells
26  */
27 
28 #ifndef BLAST_SERVICE_JOB_H_
29 #define BLAST_SERVICE_JOB_H_
30 
31 
32 #include "blast_service.h"
33 #include "blast_service_api.h"
34 #include "service.h"
35 #include "service_job.h"
36 
37 class BlastTool;
38 
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 
42 #ifdef ALLOCATE_BLAST_SERVICE_JOB_TAGS
43  #define BLAST_SERVICE_JOB_PREFIX BLAST_SERVICE_API
44  #define BLAST_SERVICE_JOB_VAL(x) = x
45 #else
46  #define BLAST_SERVICE_JOB_PREFIX extern
47  #define BLAST_SERVICE_JOB_VAL(x)
48 #endif
49 
50 #endif
51 
57 BLAST_SERVICE_JOB_PREFIX const char *BSJ_TYPE_S BLAST_SERVICE_JOB_VAL ("blast_service_job");
58 
59 
67 {
70 
73 
75 
76 
78 BLAST_SERVICE_PREFIX const char *BSJ_LINKED_SERVICE_DATABASE_S BLAST_SERVICE_VAL ("database");
79 
80 
82 BLAST_SERVICE_PREFIX const char *BSJ_LINKED_SERVICE_SCAFFOLD_S BLAST_SERVICE_VAL ("scaffold");
83 
84 
85 
86 #ifdef __cplusplus
87 extern "C"
88 {
89 #endif
90 
91 
102 
103 
116 BLAST_SERVICE_LOCAL BlastServiceJob *AllocateBlastServiceJob (Service *service_p, const char *job_name_s, const char *job_description_s, const char *tool_name_s, BlastServiceData *data_p);
117 
118 
126 
127 
140 BLAST_SERVICE_LOCAL char *GetPreviousJobFilename (const BlastServiceData *data_p, const char *job_id_s, const char *suffix_s);
141 
142 
151 BLAST_SERVICE_LOCAL BlastServiceJob *GetBlastServiceJobFromJSON (const json_t *blast_job_json_p, BlastServiceData *config_p);
152 
153 
163 BLAST_SERVICE_LOCAL json_t *ConvertBlastServiceJobToJSON (BlastServiceJob *job_p, bool omit_results_flag);
164 
165 
176 
177 
187 
188 
201 
202 
211 
212 
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 
220 #endif /* BLAST_SERVICE_JOB_H_ */
BlastServiceJob::bsj_tool_p
BlastTool * bsj_tool_p
The BlastTool.
Definition: blast_service_job.h:72
BlastServiceJob
This datatype stores the ServiceJob and its associated BlastTool.
Definition: blast_service_job.h:66
BlastServiceJob::GetPreviousJobFilename
char * GetPreviousJobFilename(const BlastServiceData *data_p, const char *job_id_s, const char *suffix_s)
Get the filename with the data for a previously-ran BlastServiceJob.
BSJ_LINKED_SERVICE_SCAFFOLD_S
const char * BSJ_LINKED_SERVICE_SCAFFOLD_S
The name of the exposed scaffold output parameter for LinkedServices.
Definition: blast_service_job.h:82
BlastServiceJob::AllocateBlastServiceJob
BlastServiceJob * AllocateBlastServiceJob(Service *service_p, const char *job_name_s, const char *job_description_s, const char *tool_name_s, BlastServiceData *data_p)
Create a BlastServiceJob.
service.h
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
CloneBlastServiceJob
ServiceJob * CloneBlastServiceJob(const ServiceJob *src_p)
BlastServiceJob::bsj_job
ServiceJob bsj_job
The ServiceJob.
Definition: blast_service_job.h:69
BlastServiceData
The configuration data for the Blast Service.
Definition: blast_service.h:143
BlastServiceJob::ProcessLinkedServiceForBlastServiceJobOutput
bool ProcessLinkedServiceForBlastServiceJobOutput(Service *service_p, ServiceJob *job_p, LinkedService *linked_service_p)
Process a LinkedService for a given BlastServiceJob.
BlastServiceJob::AddErrorToBlastServiceJob
bool AddErrorToBlastServiceJob(BlastServiceJob *job_p)
Add the logged information from a failed BlastServiceJob to its list of stored errors.
BlastServiceJob::ConvertBlastServiceJobToJSON
json_t * ConvertBlastServiceJobToJSON(BlastServiceJob *job_p, bool omit_results_flag)
Serialise a BlastServiceJob into a JSON fragment.
BlastServiceJob::GetBlastServiceJobFromJSON
BlastServiceJob * GetBlastServiceJobFromJSON(const json_t *blast_job_json_p, BlastServiceData *config_p)
Deserialise a BlastServiceJob from a JSON fragment.
blast_service_api.h
BlastServiceJob::UpdateBlastServiceJob
bool UpdateBlastServiceJob(ServiceJob *job_p)
Update the running status of BlastServiceJob if needed.
BlastServiceJob::AllocateBlastServiceJobForDatabase
BlastServiceJob * AllocateBlastServiceJobForDatabase(Service *service_p, const DatabaseInfo *db_p, struct BlastServiceData *data_p)
Create a BlastServiceJob.
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
BLAST_SERVICE_LOCAL
#define BLAST_SERVICE_LOCAL
Definition: blast_service_api.h:48
BlastTool
The base class for running Blast.
Definition: blast_tool.hpp:43
LinkedService
This datatype stores the data needed to get the required information from the output of one Service t...
Definition: linked_service.h:50
BlastServiceJob::BSJ_TYPE_S
const char * BSJ_TYPE_S
The type for BlastServiceJobs.
Definition: blast_service_job.h:57
BlastServiceJob::BlastServiceJobCompleted
void BlastServiceJobCompleted(ServiceJob *job_p)
This is the callback function used by an AsyncTask that is called when a BlastServiceJob has complete...
service_job.h
DatabaseInfo
A datatype describing the details of each database available to search against.
Definition: blast_service.h:83
blast_service.h
BlastServiceJob::FreeBlastServiceJob
void FreeBlastServiceJob(ServiceJob *job_p)
Free the BlastServiceJob.
BSJ_LINKED_SERVICE_DATABASE_S
const char * BSJ_LINKED_SERVICE_DATABASE_S
The name of the exposed database output parameter for LinkedServices.
Definition: blast_service_job.h:78