A datatype for describing a remote Service that can be used in conjunction with a local Service.
More...
#include <paired_service.h>
|
PairedService * | AllocatePairedService (const uuid_t id, const char *name_s, const char *server_uri_s, const char *server_name_s, const json_t *service_json_p, const json_t *provider_p) |
| Allocate a PairedService. More...
|
|
void | FreePairedService (PairedService *paired_service_p) |
| Free a PairedService. More...
|
|
json_t * | MakeRemotePairedServiceCall (const char *const service_name_s, ParameterSet *params_p, const char *const paired_service_uri_s, ProvidersStateTable *providers_p, GrassrootsServer *grassroots_p) |
| Call the PairedService and get its JSON response. More...
|
|
int32 | RunPairedServices (struct Service *service_p, ParameterSet *param_set_p, ProvidersStateTable *providers_p, bool(*save_job_fn)(struct RemoteServiceJob *job_p, const struct ServiceData *service_data_p)) |
| Run all of the PairedServices for a given Service. More...
|
|
int32 | AddRemoteResultsToServiceJobs (const json_t *server_response_p, struct Service *service_p, const char *const remote_service_s, const char *const remote_uri_s, const struct ServiceData *service_data_p, bool(*save_job_fn)(struct RemoteServiceJob *job_p, const struct ServiceData *service_data_p)) |
| Add the results of running PairedServices as RemoteServiceJobs to the ServiceJobSet of a given Service. More...
|
|
A datatype for describing a remote Service that can be used in conjunction with a local Service.
◆ AllocatePairedService()
PairedService * AllocatePairedService |
( |
const uuid_t |
id, |
|
|
const char * |
name_s, |
|
|
const char * |
server_uri_s, |
|
|
const char * |
server_name_s, |
|
|
const json_t * |
service_json_p, |
|
|
const json_t * |
provider_p |
|
) |
| |
◆ FreePairedService()
◆ MakeRemotePairedServiceCall()
Call the PairedService and get its JSON response.
- Parameters
-
service_name_s | The name of the PairedServce to call. |
params_p | The ParameterSet to send to the PairedService. |
paired_service_uri_s | The URI of the ExternalServer to send the request to. |
providers_p | The details of ExternalServers for any paired or external Services. |
- Returns
- The JSON fragment of the results of the PairedService or
NULL
upon error.
◆ RunPairedServices()
Run all of the PairedServices for a given Service.
These will be added as RemoteServiceJobs to the ServiceJobSet of this Service by calling AddRemoteResultsToServiceJobs().
- Parameters
-
service_p | The Service to run the PairedServices for. |
param_set_p | The ParameterSet to send to the PairedService. |
providers_p | The details of ExternalServers for any paired or external Services. |
save_job_fn | If you need any extra processing of the resulting RemoteServiceJobs this function can be used. It will be called passing each RemoteServiceJob in turn along with the ServiceData for this Service. if the processing was successful it will return true , with false upon failure. |
- Returns
- The number of PairedServices that were ran successfully.
◆ AddRemoteResultsToServiceJobs()
int32 AddRemoteResultsToServiceJobs |
( |
const json_t * |
server_response_p, |
|
|
struct Service * |
service_p, |
|
|
const char *const |
remote_service_s, |
|
|
const char *const |
remote_uri_s, |
|
|
const struct ServiceData * |
service_data_p, |
|
|
bool(*)(struct RemoteServiceJob *job_p, const struct ServiceData *service_data_p) |
save_job_fn |
|
) |
| |
Add the results of running PairedServices as RemoteServiceJobs to the ServiceJobSet of a given Service.
- Parameters
-
server_response_p | The response from the remote Grassroots Server that was called to run the PairedServices. |
service_p | The Service that will have the RemoteServiceJobs added to it. |
remote_service_s | The name of the remote Service that was called. |
remote_uri_s | The URL of the remote Grassroots Server that was called to run the PairedServices. |
service_data_p | The ServiceData for the given Service. |
save_job_fn | If you need any extra processing of the resulting RemoteServiceJobs this function can be used. It will be called passing each RemoteServiceJob in turn along with the ServiceData for this Service. if the processing was successful it will return true , with false upon failure. |
- Returns
- The number of PairedServices that were ran successfully.
◆ ps_extenal_server_id
◆ ps_name_s
◆ ps_server_name_s
◆ ps_server_uri_s
◆ ps_provider_p
◆ ps_params_p
The documentation for this struct was generated from the following file: