blob: 64b3c2198ccfb83a1fd8ad5b0a5dcb093d431571 [file] [log] [blame]
Rolf Badorekef2bf512019-08-20 11:17:15 +03001/*
2 Copyright (c) 2018-2019 Nokia.
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
17#ifndef SHAREDDATALAYER_DATABASECONFIGURATIONIMPL_HPP_
18#define SHAREDDATALAYER_DATABASECONFIGURATIONIMPL_HPP_
19
20#include "private/databaseconfiguration.hpp"
21
22namespace shareddatalayer
23{
24 class DatabaseConfigurationImpl: public DatabaseConfiguration
25 {
26 public:
27 DatabaseConfigurationImpl();
28
29 ~DatabaseConfigurationImpl() override;
30
31 void checkAndApplyDbType(const std::string& type) override;
32
33 void checkAndApplyServerAddress(const std::string& address) override;
34
Rolf Badorek2dcf9402019-10-01 18:33:58 +030035 void checkAndApplySentinelAddress(const std::string& address) override;
36
37 void checkAndApplySentinelMasterName(const std::string& name) override;
38
Rolf Badorekef2bf512019-08-20 11:17:15 +030039 DatabaseConfiguration::DbType getDbType() const override;
40
41 DatabaseConfigurationImpl::Addresses getServerAddresses() const override;
42
43 DatabaseConfiguration::Addresses getDefaultServerAddresses() const override;
44
Rolf Badorek2dcf9402019-10-01 18:33:58 +030045 boost::optional<HostAndPort> getSentinelAddress() const override;
46
47 std::string getSentinelMasterName() const override;
48
Rolf Badorekef2bf512019-08-20 11:17:15 +030049 bool isEmpty() const override;
50
51 private:
52 DbType dbType;
53 Addresses serverAddresses;
Rolf Badorek2dcf9402019-10-01 18:33:58 +030054 boost::optional<HostAndPort> sentinelAddress;
55 std::string sentinelMasterName;
Rolf Badorekef2bf512019-08-20 11:17:15 +030056 };
57}
58
59#endif