|
BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
|
Main Interface Class to work with the Event Catalogue of the experiment Throws runtime_exception if a critical error occurrs while the constructor Error Codes: -1 - sending command via CURL failed, -401 - unauthorized request, -403 - token invalid or expired, -404 - data not found, -409 - incorrect database request (e.g. More...
#include <EventCatalogue.h>
Public Member Functions | |
| EventCatalogue () | |
| virtual | ~EventCatalogue () |
| vector< unique_ptr< EventInfo > > | GetEventList (vector< unique_ptr< EventCondition > > event_conditions) |
| Function for searching for event metadata in the Event Catalogue using specified conditions. | |
| unique_ptr< EventInfo > | GetEventInfo (string storage_name, string file_path, int event_number) |
| Function tp get metadata of the event stored at the given location. | |
| int | AddEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata) |
| Function to add metadata for the event stored at the given location. | |
| int | AddEventInfo (string json_file_path) |
| Function to add metadata of events to the Event Catalogue using input JSON file path. | |
| int | UpdateEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata) |
| Function to update metadata of the event stored at the given location. | |
| int | DeleteEventInfo (string storage_name, string file_path, int event_number) |
| Function to delete metadata for the event stored at the given location. | |
| int | CheckEventInfo (string storage_name, string file_path, int event_number) |
| Function to check metadata for the event stored at the given location. | |
| int | PrintEventInfo (string storage_name, string file_path, int event_number) |
| Function to print metadata for the event stored at the given location. | |
| int | AddStorageInfo (string storage_name) |
| Function to add storage to the dictionary used by the Event Catalogue. | |
| int | AddSoftwareInfo (string software_version) |
| Function to add software version to the dictionary used by the Event Catalogue. | |
| vector< unique_ptr< EventInfo > > | EventCatalogueRequest (string rest_api_request) |
| Function for searching for event metadata in the Event Catalogue using REST API request as an HTTP(s) string. | |
| int | EventCatalogueChecks (int &file_not_found, vector< unique_ptr< EventInfo > > &event_list) |
| Function to perform a set of specific checks in the Event Catalogue. | |
| int | EventCatalogueStats (int &record_count) |
| Function to collect summary statistics on the Event Catalogue. | |
| void | SetVerbose (int verbose_level=2) |
| Setting Verbose level: 0 - only errors, 1 - normal output, 2 - detailed output, 2- all with debug info. | |
| EventCatalogue () | |
| virtual | ~EventCatalogue () |
| vector< unique_ptr< EventInfo > > | GetEventList (vector< unique_ptr< EventCondition > > event_conditions) |
| Function for searching for event metadata in the Event Catalogue using specified conditions. | |
| unique_ptr< EventInfo > | GetEventInfo (string storage_name, string file_path, int event_number) |
| Function tp get metadata of the event stored at the given location. | |
| int | AddEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata) |
| Function to add metadata for the event stored at the given location. | |
| int | AddEventInfo (string json_file_path) |
| Function to add metadata of events to the Event Catalogue using input JSON file path. | |
| int | UpdateEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata) |
| Function to update metadata of the event stored at the given location. | |
| int | DeleteEventInfo (string storage_name, string file_path, int event_number) |
| Function to delete metadata for the event stored at the given location. | |
| int | CheckEventInfo (string storage_name, string file_path, int event_number) |
| Function to check metadata for the event stored at the given location. | |
| int | PrintEventInfo (string storage_name, string file_path, int event_number) |
| Function to print metadata for the event stored at the given location. | |
| int | AddStorageInfo (string storage_name) |
| Function to add storage to the dictionary used by the Event Catalogue. | |
| int | AddSoftwareInfo (string software_version) |
| Function to add software version to the dictionary used by the Event Catalogue. | |
| vector< unique_ptr< EventInfo > > | EventCatalogueRequest (string rest_api_request) |
| Function for searching for event metadata in the Event Catalogue using REST API request as an HTTP(s) string. | |
| int | EventCatalogueChecks (int &file_not_found, vector< unique_ptr< EventInfo > > &event_list) |
| Function to perform a set of specific checks in the Event Catalogue. | |
| int | EventCatalogueStats (int &record_count) |
| Function to collect summary statistics on the Event Catalogue. | |
| void | SetVerbose (int verbose_level=2) |
| Setting Verbose level: 0 - only errors, 1 - normal output, 2 - detailed output, 2- all with debug info. | |
Private Member Functions | |
| int | PostRequest (string RequestUrl, string json_string, string success_message) |
| int | PostRequest (string RequestUrl, string json_string, string success_message) |
Private Attributes | |
| CURL * | curlInstance |
| string | ServiceUrl |
| string | ServiceAccount |
| int | VerboseLevel = 2 |
violating constraints), -422 - incorrect input request, -500 - internal server error, -503 - service unavaialble, -504 - gateway timeout
Definition at line 97 of file EventCatalogue.h.
| EventCatalogue::EventCatalogue | ( | ) |
Definition at line 70 of file EventCatalogue.cxx.
References curlInstance, EVENT_API_HOST, EVENT_API_NAME, EVENT_API_PASSWORD, EVENT_API_USERNAME, ServiceAccount, ServiceUrl, VerboseLevel, and EventInfo::Version.
|
virtual |
Definition at line 88 of file EventCatalogue.cxx.
References curlInstance.
| EventCatalogue::EventCatalogue | ( | ) |
|
virtual |
| int EventCatalogue::AddEventInfo | ( | string | json_file_path | ) |
| [in] | json_file_path | path of the JSON file containing a set of event metadata to be stored |
Definition at line 143 of file EventCatalogue.cxx.
References PostRequest(), ServiceUrl, and VerboseLevel.
| int EventCatalogue::AddEventInfo | ( | string | json_file_path | ) |
| [in] | json_file_path | path of the JSON file containing a set of event metadata to be stored |
| int EventCatalogue::AddEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number, | ||
| EventInfo | event_metadata ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| [in] | event_metadata | 'EventInfo' object containing event metadata for the event |
Definition at line 110 of file EventCatalogue.cxx.
Referenced by write_emd().
| int EventCatalogue::AddEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number, | ||
| EventInfo | event_metadata ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| [in] | event_metadata | 'EventInfo' object containing event metadata for the event |
| int EventCatalogue::AddSoftwareInfo | ( | string | software_version | ) |
| [in] | software_version | Version of the software, which was used to obtain processed events |
Definition at line 203 of file EventCatalogue.cxx.
References PostRequest(), ServiceUrl, and VerboseLevel.
| int EventCatalogue::AddSoftwareInfo | ( | string | software_version | ) |
| [in] | software_version | Version of the software, which was used to obtain processed events |
| int EventCatalogue::AddStorageInfo | ( | string | storage_name | ) |
| [in] | storage_name | Name of the storage be added to the dictionary |
Definition at line 187 of file EventCatalogue.cxx.
References PostRequest(), ServiceUrl, and VerboseLevel.
| int EventCatalogue::AddStorageInfo | ( | string | storage_name | ) |
| [in] | storage_name | Name of the storage be added to the dictionary |
| int EventCatalogue::CheckEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
Definition at line 173 of file EventCatalogue.cxx.
| int EventCatalogue::CheckEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| int EventCatalogue::DeleteEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
Definition at line 166 of file EventCatalogue.cxx.
| int EventCatalogue::DeleteEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| int EventCatalogue::EventCatalogueChecks | ( | int & | file_not_found, |
| vector< unique_ptr< EventInfo > > & | event_list ) |
| [out] | file_not_found | Number of not found files for existing metadata in the Catalogue |
| [out] | event_list | List of not found files for existing metadata in the Catalogue |
Definition at line 228 of file EventCatalogue.cxx.
| int EventCatalogue::EventCatalogueChecks | ( | int & | file_not_found, |
| vector< unique_ptr< EventInfo > > & | event_list ) |
| [out] | file_not_found | Number of not found files for existing metadata in the Catalogue |
| [out] | event_list | List of not found files for existing metadata in the Catalogue |
| vector< unique_ptr< EventInfo > > EventCatalogue::EventCatalogueRequest | ( | string | rest_api_request | ) |
| [in] | rest_api_request | String HTTP command representing a request using REST API format |
Definition at line 220 of file EventCatalogue.cxx.
| vector< unique_ptr< EventInfo > > EventCatalogue::EventCatalogueRequest | ( | string | rest_api_request | ) |
| [in] | rest_api_request | String HTTP command representing a request using REST API format |
| int EventCatalogue::EventCatalogueStats | ( | int & | record_count | ) |
| [out] | record_count | Number of records in the Event Catalogue |
Definition at line 235 of file EventCatalogue.cxx.
| int EventCatalogue::EventCatalogueStats | ( | int & | record_count | ) |
| [out] | record_count | Number of records in the Event Catalogue |
| unique_ptr< EventInfo > EventCatalogue::GetEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
Definition at line 102 of file EventCatalogue.cxx.
| unique_ptr< EventInfo > EventCatalogue::GetEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| vector< unique_ptr< EventInfo > > EventCatalogue::GetEventList | ( | vector< unique_ptr< EventCondition > > | event_conditions | ) |
| [in] | event_conditions | A set of conditions to specify criteria for event metadata search |
Definition at line 94 of file EventCatalogue.cxx.
| vector< unique_ptr< EventInfo > > EventCatalogue::GetEventList | ( | vector< unique_ptr< EventCondition > > | event_conditions | ) |
| [in] | event_conditions | A set of conditions to specify criteria for event metadata search |
|
private |
Definition at line 242 of file EventCatalogue.cxx.
References curlInstance, GetErrorString(), header_callback(), response_callback(), ServiceAccount, and VerboseLevel.
Referenced by AddEventInfo(), AddSoftwareInfo(), and AddStorageInfo().
|
private |
| int EventCatalogue::PrintEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
Definition at line 180 of file EventCatalogue.cxx.
| int EventCatalogue::PrintEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
|
inline |
| [in] | verbose_level | Verbose level for output information |
Definition at line 215 of file EventCatalogue.h.
References VerboseLevel.
|
inline |
| [in] | verbose_level | Verbose level for output information |
Definition at line 215 of file EventCatalogue.h.
References VerboseLevel.
| int EventCatalogue::UpdateEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number, | ||
| EventInfo | event_metadata ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| [in] | event_metadata | 'EventInfo' object containing event metadata for the event |
Definition at line 159 of file EventCatalogue.cxx.
| int EventCatalogue::UpdateEventInfo | ( | string | storage_name, |
| string | file_path, | ||
| int | event_number, | ||
| EventInfo | event_metadata ) |
| [in] | storage_name | Storage, where the file with the event is located |
| [in] | file_path | Path of the file containing the event |
| [in] | event_number | Number of the event in the file |
| [in] | event_metadata | 'EventInfo' object containing event metadata for the event |
|
private |
Definition at line 218 of file EventCatalogue.h.
Referenced by EventCatalogue(), ~EventCatalogue(), and PostRequest().
|
private |
Definition at line 220 of file EventCatalogue.h.
Referenced by EventCatalogue(), and PostRequest().
|
private |
Definition at line 219 of file EventCatalogue.h.
Referenced by EventCatalogue(), AddEventInfo(), AddSoftwareInfo(), and AddStorageInfo().
|
private |
Definition at line 222 of file EventCatalogue.h.
Referenced by EventCatalogue(), AddEventInfo(), AddSoftwareInfo(), AddStorageInfo(), PostRequest(), and SetVerbose().