Elements  5.8
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 
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_
Export.h
defines the macros to be used for explicit export of the symbols
std::string
STL class.
ElementsServices::DataSync::OVERWRITE
@ OVERWRITE
Definition: ConnectionConfiguration.h:43
ElementsServices::DataSync::UnknownHost::UnknownHost
UnknownHost(std::string hostName)
Definition: ConnectionConfiguration.h:56
ElementsServices::DataSync::UnknownHost::UnknownHost
UnknownHost()
Definition: ConnectionConfiguration.h:53
ElementsServices::DataSync::DataHost
DataHost
The test data hosting solution.
Definition: ConnectionConfiguration.h:35
ElementsServices::DataSync::OverwritingPolicy
OverwritingPolicy
The overwriting policy if the local file already exists.
Definition: ConnectionConfiguration.h:42
ElementsServices::DataSync::ConnectionConfiguration::distantRoot
path distantRoot
Definition: ConnectionConfiguration.h:100
ElementsServices::DataSync::path
boost::filesystem::path path
Definition: DataSyncUtils.h:33
ElementsServices::DataSync::IRODS
@ IRODS
Definition: ConnectionConfiguration.h:36
ElementsServices::DataSync::ConnectionConfiguration::overwritingPolicy
OverwritingPolicy overwritingPolicy
Definition: ConnectionConfiguration.h:98
ElementsServices::DataSync::ConnectionConfiguration::password
std::string password
Definition: ConnectionConfiguration.h:97
ELEMENTS_API
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition: Export.h:74
Elements::System::hostName
const ELEMENTS_API std::string & hostName()
Host name.
Definition: System.cpp:285
ElementsServices::DataSync::ConnectionConfiguration::localRoot
path localRoot
Definition: ConnectionConfiguration.h:101
ElementsServices::DataSync::ConnectionConfiguration::host
DataHost host
Definition: ConnectionConfiguration.h:94
ElementsServices::DataSync::DataSync
A class to download test data from a data repository prior to the unit test run.
Definition: DataSync.h:40
ElementsServices
Definition: ConnectionConfiguration.h:28
ElementsServices::DataSync::ConnectionConfiguration::user
std::string user
Definition: ConnectionConfiguration.h:96
std::runtime_error
STL class.
ElementsServices::DataSync::ConnectionConfiguration::tries
size_t tries
Definition: ConnectionConfiguration.h:99
ElementsServices::DataSync::UnknownHost
Exception raised when a hosting solution is not supported by the tool.
Definition: ConnectionConfiguration.h:50
ElementsServices::DataSync::ABORT
@ ABORT
Definition: ConnectionConfiguration.h:43
DataSyncUtils.h
std
STL namespace.
ElementsServices::DataSync::ConnectionConfiguration::hostUrl
std::string hostUrl
Definition: ConnectionConfiguration.h:95
ElementsServices::DataSync::ConnectionConfiguration
The connection configuration mainly holds:
Definition: ConnectionConfiguration.h:68
ElementsServices::DataSync::WEBDAV
@ WEBDAV
Definition: ConnectionConfiguration.h:36