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.
|
Go to the documentation of this file.
28 #ifndef SERVERS_POOL_H_
29 #define SERVERS_POOL_H_
117 typedef ExternalServer *(*ExternalServerDeserialiser) (
const unsigned char *data_p);
131 typedef unsigned char *(*ExternalServerSerialiser) (
ExternalServer *server_p, uint32 *length_p);
291 void (*free_servers_manager_fn) (
struct ServersManager *manager_p));
A datatype for storing ExternalServers in a LinkedList.
Definition: servers_manager.h:87
ExternalServerNode * AllocateExternalServerNode(ExternalServer *server_p, MEM_FLAG mf)
Allocate an ExternalServerNode.
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.
char sm_server_id_s[UUID_STRING_BUFFER_SIZE]
The UUID of this ExternalServer as a string.
Definition: servers_manager.h:155
A datatype for monitoring ExternalServers.
Definition: servers_manager.h:141
json_t * MakeRemoteJSONCallToExternalServer(ExternalServer *server_p, json_t *request_p)
Call a remote server.
ExternalServer * CreateExternalServerFromJSON(const json_t *json_p)
Create a ExternalServer from a json_t object.
ExternalServer * RemoveExternalServerFromServersManager(ServersManager *manager_p, const char *const server_uri_s, ExternalServerDeserialiser deserialise_fn)
Remove a ExternalServer.
A datatype to allow access to an external Grassroots Server.
Definition: servers_manager.h:48
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
const char * GetLocalServerIdAsString(struct GrassrootsServer *grassroots_p)
Get the current Server uuid as a c-style string.
char * es_name_s
The user-friendly name of the server.
Definition: servers_manager.h:51
void FreeServersManager(ServersManager *manager_p)
Free a ServersManager.
A set of string functions.
int(* sm_add_server_fn)(struct ServersManager *manager_p, ExternalServer *server_p, ExternalServerSerialiser serialise_fn)
Add an ExternalServer to the ServersManager.
Definition: servers_manager.h:172
Operation
The various Operations that a Server can perform.
Definition: operation.h:46
void FreeExternalServer(ExternalServer *server_p)
Free an ExternalServer.
char * es_uri_s
The URI for the Server.
Definition: servers_manager.h:54
int AddExternalServerToServersManager(ServersManager *manager_p, ExternalServer *server_p, ExternalServerSerialiser serialise_fn)
Add an ExternalServer to the ServersManager.
uuid_t sm_server_id
The UUID for this Server.
Definition: servers_manager.h:148
uuid_t es_id
A unique id to identify the ExternalServer.
Definition: servers_manager.h:65
ExternalServer *(* ExternalServerDeserialiser)(const unsigned char *data_p)
A function to take a raw binary data representation of a previously stored ExternalServer and recreat...
Definition: servers_manager.h:117
Connection * es_connection_p
The Connection to the ExternalServer.
Definition: servers_manager.h:57
const char * GetRemotePairedServiceName(const ExternalServer *const src_p, const char *const local_service_name_s)
Get the name of the remote paired service corresponding to a given local service name.
LinkedList * GetAllExternalServersFromServersManager(ServersManager *manager_p, ExternalServerDeserialiser deserialise_fn)
Get all ExternalServers.
ExternalServer * DeserialiseExternalServerFromJSON(const unsigned char *raw_json_data_s)
Create an ExternalServer from a raw data memory block.
void FreeExternalServerNode(ListItem *node_p)
Free an ExternalServerNode.
json_t * GetExternalServerAsJSON(ExternalServer *server_p)
Get the JSON fragment that describes the given ExternalServer.
MEM_FLAG esn_server_mem
The MEM_FLAG indicating the ownership of the ExternalServer from this ExternalServerNode and whether ...
Definition: servers_manager.h:100
uuid_t * GetLocalServerId(struct GrassrootsServer *grassroots_p)
Get the current Server uuid.
ServersManager * LoadServersManager(const char *servers_manager_s, struct GrassrootsServer *server_p)
unsigned char *(* ExternalServerSerialiser)(ExternalServer *server_p, uint32 *length_p)
A function to generate a raw binary data representation of a ExternalServer allowing it to be recreat...
Definition: servers_manager.h:131
LinkedList * es_paired_services_p
A List of KeyValuePairNodes where the key is the name of the Service on the local Server and the valu...
Definition: servers_manager.h:74
The base class for building a Server-Client connection.
Definition: connection.h:65
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
bool AddExternalServerFromJSON(ServersManager *manager_p, const json_t *json_p)
Add an ExternalServer from a JSON-based definition.
#define UUID_STRING_BUFFER_SIZE
The number of bytes required to store a c-style string representation of a UUID.
Definition: uuid_defs.h:32
#define GRASSROOTS_SERVICE_MANAGER_LOCAL
Definition: grassroots_service_manager_library.h:47
A Plugin is a dynamically-loaded component to provide a piece of functionality.
Definition: plugin.h:150
Definition: grassroots_server.h:45
ExternalServer * esn_server_p
The ExternalServer.
Definition: servers_manager.h:93
void InitServersManager(ServersManager *manager_p, int(*add_server_fn)(ServersManager *manager_p, ExternalServer *server_p, ExternalServerSerialiser serialise_fn), ExternalServer *(*get_server_fn)(ServersManager *manager_p, const char *const server_uri_s, ExternalServerDeserialiser deserialise_fn), ExternalServer *(*remove_server_fn)(ServersManager *manager_p, const char *const server_uri_s, ExternalServerDeserialiser deserialise_fn), LinkedList *(*get_all_servers_fn)(struct ServersManager *manager_p, ExternalServerDeserialiser deserialise_fn), void(*free_servers_manager_fn)(struct ServersManager *manager_p))
Initialise a ServersManager.
ListItem esn_node
The base node.
Definition: servers_manager.h:90
struct Plugin * sm_plugin_p
The plugin that thjs JobsManager was loaded from.
Definition: servers_manager.h:144
#define GRASSROOTS_SERVICE_MANAGER_API
Definition: grassroots_service_manager_library.h:46
ExternalServer * AllocateExternalServer(const char *name_s, const char *uri_s, const char *uuid_s, ConnectionType ct)
Allocate an ExternalServer.
ExternalServer * GetExternalServerFromServersManager(ServersManager *manager_p, const char *const server_uri_s, ExternalServerDeserialiser deserialise_fn)
Find a ExternalServer.
json_t * AddExternalServerOperationsToJSON(ServersManager *manager_p, Operation op)
Get the JSON fragment which will form part of a response to other servers and clients.
ConnectionType
An enumeration listing the different types of Connections.
Definition: connection.h:47
void(* sm_free_servers_manager_fn)(struct ServersManager *manager_p)
Free a given ServersManager.
Definition: servers_manager.h:227
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
Definition: windows_uuid.h:43
GRASSROOTS_SERVICE_MANAGER_LOCAL ServersManager * GetServersManagerFromPlugin(struct Plugin *const plugin_p)