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 allow access to an external Grassroots Server. More...
#include <servers_manager.h>
Public Member Functions | |
ExternalServer * | AllocateExternalServer (const char *name_s, const char *uri_s, const char *uuid_s, ConnectionType ct) |
Allocate an ExternalServer. More... | |
void | FreeExternalServer (ExternalServer *server_p) |
Free an ExternalServer. More... | |
json_t * | MakeRemoteJSONCallToExternalServer (ExternalServer *server_p, json_t *request_p) |
Call a remote server. More... | |
bool | AddExternalServerFromJSON (ServersManager *manager_p, const json_t *json_p) |
Add an ExternalServer from a JSON-based definition. More... | |
ExternalServer * | CreateExternalServerFromJSON (const json_t *json_p) |
Create a ExternalServer from a json_t object. More... | |
unsigned char * | SerialiseExternalServerToJSON (ExternalServer *const external_server_p, unsigned int *value_length_p) |
Get a raw unsigned char array that allows the ExternalServer to be stored in the ServersManager. More... | |
ExternalServer * | DeserialiseExternalServerFromJSON (const unsigned char *raw_json_data_s) |
Create an ExternalServer from a raw data memory block. More... | |
json_t * | GetExternalServerAsJSON (ExternalServer *server_p) |
Get the JSON fragment that describes the given ExternalServer. More... | |
Data Fields | |
char * | es_name_s |
The user-friendly name of the server. More... | |
char * | es_uri_s |
The URI for the Server. More... | |
Connection * | es_connection_p |
The Connection to the ExternalServer. More... | |
uuid_t | es_id |
A unique id to identify the ExternalServer. More... | |
LinkedList * | es_paired_services_p |
A List of KeyValuePairNodes where the key is the name of the Service on the local Server and the value is the name of the Service on this ExternalServer. More... | |
A datatype to allow access to an external Grassroots Server.
This stores the information needed to consolidate the Services available on other Grassroots Servers
ExternalServer * AllocateExternalServer | ( | const char * | name_s, |
const char * | uri_s, | ||
const char * | uuid_s, | ||
ConnectionType | ct | ||
) |
Allocate an ExternalServer.
name_s | The user-friendly name for the server |
uri_s | The URI to call for the ExternalServer's Services. |
uuid_s | The string representation of the UUID to addign to the ExternalServer. |
ct | The ConnectionType of how to connect to the ExternalServer |
NULL
upon error. void FreeExternalServer | ( | ExternalServer * | server_p | ) |
Free an ExternalServer.
server_p | The ExternalServer to free. |
json_t * MakeRemoteJSONCallToExternalServer | ( | ExternalServer * | server_p, |
json_t * | request_p | ||
) |
Call a remote server.
This will proxy a call to an ExternalServer and will return the response to the user. All of this happens transparently from the user's point of view, the requested service appears to be running on this Server.
server_p | The ExternalServer to proxy the request to. |
request_p | The request to proxy. |
bool AddExternalServerFromJSON | ( | ServersManager * | manager_p, |
const json_t * | json_p | ||
) |
Add an ExternalServer from a JSON-based definition.
This will read in the SERVERS_S json object within the global configuration file and build the ExternalServer definitions from it.
json_p | The global configuration json_t object. |
true
if the ExternalServer was generated successfully, false
otherwise.ExternalServer * CreateExternalServerFromJSON | ( | const json_t * | json_p | ) |
Create a ExternalServer from a json_t object.
This will create a ExternalServer from a json_t object.
json_p | The json object representing a ExternalServer. |
true
if the v was created successfully, false
otherwise. unsigned char * SerialiseExternalServerToJSON | ( | ExternalServer *const | external_server_p, |
unsigned int * | value_length_p | ||
) |
Get a raw unsigned char array that allows the ExternalServer to be stored in the ServersManager.
The array is the result of GetExternalServerAsJSON converted to a string
external_server_p | The ExternalServer to serialise. |
value_length_p | Upon success, the length in bytes of the resultant array will be stored here. |
NULL
upon error.ExternalServer * DeserialiseExternalServerFromJSON | ( | const unsigned char * | raw_json_data_s | ) |
Create an ExternalServer from a raw data memory block.
raw_json_data_s | The raw data from a previous call to SerialiseExternalServerToJSON. |
NULL
upon error.json_t * GetExternalServerAsJSON | ( | ExternalServer * | server_p | ) |
Get the JSON fragment that describes the given ExternalServer.
server_p | The ExternalServer to get the JSON fragment for. |
NULL
upon error. char* es_name_s |
The user-friendly name of the server.
char* es_uri_s |
The URI for the Server.
Connection* es_connection_p |
The Connection to the ExternalServer.
uuid_t es_id |
A unique id to identify the ExternalServer.
This is only unique for this Server. It is for tracking requests for given Services.
LinkedList* es_paired_services_p |
A List of KeyValuePairNodes where the key is the name of the Service on the local Server and the value is the name of the Service on this ExternalServer.