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.
service.h File Reference
#include "grassroots_service_library.h"
#include "byte_buffer.h"
#include "linked_list.h"
#include "parameter_set.h"
#include "typedefs.h"
#include "handler.h"
#include "user_details.h"
#include "operation.h"
#include "paired_service.h"
#include "linked_service.h"
#include "uuid_defs.h"
#include "service_metadata.h"
#include "sync_data.h"
#include "jansson.h"
#include "providers_state_table.h"
Include dependency graph for service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ServiceData
 A datatype for holding the configuration data for a Service. More...
 
struct  Service
 A datatype which defines an available service, its capabilities and its parameters. More...
 
struct  ServiceNode
 A datatype for storing Services on a LinkedList. More...
 
struct  ServicesArray
 A datatype for having a set of Services. More...
 

Macros

#define SERVICE_GROUP_ALIAS_SEPARATOR   "-"
 This specifies the relative filesystem path to where the Service plugins are stored. More...
 

Enumerations

enum  Synchronicity { SY_SYNCHRONOUS, SY_ASYNCHRONOUS_DETACHED, SY_ASYNCHRONOUS_ATTACHED }
 A datatype to define how a Service runs. More...
 

Functions

ServicesArrayGetReferrableServicesFromPlugin (Plugin *const plugin_p, User *user_p, const json_t *service_config_p)
 Get the ServicesArray from a given Plugin. More...
 
ServicesArrayGetServicesFromPlugin (Plugin *const plugin_p, User *user_p)
 Get the ServicesArray from a given Plugin. More...
 
bool SortServicesListByName (LinkedList *services_list_p)
 
json_t * GetBaseServiceDataAsJSON (Service *const service_p, User *user_p)
 
json_t * GetServiceRefreshRequestFromJSON (const char *const service_name_s, json_t *param_set_json_p, const SchemaVersion *sv_p, const bool run_flag, const ParameterLevel level)
 
json_t * GetServiceRunRequestFromJSON (const char *const service_name_s, json_t *param_set_json_p, const SchemaVersion *sv_p, const bool run_flag, const ParameterLevel level)
 
bool DefaultGetParameterTypeForNamedParameter (const char *param_name_s, ParameterType *pt_p, const NamedParameterType *params_p)
 
bool AddServiceJobToService (Service *service_p, ServiceJob *job_p)
 Add a ServiceJob to a Service. More...
 
bool RemoveServiceJobFromService (Service *service_p, ServiceJob *job_p)
 Remove a ServiceJob from a Service. More...
 

Macro Definition Documentation

◆ SERVICE_GROUP_ALIAS_SEPARATOR

#define SERVICE_GROUP_ALIAS_SEPARATOR   "-"

This specifies the relative filesystem path to where the Service plugins are stored.

Function Documentation

◆ GetReferrableServicesFromPlugin()

ServicesArray* GetReferrableServicesFromPlugin ( Plugin *const  plugin_p,
User user_p,
const json_t *  service_config_p 
)

Get the ServicesArray from a given Plugin.

Parameters
plugin_pThe Plugin to get the ServicesArray from.
user_pAny user configuration details. This can be NULL.
service_config_pAny service configuration details.
Returns
The ServicesArray or NULL upon error.

◆ GetServicesFromPlugin()

ServicesArray* GetServicesFromPlugin ( Plugin *const  plugin_p,
User user_p 
)

Get the ServicesArray from a given Plugin.

Parameters
plugin_pThe Plugin to get the ServicesArray from.
user_pAny user configuration details. This can be NULL.
Returns
The ServicesArray or NULL upon error.

◆ SortServicesListByName()

bool SortServicesListByName ( LinkedList services_list_p)

◆ GetBaseServiceDataAsJSON()

json_t* GetBaseServiceDataAsJSON ( Service *const  service_p,
User user_p 
)

◆ GetServiceRefreshRequestFromJSON()

json_t* GetServiceRefreshRequestFromJSON ( const char *const  service_name_s,
json_t *  param_set_json_p,
const SchemaVersion sv_p,
const bool  run_flag,
const ParameterLevel  level 
)

◆ GetServiceRunRequestFromJSON()

json_t* GetServiceRunRequestFromJSON ( const char *const  service_name_s,
json_t *  param_set_json_p,
const SchemaVersion sv_p,
const bool  run_flag,
const ParameterLevel  level 
)

◆ DefaultGetParameterTypeForNamedParameter()

bool DefaultGetParameterTypeForNamedParameter ( const char *  param_name_s,
ParameterType pt_p,
const NamedParameterType params_p 
)

◆ AddServiceJobToService()

bool AddServiceJobToService ( Service service_p,
ServiceJob job_p 
)

Add a ServiceJob to a Service.

Parameters
service_pThe Service to add the ServiceJob to.
job_pThe ServiceJob to add.
Returns
true if the ServiceJob was added to the Service successfully, false otherwise.

◆ RemoveServiceJobFromService()

bool RemoveServiceJobFromService ( Service service_p,
ServiceJob job_p 
)

Remove a ServiceJob from a Service.

Parameters
service_pThe Service to remove the ServiceJob from.
job_pThe ServiceJob to remove.
Returns
true if the ServiceJob was removed to the ServiceJob successfully, false if could not as the ServiceJob is not a member of the Service