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.
GrassrootsServer Struct Reference

#include <grassroots_server.h>

Collaboration diagram for GrassrootsServer:
[legend]

Public Member Functions

GrassrootsServerAllocateGrassrootsServer (const char *grassroots_path_s, const char *config_filename_s, const char *service_config_path_s, const char *services_path_s, const char *references_path_s, const char *jobs_managers_path_s, const char *servers_managers_path_s, struct JobsManager *external_jobs_manager_p, MEM_FLAG jobs_manager_flag, struct ServersManager *external_servers_manager_p, MEM_FLAG servers_manager_flag)
 Allocate a GrassrootsServer. More...
 
void FreeGrassrootsServer (GrassrootsServer *server_p)
 Free a GrassrootsServer. More...
 
json_t * ProcessServerJSONMessage (GrassrootsServer *grassroots_p, json_t *json_req_p, User *user_p, const char **error_ss)
 Process a given JSON request and produce the server response. More...
 
json_t * GetInitialisedResponseOnServer (GrassrootsServer *server_p, User *user_p, const json_t *req_p, const char *key_s, json_t *value_p)
 Create a response object with a valid header and a given key and value. More...
 
json_t * GetGlobalConfigValue (const GrassrootsServer *grassroots_p, const char *key_s)
 Get a configuration value from the global Grassroots configuration file. More...
 
struct ServersManagerGetServersManager (GrassrootsServer *server_p)
 Get the ServersManager for a given GrassrootsServer. More...
 
json_t * GetGlobalServiceConfig (GrassrootsServer *grassroots_p, const char *const service_name_s, bool *alloc_flag_p)
 Get a configuration value for a named Service. More...
 
UserGetUserByEmailAddress (const GrassrootsServer *grassroots_p, const char *email_s)
 Get an existing User by the email address. More...
 
UserGetUserByIdString (const GrassrootsServer *grassroots_p, const char *id_s)
 Get an existing User by the id. More...
 
UserGetUserById (const GrassrootsServer *grassroots_p, const bson_oid_t *id_p)
 Get an existing User by the id. More...
 
LinkedListGetAllUsers (const GrassrootsServer *grassroots_p)
 Get a list of all Users. More...
 

Data Fields

char * gs_path_s
 The path to the root directory for this GrassrootsServer. More...
 
char * gs_config_filename_s
 The path to the global grassroots config file for this GrassrootsServer. More...
 
char * gs_config_path_s
 The relative path from gs_path_s to the folder containing the individual service config files. More...
 
char * gs_references_path_s
 The relative path from gs_path_s to the folder containing the reference services. More...
 
char * gs_services_path_s
 The relative path from gs_path_s to the folder containing the service modules. More...
 
char * gs_jobs_managers_path_s
 The relative path from gs_path_s to the folder containing the jobs managers modules. More...
 
char * gs_servers_managers_path_s
 The relative path from gs_path_s to the folder containing the servers managers modules. More...
 
struct JobsManagergs_jobs_manager_p
 
MEM_FLAG gs_jobs_manager_mem
 
struct ServersManagergs_servers_manager_p
 
MEM_FLAG gs_servers_manager_mem
 
json_t * gs_config_p
 
SchemaVersiongs_schema_version_p
 
struct MongoClientManager * gs_mongo_manager_p
 

Member Function Documentation

◆ GetUserByEmailAddress()

User * GetUserByEmailAddress ( const GrassrootsServer grassroots_p,
const char *  email_s 
)

Get an existing User by the email address.

Parameters
grassroots_pThe GrassrootsServer to search.
email_sThe email address to find the user for.
Returns
The User or NULL upon error.

◆ GetUserByIdString()

User * GetUserByIdString ( const GrassrootsServer grassroots_p,
const char *  id_s 
)

Get an existing User by the id.

Parameters
grassroots_pThe GrassrootsServer to search.
id_sThe bson id, as a string, of the User to find.
Returns
The User or NULL upon error.

◆ GetUserById()

User * GetUserById ( const GrassrootsServer grassroots_p,
const bson_oid_t *  id_p 
)

Get an existing User by the id.

Parameters
grassroots_pThe GrassrootsServer to search.
id_pThe bson id of the User to find.
Returns
The User or NULL upon error.

◆ GetAllUsers()

LinkedList * GetAllUsers ( const GrassrootsServer grassroots_p)

Get a list of all Users.

Parameters
grassroots_pThe GrassrootsServer to search.
Returns
The list of Users or NULL upon error.

Field Documentation

◆ gs_path_s

char* gs_path_s

The path to the root directory for this GrassrootsServer.

◆ gs_config_filename_s

char* gs_config_filename_s

The path to the global grassroots config file for this GrassrootsServer.

◆ gs_config_path_s

char* gs_config_path_s

The relative path from gs_path_s to the folder containing the individual service config files.

◆ gs_references_path_s

char* gs_references_path_s

The relative path from gs_path_s to the folder containing the reference services.

◆ gs_services_path_s

char* gs_services_path_s

The relative path from gs_path_s to the folder containing the service modules.

◆ gs_jobs_managers_path_s

char* gs_jobs_managers_path_s

The relative path from gs_path_s to the folder containing the jobs managers modules.

◆ gs_servers_managers_path_s

char* gs_servers_managers_path_s

The relative path from gs_path_s to the folder containing the servers managers modules.

◆ gs_jobs_manager_p

struct JobsManager* gs_jobs_manager_p

◆ gs_jobs_manager_mem

MEM_FLAG gs_jobs_manager_mem

◆ gs_servers_manager_p

struct ServersManager* gs_servers_manager_p

◆ gs_servers_manager_mem

MEM_FLAG gs_servers_manager_mem

◆ gs_config_p

json_t* gs_config_p

◆ gs_schema_version_p

SchemaVersion* gs_schema_version_p

◆ gs_mongo_manager_p

struct MongoClientManager* gs_mongo_manager_p

The documentation for this struct was generated from the following file: