X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fprivate%2Fdatabaseconfiguration.hpp;h=b43aeee9c869c1d9713106f0bd6b139de2f0b552;hb=HEAD;hp=fd24a116b01227215d395467852be286d79723f3;hpb=ef2bf51d04aaf01fa0cabdcaf905b23423067662;p=ric-plt%2Fsdl.git diff --git a/include/private/databaseconfiguration.hpp b/include/private/databaseconfiguration.hpp index fd24a11..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. @@ -14,11 +14,17 @@ limitations under the License. */ +/* + * This source code is part of the near-RT RIC (RAN Intelligent Controller) + * platform project (RICP). +*/ + #ifndef SHAREDDATALAYER_DATABASECONFIGURATION_HPP_ #define SHAREDDATALAYER_DATABASECONFIGURATION_HPP_ #include #include +#include #include "private/hostandport.hpp" namespace shareddatalayer @@ -28,19 +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_CLUSTER, + 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 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 boost::optional& addressIndex) const = 0; + virtual std::string getSentinelMasterName(const boost::optional& addressIndex) const = 0; virtual bool isEmpty() const = 0; DatabaseConfiguration(DatabaseConfiguration&&) = delete;