X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fprivate%2Fdatabaseconfiguration.hpp;h=b43aeee9c869c1d9713106f0bd6b139de2f0b552;hb=5bdca62d89d430f607310370fe1391bd1d1bd21a;hp=7f4e7bd274deaf2ddb906ae97686a549d7773dfe;hpb=a0745d294dcd72f7d78ea4c3accd3b477dd668a5;p=ric-plt%2Fsdl.git diff --git a/include/private/databaseconfiguration.hpp b/include/private/databaseconfiguration.hpp index 7f4e7bd..b43aeee 100644 --- a/include/private/databaseconfiguration.hpp +++ b/include/private/databaseconfiguration.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2018-2019 Nokia. + Copyright (c) 2018-2022 Nokia. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -34,24 +34,29 @@ namespace shareddatalayer public: class InvalidDbType; using Addresses = std::vector; + using SentinelPorts = std::vector; + using SentinelMasterNames = std::vector; enum class DbType { UNKNOWN = 0, REDIS_STANDALONE, REDIS_CLUSTER, - REDIS_SENTINEL + REDIS_SENTINEL, + SDL_STANDALONE_CLUSTER, + SDL_SENTINEL_CLUSTER }; virtual ~DatabaseConfiguration() = default; virtual void checkAndApplyDbType(const std::string& type) = 0; virtual void checkAndApplyServerAddress(const std::string& address) = 0; - virtual void checkAndApplySentinelAddress(const std::string& address) = 0; - virtual void checkAndApplySentinelMasterName(const std::string& name) = 0; + virtual void checkAndApplySentinelPorts(const std::string& sentinelPortsEnvStr) = 0; + virtual void checkAndApplySentinelMasterNames(const std::string& sentinelMasterNamesEnvStr) = 0; virtual DatabaseConfiguration::DbType getDbType() const = 0; virtual DatabaseConfiguration::Addresses getServerAddresses() const = 0; + virtual DatabaseConfiguration::Addresses getServerAddresses(const boost::optional& addressIndex) const = 0; virtual DatabaseConfiguration::Addresses getDefaultServerAddresses() const = 0; - virtual boost::optional getSentinelAddress() const = 0; // Optional return value, because empty HostAndPort can't be created. - virtual std::string getSentinelMasterName() const = 0; + virtual boost::optional getSentinelAddress(const boost::optional& addressIndex) const = 0; + virtual std::string getSentinelMasterName(const boost::optional& addressIndex) const = 0; virtual bool isEmpty() const = 0; DatabaseConfiguration(DatabaseConfiguration&&) = delete;