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.
|
A datatype to represent a running task. More...
#include <service_job.h>
Public Member Functions | |
void | FreeServiceJob (ServiceJob *job_p) |
Free a ServiceJob. More... | |
void | FreeBaseServiceJob (ServiceJob *job_p) |
Free a ServiceJob ignoring if it is a subclass. More... | |
ServiceJob * | AllocateServiceJob (struct Service *service_p, const char *job_name_s, const char *job_description_s, bool(*update_fn)(struct ServiceJob *job_p), bool(*calculate_results_fn)(struct ServiceJob *job_p), void(*free_job_fn)(struct ServiceJob *job_p), const char *job_type_s) |
Allocate a ServiceJob. More... | |
ServiceJob * | CreateAndAddServiceJobToService (struct Service *service_p, const char *job_name_s, const char *job_description_s, bool(*update_fn)(struct ServiceJob *job_p), bool(*calculate_results_fn)(struct ServiceJob *job_p), void(*free_job_fn)(struct ServiceJob *job_p)) |
Allocate a ServiceJob and add it to a ServiceJobSet. More... | |
bool | InitServiceJob (ServiceJob *job_p, struct Service *service_p, const char *job_name_s, const char *job_description_s, bool(*update_fn)(struct ServiceJob *job_p), bool(*calculate_results_fn)(struct ServiceJob *job_p), void(*free_job_fn)(struct ServiceJob *job_p), uuid_t *id_p, const char *job_type_s) |
Initialise a ServiceJob. More... | |
void | ClearServiceJob (ServiceJob *job_p) |
Clear a Service Job ready for reuse. More... | |
ServiceJob * | CloneServiceJob (const ServiceJob *src_p) |
Create a deep copy of a ServiceJob. More... | |
bool | CopyServiceJob (const ServiceJob *src_p, ServiceJob *dest_p) |
Make a deep copy of one ServiceJob to another. More... | |
struct Service * | GetServiceFromServiceJob (ServiceJob *job_p) |
Get the owning Service for a given ServiceJob. More... | |
bool | SetServiceJobDescription (ServiceJob *job_p, const char *const description_s) |
Set the description of ServiceJob. More... | |
bool | SetServiceJobURL (ServiceJob *job_p, const char *const url_s) |
Set the description of ServiceJob. More... | |
bool | SetServiceJobName (ServiceJob *job_p, const char *const name_s) |
Set the name of ServiceJob. More... | |
json_t * | GetServiceJobAsJSON (ServiceJob *const job_p, bool omit_results_flag) |
Get a ServiceJob as JSON. More... | |
json_t * | GetServiceJobStatusAsJSON (ServiceJob *job_p, bool omit_results_flag) |
Get the Current OperationStatus of a ServiceJob as JSON. More... | |
ServiceJob * | CreateServiceJobFromJSON (const json_t *job_json_p, GrassrootsServer *grassroots_p) |
Create a ServiceJob from a json_t object. More... | |
bool | InitServiceJobFromJSON (ServiceJob *job_p, const json_t *json_p, struct Service *service_p, GrassrootsServer *grassroots_p) |
Get a ServiceJob from a json_t object. More... | |
OperationStatus | GetServiceJobStatus (ServiceJob *job_p) |
Get the Current OperationStatus of a ServiceJob. More... | |
OperationStatus | GetCachedServiceJobStatus (const ServiceJob *job_p) |
Get the last retrieved OperationStatus of a ServiceJob. More... | |
const char * | GetServiceJobName (const ServiceJob *job_p) |
Get the name of ServiceJob. More... | |
bool | CloseServiceJob (ServiceJob *job_p) |
Close a ServiceJob. More... | |
void | ClearServiceJobResults (ServiceJob *job_p, bool free_memory_flag) |
Clear the results associated with a ServiceJob. More... | |
char * | SerialiseServiceJobToJSON (ServiceJob *const job_p, bool omit_results_flag) |
Save the ServiceJob to a persistent format that allows the ServiceJob to be recreated in a potentially different thread and/or process. More... | |
ServiceJob * | CreateServiceJobFromResultsJSON (const json_t *results_p, struct Service *service_p, const char *name_s, const char *description_s, OperationStatus status, const char *job_type_s) |
Create a ServiceJob from a JSON Resource fragment. More... | |
bool | InitServiceJobFromResultsJSON (ServiceJob *job_p, const json_t *results_p, struct Service *service_p, const char *name_s, const char *description_s, OperationStatus status, const char *job_type_s) |
Fill in the data for a ServiceJob from a given JSON fragement. More... | |
bool | AddParameterErrorMessageToServiceJob (ServiceJob *job_p, const char *const param_s, const ParameterType param_type, const char *const value_s) |
Add a key-value pair error statement to a ServiceJob. More... | |
bool | AddGeneralErrorMessageToServiceJob (ServiceJob *job_p, const char *const value_s) |
Add a key-value pair error statement to a ServiceJob. More... | |
bool | AddCompoundErrorToServiceJob (ServiceJob *job_p, const char *param_s, const ParameterType param_type, json_t *error_details_p) |
Add a key-value pair error statement to a ServiceJob. More... | |
bool | AddResultToServiceJob (ServiceJob *job_p, json_t *result_p) |
Add a result to ServiceJob. More... | |
void | SetServiceJobStatus (ServiceJob *job_p, OperationStatus status) |
Set the current OperationStatus for a given ServiceJob. More... | |
void | SetServiceJobUpdateFunction (ServiceJob *job_p, bool(*update_fn)(ServiceJob *job_p)) |
Set the function that a ServiceJob will use to update itself. More... | |
void | SetServiceJobFreeFunction (ServiceJob *job_p, void(*free_fn)(ServiceJob *job_p)) |
Set the function that a ServiceJob will use to free itself. More... | |
void | SetServiceJobCalculateResultFunction (ServiceJob *job_p, bool(*calculate_fn)(ServiceJob *job_p)) |
Set the function that a ServiceJob will use to calculate its results. More... | |
bool | UpdateServiceJob (ServiceJob *job_p) |
Update, if appropriate, a given ServiceJob. More... | |
uint32 | GetNumberOfServiceJobResults (const ServiceJob *job_p) |
Get the number of results stored on a ServiceJob. More... | |
bool | ReplaceServiceJobResults (ServiceJob *job_p, json_t *results_p) |
Replace the set of results for a given ServiceJob. More... | |
bool | AddLinkedServiceToServiceJob (ServiceJob *job_p, struct LinkedService *linked_service_p) |
Add a LinkedService to ServiceJob. More... | |
void | ProcessLinkedServices (ServiceJob *job_p) |
Attempt to extract the relevant data for all LinkedServices that the ServiceJob's Service has and store them in the ServiceJob. More... | |
bool | CalculateServiceJobResult (ServiceJob *job_p) |
Calculate the results for the given ServiceJob. More... | |
void | SetServiceJobUUID (ServiceJob *job_p, const uuid_t new_job_id) |
Replace the uuid for a given ServiceJob. More... | |
Data Fields | |
struct Service * | sj_service_p |
The Service that is running this job. More... | |
uuid_t | sj_id |
The unique identifier for this job. More... | |
enum OperationStatus | sj_status |
Is the service currently in an open state? More... | |
char * | sj_service_name_s |
The name of the Service that this ServiceJob is for. More... | |
char * | sj_name_s |
The name of the ServiceJob. More... | |
char * | sj_description_s |
The description of the ServiceJob. More... | |
char * | sj_url_s |
Any user-facing URL for showing results of running this ServiceJob. More... | |
json_t * | sj_result_p |
The JSON fragment for the results of this ServiceJob. More... | |
json_t * | sj_metadata_p |
The JSON fragment for any extra information for this ServiceJob. More... | |
json_t * | sj_errors_p |
The JSON fragment for any errors that have occurred whilst running this ServiceJob. More... | |
json_t * | sj_linked_services_p |
A JSON array where each object contains the details of running a different Service based upon the results of this ServiceJob. More... | |
bool(* | sj_update_fn )(struct ServiceJob *job_p) |
The callback function to use when checking the status of this ServiceJob. More... | |
void(* | sj_free_fn )(struct ServiceJob *job_p) |
The callback function to use when freeing this ServiceJob. More... | |
bool(* | sj_calculate_result_fn )(struct ServiceJob *job_p) |
The callback function to use when a ServiceJob needs to generate its results This is useful for subclasses of ServiceJob that need custom behaviour. More... | |
bool | sj_is_updating_flag |
Is this ServiceJob in the process of updating itself? More... | |
char * | sj_type_s |
The type of ServiceJob. More... | |
A datatype to represent a running task.
Each Service can run one or more ServiceJobs.
void FreeServiceJob | ( | ServiceJob * | job_p | ) |
Free a ServiceJob.
job_p | The ServiceJob to free. |
void FreeBaseServiceJob | ( | ServiceJob * | job_p | ) |
Free a ServiceJob ignoring if it is a subclass.
Unless you want to explicitly delete the base ServiceJob only, then FreeServiceJob() should be used instead. This is primarily to be called from the functions that free subclassed ServiceJobs.
job_p | The ServiceJob to free. |
ServiceJob * AllocateServiceJob | ( | struct Service * | service_p, |
const char * | job_name_s, | ||
const char * | job_description_s, | ||
bool(*)(struct ServiceJob *job_p) | update_fn, | ||
bool(*)(struct ServiceJob *job_p) | calculate_results_fn, | ||
void(*)(struct ServiceJob *job_p) | free_job_fn, | ||
const char * | job_type_s | ||
) |
Allocate a ServiceJob.
service_p | The Service that is running the ServiceJob. |
job_name_s | The name to give to the ServiceJob. |
job_description_s | The description to give to the ServiceJob. |
update_fn | The callback function to use when checking the ServiceJob has been updated. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then GetServiceJobStatus will be used. |
calculate_results_fn | The callback function to use to determine the results for this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then the contents of sj_result_p will be used as is. |
free_job_fn | The callback function to use when freeing this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then ClearServiceJob will be used before deallocating the memory ServiceJob structure. |
job_type_s | The identifier to use for the given ServiceJob. |
NULL
upon error. ServiceJob * CreateAndAddServiceJobToService | ( | struct Service * | service_p, |
const char * | job_name_s, | ||
const char * | job_description_s, | ||
bool(*)(struct ServiceJob *job_p) | update_fn, | ||
bool(*)(struct ServiceJob *job_p) | calculate_results_fn, | ||
void(*)(struct ServiceJob *job_p) | free_job_fn | ||
) |
Allocate a ServiceJob and add it to a ServiceJobSet.
This will call AllocateServiceJob and if successful will then add the new ServiceJob to the given Service.
service_p | The Service to add the new ServiceJob to. |
job_name_s | The name to give to the ServiceJob. |
job_description_s | The description to give to the ServiceJob. |
update_fn | The callback function to use when checking the ServiceJob has been updated. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then GetServiceJobStatus will be used. |
calculate_results_fn | The callback function to use to determine the results for this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then the contents of sj_result_p will be used as is. |
free_job_fn | The callback function to use when freeing this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then ClearServiceJob will be used before deallocating the memory ServiceJob structure. |
NULL
upon error. bool InitServiceJob | ( | ServiceJob * | job_p, |
struct Service * | service_p, | ||
const char * | job_name_s, | ||
const char * | job_description_s, | ||
bool(*)(struct ServiceJob *job_p) | update_fn, | ||
bool(*)(struct ServiceJob *job_p) | calculate_results_fn, | ||
void(*)(struct ServiceJob *job_p) | free_job_fn, | ||
uuid_t * | id_p, | ||
const char * | job_type_s | ||
) |
Initialise a ServiceJob.
This will initialise a ServiceJob ready for use and will automatically get called for all ServiceJobs in a ServiceJobSet when it is first created.
job_p | The ServiceJob to initialise. |
job_name_s | The name to give to the ServiceJob. |
job_description_s | The description to give to the ServiceJob. |
service_p | The Service that is running the ServiceJob. |
update_fn | The callback function to use when checking the ServiceJob has been updated. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then GetServiceJobStatus will be used. |
calculate_results_fn | The callback function to use to determine the results for this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then the contents of sj_result_p will be used as is. |
free_job_fn | The callback function to use when freeing this ServiceJob. This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL , then ClearServiceJob will be used before deallocating the memory ServiceJob structure. |
id_p | Pointer to the the uuid to use as the id for this ServiceJob. |
job_type_s | The identifier to use for the given ServiceJob class. |
true
if the ServiceJob was initialised successfully, false
otherwise void ClearServiceJob | ( | ServiceJob * | job_p | ) |
Clear a Service Job ready for reuse.
job_p | The ServiceJob to clear. |
ServiceJob * CloneServiceJob | ( | const ServiceJob * | src_p | ) |
Create a deep copy of a ServiceJob.
src_p | The ServiceJob to copy. |
NULL
upon error. bool CopyServiceJob | ( | const ServiceJob * | src_p, |
ServiceJob * | dest_p | ||
) |
Make a deep copy of one ServiceJob to another.
src_p | The ServiceJob to copy. |
dest_p | The ServiceJob where the values will be copied to. |
true
if the ServiceJob was copied successfully, false
otherwise. struct Service * GetServiceFromServiceJob | ( | ServiceJob * | job_p | ) |
Get the owning Service for a given ServiceJob.
job_p | The ServiceJOb to get the Service for. |
NULL
if there was an error. bool SetServiceJobDescription | ( | ServiceJob * | job_p, |
const char *const | description_s | ||
) |
Set the description of ServiceJob.
job_p | The ServiceJob to alter. |
description_s | The description to set. A deep copy will be made of this string so this value does not need to stay in scope. |
true
if the name was set successfully, false
otherwise. bool SetServiceJobURL | ( | ServiceJob * | job_p, |
const char *const | url_s | ||
) |
Set the description of ServiceJob.
job_p | The ServiceJob to alter. |
url_s | The url to set. A deep copy will be made of this string so this value does not need to stay in scope. |
true
if the name was set successfully, false
otherwise. bool SetServiceJobName | ( | ServiceJob * | job_p, |
const char *const | name_s | ||
) |
Set the name of ServiceJob.
job_p | The ServiceJob to alter. |
name_s | The name to set. A deep copy will be made of this string so this value does not need to stay in scope. |
true
if the name was set successfully, false
otherwise. json_t * GetServiceJobAsJSON | ( | ServiceJob *const | job_p, |
bool | omit_results_flag | ||
) |
Get a ServiceJob as JSON.
job_p | The ServiceJob to convert into JSON. |
omit_results_flag | If this is true then just the minimal status information for the ServiceJob will be returned. If it is false then the job results will be included too if possible. |
NULL
upon error. json_t * GetServiceJobStatusAsJSON | ( | ServiceJob * | job_p, |
bool | omit_results_flag | ||
) |
Get the Current OperationStatus of a ServiceJob as JSON.
job_p | The ServiceJob to query. |
omit_results_flag | If this is true then just the minimal status information for the ServiceJob will be returned. If it is false then the job results will be included too if possible. |
NULL
upon error. ServiceJob * CreateServiceJobFromJSON | ( | const json_t * | job_json_p, |
GrassrootsServer * | grassroots_p | ||
) |
Create a ServiceJob from a json_t object.
This will create a ServiceJob from a json_t object. It will allocate a new ServiceJob and then call SetServiceFromJSON
.
json_p | The json object representing a ServiceJob. |
true
if the ServiceJob was created successfully, false
otherwise.bool InitServiceJobFromJSON | ( | ServiceJob * | job_p, |
const json_t * | json_p, | ||
struct Service * | service_p, | ||
GrassrootsServer * | grassroots_p | ||
) |
Get a ServiceJob from a json_t object.
job_p | The ServiceJob which will be filled in from the json data. |
json_p | The json object representing a ServiceJob. |
true
if the ServiceJob was created successfully, false
otherwise. OperationStatus GetServiceJobStatus | ( | ServiceJob * | job_p | ) |
Get the Current OperationStatus of a ServiceJob.
This will check and update the OperationStatus of the ServiceJob to an up to date value before returning.
job_p | The ServiceJob to query. |
OperationStatus GetCachedServiceJobStatus | ( | const ServiceJob * | job_p | ) |
Get the last retrieved OperationStatus of a ServiceJob.
This will not check to see if the current OperationStatus of a ServiceJob has changed, for that use GetServiceJobStatus
job_p | The ServiceJob to query. |
const char * GetServiceJobName | ( | const ServiceJob * | job_p | ) |
Get the name of ServiceJob.
job_p | The ServiceJob to query. |
bool CloseServiceJob | ( | ServiceJob * | job_p | ) |
Close a ServiceJob.
This will call the Services close callback function.
job_p | The ServiceJob to close. |
true
if the ServiceJob was closed successfully, false
otherwise. void ClearServiceJobResults | ( | ServiceJob * | job_p, |
bool | free_memory_flag | ||
) |
Clear the results associated with a ServiceJob.
This will call the Services close callback function.
job_p | The ServiceJob to close. |
free_memory_flag | If this is true then the ServiceJob's results will be freed. If false then the results will just be set to NULL. This allows the transfer of the results variable into another json_t object if needed for example. |
char * SerialiseServiceJobToJSON | ( | ServiceJob *const | job_p, |
bool | omit_results_flag | ||
) |
Save the ServiceJob to a persistent format that allows the ServiceJob to be recreated in a potentially different thread and/or process.
This is used to save a ServiceJob in the JobsManager.
job_p | The ServiceJob. |
omit_results_flag | If this is true then just the minimal status information for the ServiceJob will be returned. If it is false then the job results will be included too if possible. |
NULL
upon error. ServiceJob * CreateServiceJobFromResultsJSON | ( | const json_t * | results_p, |
struct Service * | service_p, | ||
const char * | name_s, | ||
const char * | description_s, | ||
OperationStatus | status, | ||
const char * | job_type_s | ||
) |
Create a ServiceJob from a JSON Resource fragment.
This is useful when combining results from a PairedService. The resultant ServiceJob will have its results field filled in using the JSON fragment passed in.
results_p | A Resource JSON fragment. |
service_p | The Service that the newly-created ServiceJob will belong to. |
name_s | The name of the ServiceJob. |
description_s | The description of the ServiceJob. This can be NULL . |
status | The OperationStatus to set for the ServiceJob. |
job_type_s | The identifier to use for the given ServiceJob class. |
NULL
upon error.bool InitServiceJobFromResultsJSON | ( | ServiceJob * | job_p, |
const json_t * | results_p, | ||
struct Service * | service_p, | ||
const char * | name_s, | ||
const char * | description_s, | ||
OperationStatus | status, | ||
const char * | job_type_s | ||
) |
Fill in the data for a ServiceJob from a given JSON fragement.
job_p | The ServiceJob to fill in. |
results_p | The JSON fragment used to populate the data of the ServiceJob. |
service_p | The Service that refers to the ServiceJob |
name_s | The name to give to the ServiceJob. This can be NULL . |
description_s | The description to give to the ServiceJob. This can be NULL . |
status | The OperationStatus to set for the ServiceJob. |
job_type_s | The identifier to use for the given ServiceJob class. |
true
if the ServiceJob was initialised successfully, false
otherwise. bool AddParameterErrorMessageToServiceJob | ( | ServiceJob * | job_p, |
const char *const | param_s, | ||
const ParameterType | param_type, | ||
const char *const | value_s | ||
) |
Add a key-value pair error statement to a ServiceJob.
job_p | The ServiceJob to update. |
key_s | The key for the error. |
value_s | The value for the error. |
true
if the ServiceJob was amended successfully, false
otherwise. bool AddGeneralErrorMessageToServiceJob | ( | ServiceJob * | job_p, |
const char *const | value_s | ||
) |
Add a key-value pair error statement to a ServiceJob.
job_p | The ServiceJob to update. |
key_s | The key for the error. |
value_s | The value for the error. |
true
if the ServiceJob was amended successfully, false
otherwise. bool AddCompoundErrorToServiceJob | ( | ServiceJob * | job_p, |
const char * | param_s, | ||
const ParameterType | param_type, | ||
json_t * | error_details_p | ||
) |
Add a key-value pair error statement to a ServiceJob.
job_p | The ServiceJob to update. |
key_s | The key for the error. |
compound_error_s | The value for the error. |
true
if the ServiceJob was amended successfully, false
otherwise. bool AddResultToServiceJob | ( | ServiceJob * | job_p, |
json_t * | result_p | ||
) |
Add a result to ServiceJob.
job_p | The ServiceJob to add the result to. |
result_p | The result to add. This is a Resource stored in json format. |
true
if the ServiceJob was updated successfully, false
otherwise. void SetServiceJobStatus | ( | ServiceJob * | job_p, |
OperationStatus | status | ||
) |
Set the current OperationStatus for a given ServiceJob.
job_p | The ServiceJob to update. |
status | The new OperationStatus value. |
void SetServiceJobUpdateFunction | ( | ServiceJob * | job_p, |
bool(*)(ServiceJob *job_p) | update_fn | ||
) |
Set the function that a ServiceJob will use to update itself.
job_p | The ServiceJob to amend. |
update_fn | The new function that will be used for the ServiceJob to update itself. |
void SetServiceJobFreeFunction | ( | ServiceJob * | job_p, |
void(*)(ServiceJob *job_p) | free_fn | ||
) |
Set the function that a ServiceJob will use to free itself.
job_p | The ServiceJob to amend. |
free_fn | The new function that will be used for the ServiceJob to free itself. |
void SetServiceJobCalculateResultFunction | ( | ServiceJob * | job_p, |
bool(*)(ServiceJob *job_p) | calculate_fn | ||
) |
Set the function that a ServiceJob will use to calculate its results.
job_p | The ServiceJob to amend. |
calculate_fn | The new function that will be used for the ServiceJob tocalculate its results. |
bool UpdateServiceJob | ( | ServiceJob * | job_p | ) |
Update, if appropriate, a given ServiceJob.
If the ServiceJob was previously in an unfinished state, then check to see whether it has finished running. If the ServiceJob had already finished, either successfully or with errors, this function is a no-op.
job_p | The ServiceJob to update. |
true
if the ServiceJob was updated successfully, false
otherwise. uint32 GetNumberOfServiceJobResults | ( | const ServiceJob * | job_p | ) |
Get the number of results stored on a ServiceJob.
job_p | The ServiceJob to check. |
bool ReplaceServiceJobResults | ( | ServiceJob * | job_p, |
json_t * | results_p | ||
) |
Replace the set of results for a given ServiceJob.
job_p | The ServiceJob to amend. |
results_p | The new JSON fragment which will be the ServiceJob's results. Any previous results will have the reference count decremented. |
true
if the ServiceJob was updated successfully, false
otherwise. bool AddLinkedServiceToServiceJob | ( | ServiceJob * | job_p, |
struct LinkedService * | linked_service_p | ||
) |
Add a LinkedService to ServiceJob.
The ServiceJob needs to have its results set prior to calling this method
job_p | The ServiceJob to add the LinkedService details to. |
linked_service_p | The LinkedService details to update the ServiceJob with. |
true
if the ServiceJob was updated successfully, false
otherwise. void ProcessLinkedServices | ( | ServiceJob * | job_p | ) |
Attempt to extract the relevant data for all LinkedServices that the ServiceJob's Service has and store them in the ServiceJob.
job_p | TheServiceJob to process. |
bool CalculateServiceJobResult | ( | ServiceJob * | job_p | ) |
Calculate the results for the given ServiceJob.
job_p |
true
if the results of the ServiceJob were calculated successfully, false
otherwise. void SetServiceJobUUID | ( | ServiceJob * | job_p, |
const uuid_t | new_job_id | ||
) |
Replace the uuid for a given ServiceJob.
job_p | The ServiceJob whose uuid will be changed. |
new_job_id | The new uuid. |
uuid_t sj_id |
The unique identifier for this job.
enum OperationStatus sj_status |
Is the service currently in an open state?
char* sj_service_name_s |
The name of the Service that this ServiceJob is for.
char* sj_name_s |
The name of the ServiceJob.
char* sj_description_s |
The description of the ServiceJob.
char* sj_url_s |
Any user-facing URL for showing results of running this ServiceJob.
json_t* sj_result_p |
The JSON fragment for the results of this ServiceJob.
json_t* sj_metadata_p |
The JSON fragment for any extra information for this ServiceJob.
json_t* sj_errors_p |
The JSON fragment for any errors that have occurred whilst running this ServiceJob.
json_t* sj_linked_services_p |
A JSON array where each object contains the details of running a different Service based upon the results of this ServiceJob.
bool(* sj_update_fn) (struct ServiceJob *job_p) |
The callback function to use when checking the status of this ServiceJob.
This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL
, then GetServiceJobStatus will be used.
void(* sj_free_fn) (struct ServiceJob *job_p) |
The callback function to use when freeing this ServiceJob.
This is useful for subclasses of ServiceJob that need custom behaviour. If this is NULL
, then ClearServiceJob will be used before deallocating the memory ServiceJob structure.
bool(* sj_calculate_result_fn) (struct ServiceJob *job_p) |
The callback function to use when a ServiceJob needs to generate its results This is useful for subclasses of ServiceJob that need custom behaviour.
This can be NULL
.
bool sj_is_updating_flag |
Is this ServiceJob in the process of updating itself?
char* sj_type_s |
The type of ServiceJob.
This is used to denote a subclass of ServiceJob if needed and you need to check its type