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.
providers_state_table.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 /*
22  * providers_state_table.h
23  *
24  * Created on: 6 May 2016
25  * Author: tyrrells
26  */
27 
28 #ifndef SRC_NETWORK_SRC_PROVIDERS_STATE_TABLE_H_
29 #define SRC_NETWORK_SRC_PROVIDERS_STATE_TABLE_H_
30 
32 #include "json_tools.h"
33 #include "json_util.h"
34 #include "grassroots_server.h"
35 
36 
49 typedef struct ProvidersStateTable
50 {
52  json_t *pst_values_p;
54 
55 
56 
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 
77 
78 
86 
87 
103 
104 GRASSROOTS_SERVICE_MANAGER_API ProvidersStateTable *GetInitialisedProvidersStateTableForSingleService (const json_t *req_p, const char * const server_uri_s, const char * const service_s);
120 
121 
131 GRASSROOTS_SERVICE_MANAGER_API bool AddToProvidersStateTable (ProvidersStateTable *providers_p, const char *server_uri_s, const char *service_s);
132 
133 
143 GRASSROOTS_SERVICE_MANAGER_API bool IsServiceInProvidersStateTable (const ProvidersStateTable *providers_p, const char *server_uri_s, const char *service_s);
144 
145 
154 
155 
172 
173 
174 
185 
186 
200 
201 
212 GRASSROOTS_SERVICE_MANAGER_API bool InitProvidersStateTableFromRequest (ProvidersStateTable * const providers_p, const json_t * const req_p);
213 
214 
223 
224 
240 GRASSROOTS_SERVICE_MANAGER_API bool ReinitProvidersStateTable (ProvidersStateTable *providers_p, const json_t * const req_p, const char *server_uri_s, const char *service_name_s);
241 
242 
243 #ifdef __cplusplus
244 }
245 #endif
246 
247 
248 #endif /* SRC_NETWORK_SRC_PROVIDERS_STATE_TABLE_H_ */
SchemaVersion
This is a datatype to store the versioning details for the Grassroots JSON schema that is being used.
Definition: schema_version.h:44
ProvidersStateTable::ReinitProvidersStateTable
bool ReinitProvidersStateTable(ProvidersStateTable *providers_p, const json_t *const req_p, const char *server_uri_s, const char *service_name_s)
Clear a given ProvidersStateTable and add the details from a json request and a given Server-Service ...
grassroots_service_manager_library.h
ProvidersStateTable::GetProvidersStateTableAsJSON
json_t * GetProvidersStateTableAsJSON(const ProvidersStateTable *providers_p)
Get the json representation of a ProvidersStateTable.
grassroots_server.h
ProvidersStateTable::ClearProvidersStateTable
bool ClearProvidersStateTable(ProvidersStateTable *providers_p)
Clear all of the servers and services that are being tracked within a ProvidersStateTable.
ProvidersStateTable::IsServiceInProvidersStateTable
bool IsServiceInProvidersStateTable(const ProvidersStateTable *providers_p, const char *server_uri_s, const char *service_s)
Check whether a given server and service are in a ProvidersStateTable.
LinkedList
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
ProvidersStateTable
This is a datatype that is used to keep track of which servers and services have already been process...
Definition: providers_state_table.h:49
ProvidersStateTable::AddProvidersStateTableToRequest
bool AddProvidersStateTableToRequest(const ProvidersStateTable *providers_p, json_t *req_p)
Add the details to a json request to get the list of all available Services on a Server making sure n...
GrassrootsServer
Definition: grassroots_server.h:45
json_tools.h
ProvidersStateTable::GetInitialisedProvidersStateTableForSingleService
ProvidersStateTable * GetInitialisedProvidersStateTableForSingleService(const json_t *req_p, const char *const server_uri_s, const char *const service_s)
Create a new ProvidersStateTable and populate it with any details within a specified json request and...
User
A datatype to store user credentials.
Definition: user_details.h:40
ProvidersStateTable::AddServicesListToProvidersStateTable
bool AddServicesListToProvidersStateTable(ProvidersStateTable *providers_p, LinkedList *services_p, GrassrootsServer *grassroots_p)
Add a list of Services for this Server to a ProvidersStateTable.
ProvidersStateTable::AllocateProvidersStateTable
ProvidersStateTable * AllocateProvidersStateTable(const json_t *req_p)
Allocate a ProvidersStateTable and populate it with any details within a specified json request.
ProvidersStateTable::GetInitialisedProvidersStateTable
ProvidersStateTable * GetInitialisedProvidersStateTable(const json_t *req_p, LinkedList *services_p, GrassrootsServer *grassroots_p)
Create a new ProvidersStateTable and populate it with any details within a specified json request and...
ProvidersStateTable::InitProvidersStateTableFromRequest
bool InitProvidersStateTableFromRequest(ProvidersStateTable *const providers_p, const json_t *const req_p)
Add the details from a json request to a given ProvidersStateTable.
GRASSROOTS_SERVICE_MANAGER_API
#define GRASSROOTS_SERVICE_MANAGER_API
Definition: grassroots_service_manager_library.h:46
json_util.h
ProvidersStateTable::GetAvailableServicesRequestForAllProviders
json_t * GetAvailableServicesRequestForAllProviders(const ProvidersStateTable *providers_p, User *user_p, const SchemaVersion *const sv_p)
Create a json request that to get the list of all available Services making sure not to duplicate any...
ProvidersStateTable::AddToProvidersStateTable
bool AddToProvidersStateTable(ProvidersStateTable *providers_p, const char *server_uri_s, const char *service_s)
Add a server and service to a ProvidersStateTable.
ProvidersStateTable::FreeProvidersStateTable
void FreeProvidersStateTable(ProvidersStateTable *providers_p)
Deallocate a ProvidersStateTable.