Elements  5.12.0
A C++ base framework for the Euclid Software.
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 
24 #ifndef ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
25 #define ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
26 
27 #include <string>
28 
29 #include "ElementsKernel/Export.h"
30 
32 
33 namespace ElementsServices {
34 namespace DataSync {
35 
40 enum DataHost {
42 };
43 
49 };
50 
57 public:
58  virtual ~UnknownHost() = default;
60  std::runtime_error("I don't know this hosting solution!") {
61  }
62  explicit UnknownHost(const std::string& hostName):
63  std::runtime_error("I don't know this hosting solution: " + hostName) {
64  }
65 };
66 
76 
77 public:
78 
79  virtual ~ConnectionConfiguration() = default;
80 
84  explicit ConnectionConfiguration(const path& configFile);
85 
89  bool overwritingAllowed() const;
90 
91 protected:
92 
93  void parseConfigurationFile(const path& filename);
94 
95  void parseHost(const std::string& name);
96 
97  void parseOverwritingPolicy(const std::string& policy);
98 
99 public:
100 
106  size_t tries;
109 
110 };
111 
112 } // namespace DataSync
113 } // namespace ElementsServices
114 
115 #endif // ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_CONNECTIONCONFIGURATION_H_
116 
defines the macros to be used for explicit export of the symbols
The connection configuration mainly holds:
A class to download test data from a data repository prior to the unit test run.
Definition: DataSync.h:47
Exception raised when a hosting solution is not supported by the tool.
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::Path::Item path
Definition: DataSyncUtils.h:39
OverwritingPolicy
The overwriting policy if the local file already exists.
DataHost
The test data hosting solution.
ELEMENTS_API const std::string & hostName()
Host name.
Definition: System.cpp:285
STL namespace.