X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdatabaseconfigurationimpl.cpp;fp=src%2Fdatabaseconfigurationimpl.cpp;h=4ee548f85142faeb4db4aad8ef34e22682161e49;hb=1c4a605ad92c57118ecb6722bace5501c8918af0;hp=211c53773370da3798ad0fc5a8afe30284947a25;hpb=e94862b3c75c10a1de57ebdb8cf9e9e2567560eb;p=ric-plt%2Fsdl.git diff --git a/src/databaseconfigurationimpl.cpp b/src/databaseconfigurationimpl.cpp index 211c537..4ee548f 100644 --- a/src/databaseconfigurationimpl.cpp +++ b/src/databaseconfigurationimpl.cpp @@ -54,8 +54,10 @@ void DatabaseConfigurationImpl::checkAndApplyDbType(const std::string& type) dbType = DatabaseConfiguration::DbType::REDIS_CLUSTER; else if (type == "redis-sentinel") dbType = DatabaseConfiguration::DbType::REDIS_SENTINEL; - else if (type == "sdl-cluster") - dbType = DatabaseConfiguration::DbType::SDL_CLUSTER; + else if (type == "sdl-standalone-cluster") + dbType = DatabaseConfiguration::DbType::SDL_STANDALONE_CLUSTER; + else if (type == "sdl-sentinel-cluster") + dbType = DatabaseConfiguration::DbType::SDL_SENTINEL_CLUSTER; else throw DatabaseConfiguration::InvalidDbType(type); } @@ -80,6 +82,14 @@ DatabaseConfiguration::Addresses DatabaseConfigurationImpl::getServerAddresses() return serverAddresses; } +DatabaseConfiguration::Addresses DatabaseConfigurationImpl::getServerAddresses(const boost::optional& addressIndex) const +{ + if (addressIndex) + return { HostAndPort(serverAddresses.at(*addressIndex)) }; + + return serverAddresses; +} + DatabaseConfiguration::Addresses DatabaseConfigurationImpl::getDefaultServerAddresses() const { return { HostAndPort(getDefaultHost(), htons(DEFAULT_PORT)) };