diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-10-28 16:29:37 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-10-28 16:29:37 -0400 |
commit | a5a21ef44ef78fdcfa5fb70d9baab5009bc94983 (patch) | |
tree | 65b10dfaaea31d4ff5540097544e6cc850a66418 /cpp/src/IcePatch2Lib/ClientUtil.cpp | |
parent | minor ifdef fix (diff) | |
download | ice-a5a21ef44ef78fdcfa5fb70d9baab5009bc94983.tar.bz2 ice-a5a21ef44ef78fdcfa5fb70d9baab5009bc94983.tar.xz ice-a5a21ef44ef78fdcfa5fb70d9baab5009bc94983.zip |
Fixed ICE-5791: removed deprecated APIs for Ice 3.6
Diffstat (limited to 'cpp/src/IcePatch2Lib/ClientUtil.cpp')
-rw-r--r-- | cpp/src/IcePatch2Lib/ClientUtil.cpp | 103 |
1 files changed, 4 insertions, 99 deletions
diff --git a/cpp/src/IcePatch2Lib/ClientUtil.cpp b/cpp/src/IcePatch2Lib/ClientUtil.cpp index 3c7eee1aeb8..ec8009d90ca 100644 --- a/cpp/src/IcePatch2Lib/ClientUtil.cpp +++ b/cpp/src/IcePatch2Lib/ClientUtil.cpp @@ -150,100 +150,25 @@ namespace string getDataDir(const CommunicatorPtr& communicator, const string& defaultValue) { - const string property = "IcePatch2Client.Directory"; - const string deprecatedProperty = "IcePatch2.Directory"; - - if(communicator->getProperties()->getProperty(property).empty() && - communicator->getProperties()->getProperty(deprecatedProperty).empty()) - { - return defaultValue; - } - - string value = communicator->getProperties()->getProperty(property); - if(value.empty()) - { - value = communicator->getProperties()->getProperty(deprecatedProperty); - ostringstream os; - os << "The property " << deprecatedProperty << " is deprecated, use " << property << " instead."; - communicator->getLogger()->warning(os.str()); - } - assert(!value.empty()); - return value; + return communicator->getProperties()->getPropertyWithDefault("IcePatch2Client.Directory", defaultValue); } int getThorough(const CommunicatorPtr& communicator, int defaultValue) { - const string property = "IcePatch2Client.Thorough"; - const string deprecatedProperty = "IcePatch2.Thorough"; - - if(communicator->getProperties()->getProperty(property).empty() && - communicator->getProperties()->getProperty(deprecatedProperty).empty()) - { - return defaultValue; - } - - if(!communicator->getProperties()->getProperty(property).empty()) - { - return communicator->getProperties()->getPropertyAsInt(property); - } - else - { - ostringstream os; - os << "The property " << deprecatedProperty << " is deprecated, use " << property << " instead."; - communicator->getLogger()->warning(os.str()); - return communicator->getProperties()->getPropertyAsInt(deprecatedProperty); - } + return communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2Client.Thorough", defaultValue); } int getChunkSize(const CommunicatorPtr& communicator, int defaultValue) { - const string property = "IcePatch2Client.ChunkSize"; - const string deprecatedProperty = "IcePatch2.ChunkSize"; - - if(communicator->getProperties()->getProperty(property).empty() && - communicator->getProperties()->getProperty(deprecatedProperty).empty()) - { - return defaultValue; - } - - if(!communicator->getProperties()->getProperty(property).empty()) - { - return communicator->getProperties()->getPropertyAsInt(property); - } - else - { - ostringstream os; - os << "The property " << deprecatedProperty << " is deprecated, use " << property << " instead."; - communicator->getLogger()->warning(os.str()); - return communicator->getProperties()->getPropertyAsInt(deprecatedProperty); - } + return communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2Client.ChunkSize", defaultValue); } int getRemove(const CommunicatorPtr& communicator, int defaultValue) { - const string property = "IcePatch2Client.Remove"; - const string deprecatedProperty = "IcePatch2.Remove"; - - if(communicator->getProperties()->getProperty(property).empty() && - communicator->getProperties()->getProperty(deprecatedProperty).empty()) - { - return defaultValue; - } - - if(!communicator->getProperties()->getProperty(property).empty()) - { - return communicator->getProperties()->getPropertyAsInt(property); - } - else - { - ostringstream os; - os << "The property " << deprecatedProperty << " is deprecated, use " << property << " instead."; - communicator->getLogger()->warning(os.str()); - return communicator->getProperties()->getPropertyAsInt(deprecatedProperty); - } + return communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2Client.Remove", defaultValue); } } @@ -260,26 +185,6 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe const PropertiesPtr properties = communicator->getProperties(); const char* clientProxyProperty = "IcePatch2Client.Proxy"; std::string clientProxy = properties->getProperty(clientProxyProperty); - if(clientProxy.empty()) - { - const char* endpointsProperty = "IcePatch2.Endpoints"; - string endpoints = properties->getProperty(endpointsProperty); - if(endpoints.empty()) - { - ostringstream os; - os << "No proxy to IcePatch2 server. Please set `" << clientProxyProperty - << "' or `" << endpointsProperty << "'."; - throw os.str(); - } - ostringstream os; - os << "The property " << endpointsProperty << " is deprecated, use " << clientProxyProperty << " instead."; - communicator->getLogger()->warning(os.str()); - Identity id; - id.category = properties->getPropertyWithDefault("IcePatch2.InstanceName", "IcePatch2"); - id.name = "server"; - - clientProxy = "\"" + communicator->identityToString(id) + "\" :" + endpoints; - } ObjectPrx serverBase = communicator->stringToProxy(clientProxy); FileServerPrx server = FileServerPrx::checkedCast(serverBase); |