Elements  5.8
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ConnectionConfiguration.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2020 Euclid Science Ground Segment
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation; either version 3.0 of the License, or (at your option)
7  * any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
20 #define ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
21 
22 #include <string>
23 
24 #include "ElementsKernel/Export.h"
25 
27 
28 namespace ElementsServices {
29 namespace DataSync {
30 
35 enum DataHost {
37 };
38 
44 };
45 
51 public:
52  virtual ~UnknownHost() = default;
54  std::runtime_error("I don't know this hosting solution!") {
55  }
57  std::runtime_error("I don't know this hosting solution: " + hostName) {
58  }
59 };
60 
69 
70 public:
71 
72  virtual ~ConnectionConfiguration() = default;
73 
77  explicit ConnectionConfiguration(path configFile);
78 
82  bool overwritingAllowed() const;
83 
84 protected:
85 
86  void parseConfigurationFile(path filename);
87 
88  void parseHost(std::string name);
89 
90  void parseOverwritingPolicy(std::string policy);
91 
92 public:
93 
99  size_t tries;
102 
103 };
104 
105 } // namespace DataSync
106 } // namespace ElementsServices
107 
108 #endif // ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
DataHost
The test data hosting solution.
STL class.
defines the macros to be used for explicit export of the symbols
A class to download test data from a data repository prior to the unit test run.
Definition: DataSync.h:40
boost::filesystem::path path
Definition: DataSyncUtils.h:33
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Exception raised when a hosting solution is not supported by the tool.
OverwritingPolicy
The overwriting policy if the local file already exists.
The connection configuration mainly holds:
ELEMENTS_API const std::string & hostName()
Host name.
Definition: System.cpp:285