Skip to content

Commit

Permalink
Replace many getProperty with getIceProperty (#3100)
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Nov 8, 2024
1 parent 34ce55c commit f2b887b
Show file tree
Hide file tree
Showing 143 changed files with 797 additions and 978 deletions.
2 changes: 1 addition & 1 deletion cpp/src/Ice/Properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Ice::Properties::parseLine(string_view line, const StringConverterPtr& converter
void
Ice::Properties::loadConfig()
{
string value = getProperty("Ice.Config");
string value = getIceProperty("Ice.Config");
if (value.empty() || value == "1")
{
#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/SSL/TrustManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ using namespace Ice::SSL;
TrustManager::TrustManager(const IceInternal::InstancePtr& instance) : _instance(instance)
{
Ice::PropertiesPtr properties = _instance->initializationData().properties;
_traceLevel = properties->getPropertyAsInt("IceSSL.Trace.Security");
_traceLevel = properties->getIcePropertyAsInt("IceSSL.Trace.Security");
string key;
try
{
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/IceBT/StreamSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ IceBT::StreamSocket::init(SOCKET fd)
{
IceInternal::setBlock(fd, false);

int32_t rcvSize = _instance->properties()->getPropertyAsInt("IceBT.RcvSize");
int32_t sndSize = _instance->properties()->getPropertyAsInt("IceBT.SndSize");
int32_t rcvSize = _instance->properties()->getIcePropertyAsInt("IceBT.RcvSize");
int32_t sndSize = _instance->properties()->getIcePropertyAsInt("IceBT.SndSize");

setBufferSize(fd, rcvSize, sndSize);
}
16 changes: 8 additions & 8 deletions cpp/src/IceBox/ServiceManagerI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
//
Ice::CommunicatorPtr communicator;

if (_communicator->getProperties()->getPropertyAsInt("IceBox.UseSharedCommunicator." + service) > 0)
if (_communicator->getProperties()->getIcePropertyAsInt("IceBox.UseSharedCommunicator." + service) > 0)
{
assert(_sharedCommunicator);
communicator = _sharedCommunicator;
Expand Down Expand Up @@ -558,18 +558,18 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
// Clone the logger to assign a new prefix. If one of the built-in loggers is configured
// don't set any logger.
//
if (initData.properties->getProperty("Ice.LogFile").empty()
if (initData.properties->getIceProperty("Ice.LogFile").empty()
#ifndef _WIN32
&& initData.properties->getPropertyAsInt("Ice.UseSyslog") <= 0 &&
initData.properties->getPropertyAsInt("Ice.UseSystemdJournal") <= 0
&& initData.properties->getIcePropertyAsInt("Ice.UseSyslog") <= 0 &&
initData.properties->getIcePropertyAsInt("Ice.UseSystemdJournal") <= 0
#endif
)
{
//
// When _logger is a LoggerAdminLogger, cloneWithPrefix returns a clone of the
// underlying local logger, not of the LoggerAdminLogger itself
//
initData.logger = _logger->cloneWithPrefix(initData.properties->getProperty("Ice.ProgramName"));
initData.logger = _logger->cloneWithPrefix(initData.properties->getIceProperty("Ice.ProgramName"));
}

//
Expand Down Expand Up @@ -855,7 +855,7 @@ IceBox::ServiceManagerI::createServiceProperties(const string& service)
// NOTE: We always enable the "IceStorm" prefix as there's currently no way to distinguish it.
PropertiesPtr properties = make_shared<Properties>(vector<string>{"IceStorm"});
PropertiesPtr communicatorProperties = _communicator->getProperties();
if (communicatorProperties->getPropertyAsInt("IceBox.InheritProperties") > 0)
if (communicatorProperties->getIcePropertyAsInt("IceBox.InheritProperties") > 0)
{
for (const auto& p : communicatorProperties->getPropertiesForPrefix(""))
{
Expand All @@ -867,7 +867,7 @@ IceBox::ServiceManagerI::createServiceProperties(const string& service)
}
}

string programName = communicatorProperties->getProperty("Ice.ProgramName");
string programName = communicatorProperties->getIceProperty("Ice.ProgramName");
if (programName.empty())
{
properties->setProperty("Ice.ProgramName", service);
Expand Down Expand Up @@ -922,7 +922,7 @@ IceBox::ServiceManagerI::destroyServiceCommunicator(const string& service, const
bool
IceBox::ServiceManagerI::configureAdmin(const PropertiesPtr& properties, const string& prefix)
{
if (_adminEnabled && properties->getProperty("Ice.Admin.Enabled").empty())
if (_adminEnabled && properties->getIceProperty("Ice.Admin.Enabled").empty())
{
StringSeq facetNames;
for (set<string>::const_iterator p = _adminFacetFilter.begin(); p != _adminFacetFilter.end(); ++p)
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/IceDiscovery/PluginI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ PluginI::initialize()
lookupEndpoints = lookup.str();
}

if (properties->getProperty("IceDiscovery.Reply.Endpoints").empty())
if (properties->getIceProperty("IceDiscovery.Reply.Endpoints").empty())
{
properties->setProperty("IceDiscovery.Reply.Endpoints", "udp -h " + (intf.empty() ? "*" : "\"" + intf + "\""));
}

if (properties->getProperty("IceDiscovery.Locator.Endpoints").empty())
if (properties->getIceProperty("IceDiscovery.Locator.Endpoints").empty())
{
properties->setProperty("IceDiscovery.Locator.AdapterId", Ice::generateUUID());
}
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/IceStorm/Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ run(const shared_ptr<Ice::Communicator>& communicator, const Ice::StringSeq& arg
}
}

string managerProxy = properties->getProperty("IceStormAdmin.TopicManager.Default");
string managerProxy = properties->getIceProperty("IceStormAdmin.TopicManager.Default");
if (!managerProxy.empty())
{
defaultManager = IceStorm::TopicManagerPrx(communicator, managerProxy);
Expand All @@ -155,8 +155,8 @@ run(const shared_ptr<Ice::Communicator>& communicator, const Ice::StringSeq& arg

if (!defaultManager)
{
string host = properties->getProperty("IceStormAdmin.Host");
string port = properties->getProperty("IceStormAdmin.Port");
string host = properties->getIceProperty("IceStormAdmin.Host");
string port = properties->getIceProperty("IceStormAdmin.Port");

const int timeout = 3000; // 3s connection timeout.
ostringstream os;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/iceserviceinstall/ServiceInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ IceServiceInstaller::IceServiceInstaller(int serviceType, const string& configFi
{
throw logic_error("Ice.Default.Locator must be set in " + _configFile);
}
_nodeName = _serviceProperties->getProperty("IceGrid.Node.Name");
_nodeName = _serviceProperties->getIceProperty("IceGrid.Node.Name");
if (_nodeName == "")
{
throw logic_error("IceGrid.Node.Name must be set in " + _configFile);
Expand Down Expand Up @@ -132,7 +132,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
throw logic_error("The IceGrid registry service can't depend on itself");
}

string registryDataDir = fixDirSeparator(_serviceProperties->getProperty("IceGrid.Registry.LMDB.Path"));
string registryDataDir = fixDirSeparator(_serviceProperties->getIceProperty("IceGrid.Registry.LMDB.Path"));
if (registryDataDir == "")
{
throw logic_error("IceGrid.Registry.LMDB.Path must be set in " + _configFile);
Expand All @@ -150,7 +150,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
}
else if (_serviceType == icegridnode)
{
string nodeDataDir = fixDirSeparator(_serviceProperties->getProperty("IceGrid.Node.Data"));
string nodeDataDir = fixDirSeparator(_serviceProperties->getIceProperty("IceGrid.Node.Data"));
if (nodeDataDir == "")
{
throw logic_error("IceGrid.Node.Data must be set in " + _configFile);
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/Ice/adapterDeactivation/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ allTests(Test::TestHelper* helper)
TestIntfPrx obj(communicator, "test:" + helper->getTestEndpoint());

{
if (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "wss")
{
cout << "creating/destroying/recreating object adapter... " << flush;
ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/admin/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ allTests(Test::TestHelper* helper)

RemoteCommunicatorFactoryPrx factory(communicator, "factory:" + helper->getTestEndpoint() + " -t 10000");

string defaultHost = communicator->getProperties()->getProperty("Ice.Default.Host");
string defaultHost = communicator->getProperties()->getIceProperty("Ice.Default.Host");

cout << "testing process facet... " << flush;
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/ami/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void
allTests(TestHelper* helper, bool collocated)
{
CommunicatorPtr communicator = helper->communicator();
const string protocol = communicator->getProperties()->getProperty("Ice.Default.Protocol");
const string protocol = communicator->getProperties()->getIceProperty("Ice.Default.Protocol");

TestIntfPrx p(communicator, "test:" + helper->getTestEndpoint());
TestIntfControllerPrx testController(communicator, "testController:" + helper->getTestEndpoint(1));
Expand Down
18 changes: 9 additions & 9 deletions cpp/test/Ice/background/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ allTests(TestHelper* helper)
}
cout << "ok" << endl;

const bool ws = communicator->getProperties()->getProperty("Ice.Default.Protocol") == "test-ws";
const bool wss = communicator->getProperties()->getProperty("Ice.Default.Protocol") == "test-wss";
const bool ws = communicator->getProperties()->getIceProperty("Ice.Default.Protocol") == "test-ws";
const bool wss = communicator->getProperties()->getIceProperty("Ice.Default.Protocol") == "test-wss";
if (!ws && !wss)
{
cout << "testing buffered transport... " << flush;
Expand Down Expand Up @@ -630,8 +630,8 @@ validationTests(
configuration->readException(0);
}

if (background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-wss")
if (background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-wss")
{
try
{
Expand Down Expand Up @@ -728,8 +728,8 @@ validationTests(
f2.get();

#if defined(ICE_USE_IOCP) || defined(ICE_USE_CFSTREAM)
if (background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-wss")
if (background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-wss")
{
#endif
try
Expand Down Expand Up @@ -951,8 +951,8 @@ readWriteTests(
configuration->readReady(true);

#if defined(ICE_USE_IOCP) || defined(ICE_USE_CFSTREAM)
if (background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-wss")
if (background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-ssl" &&
background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-wss")
{
#endif
try
Expand Down Expand Up @@ -1201,7 +1201,7 @@ readWriteTests(
}

#if defined(ICE_USE_IOCP) || defined(ICE_USE_CFSTREAM)
if (background->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "test-ssl")
if (background->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "test-ssl")
{
#endif
try
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/binding/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ allTests(Test::TestHelper* helper)
}
cout << "ok" << endl;

if (communicator->getProperties()->getProperty("Ice.Default.Protocol") == "ssl")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") == "ssl")
{
cout << "testing unsecure vs. secure endpoints... " << flush;
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/binding/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ optional<RemoteObjectAdapterPrx>
RemoteCommunicatorI::createObjectAdapter(string name, string endpts, const Current& current)
{
CommunicatorPtr com = current.adapter->getCommunicator();
const string defaultProtocol = com->getProperties()->getProperty("Ice.Default.Protocol");
const string defaultProtocol = com->getProperties()->getIceProperty("Ice.Default.Protocol");
int retry = 5;
while (true)
{
Expand Down
8 changes: 4 additions & 4 deletions cpp/test/Ice/exceptions/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ThrowerPrx
allTests(Test::TestHelper* helper)
{
Ice::CommunicatorPtr communicator = helper->communicator();
const string protocol = communicator->getProperties()->getProperty("Ice.Default.Protocol");
const string protocol = communicator->getProperties()->getIceProperty("Ice.Default.Protocol");

cout << "testing ice_print()/what()... " << flush;
{
Expand Down Expand Up @@ -126,7 +126,7 @@ allTests(Test::TestHelper* helper)
string localOAEndpoint;
{
ostringstream ostr;
if (communicator->getProperties()->getProperty("Ice.Default.Protocol") == "bt")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") == "bt")
{
ostr << "default -a *";
}
Expand All @@ -137,8 +137,8 @@ allTests(Test::TestHelper* helper)
localOAEndpoint = ostr.str();
}

if (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "wss")
{
cout << "testing object adapter registration exceptions... " << flush;
{
Expand Down
18 changes: 9 additions & 9 deletions cpp/test/Ice/facets/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ allTests(Test::TestHelper* helper)
CommunicatorPtr communicator = helper->communicator();

cout << "testing Ice.Admin.Facets property... " << flush;
test(communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets").empty());
test(communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets").empty());
communicator->getProperties()->setProperty("Ice.Admin.Facets", "foobar");
StringSeq facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets");
StringSeq facetFilter = communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets");
test(facetFilter.size() == 1 && facetFilter[0] == "foobar");
communicator->getProperties()->setProperty("Ice.Admin.Facets", "foo\\'bar");
facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets");
facetFilter = communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets");
test(facetFilter.size() == 1 && facetFilter[0] == "foo'bar");
communicator->getProperties()->setProperty("Ice.Admin.Facets", "'foo bar' toto 'titi'");
facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets");
facetFilter = communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets");
test(
facetFilter.size() == 3 && facetFilter[0] == "foo bar" && facetFilter[1] == "toto" && facetFilter[2] == "titi");
communicator->getProperties()->setProperty("Ice.Admin.Facets", "'foo bar\\' toto' 'titi'");
facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets");
facetFilter = communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets");
test(facetFilter.size() == 2 && facetFilter[0] == "foo bar' toto" && facetFilter[1] == "titi");
// communicator->getProperties()->setProperty("Ice.Admin.Facets", "'foo bar' 'toto titi");
// facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets");
// facetFilter = communicator->getProperties()->getIcePropertyAsList("Ice.Admin.Facets");
// test(facetFilter.size() == 0);
communicator->getProperties()->setProperty("Ice.Admin.Facets", "");
cout << "ok" << endl;
Expand All @@ -44,7 +44,7 @@ allTests(Test::TestHelper* helper)
string localOAEndpoint;
{
ostringstream ostr;
if (communicator->getProperties()->getProperty("Ice.Default.Protocol") == "bt")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") == "bt")
{
ostr << "default -a *";
}
Expand All @@ -55,8 +55,8 @@ allTests(Test::TestHelper* helper)
localOAEndpoint = ostr.str();
}
communicator->getProperties()->setProperty("FacetExceptionTestAdapter.Endpoints", localOAEndpoint);
if (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "wss")
{
ObjectAdapterPtr adapter = communicator->createObjectAdapter("FacetExceptionTestAdapter");
ObjectPtr obj = std::make_shared<EmptyI>();
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/Ice/info/AllTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ allTests(Test::TestHelper* helper)
}
cout << "ok" << endl;

string defaultHost = communicator->getProperties()->getProperty("Ice.Default.Host");
if (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")
string defaultHost = communicator->getProperties()->getIceProperty("Ice.Default.Host");
if (communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getIceProperty("Ice.Default.Protocol") != "wss")
{
cout << "test object adapter endpoint information... " << flush;
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/logger/Client1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Client1::run(int argc, char** argv)
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->load("config.client");
properties->setProperty("Ice.LogFile", "log.txt");
const string programName = properties->getProperty("Ice.ProgramName");
const string programName = properties->getIceProperty("Ice.ProgramName");

Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getLogger()->trace("info", "XXX");
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/Ice/objects/TestI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ InitialI::setCycle(RecursivePtr r, const Current&)
bool
InitialI::acceptsClassCycles(const Current& c)
{
return c.adapter->getCommunicator()->getProperties()->getPropertyAsInt("Ice.AcceptClassCycles") > 0;
return c.adapter->getCommunicator()->getProperties()->getIcePropertyAsInt("Ice.AcceptClassCycles") > 0;
}

InitialI::GetMBMarshaledResult
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/Ice/operations/BatchOneways.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ batchOneways(const MyClassPrx& p)
}

if (batch->ice_getConnection() &&
p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt")
p->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "bt")
{
MyClassPrx batch1 = p->ice_batchOneway();
MyClassPrx batch2 = p->ice_batchOneway();
Expand Down Expand Up @@ -131,7 +131,7 @@ batchOneways(const MyClassPrx& p)
}

if (batch->ice_getConnection() &&
p->ice_getCommunicator()->getProperties()->getProperty("Ice.Default.Protocol") != "bt")
p->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Default.Protocol") != "bt")
{
InitializationData initData;
initData.properties = p->ice_getCommunicator()->getProperties()->clone();
Expand Down Expand Up @@ -181,7 +181,7 @@ batchOneways(const MyClassPrx& p)
}

if (supportsCompress && batch->ice_getConnection() &&
p->ice_getCommunicator()->getProperties()->getProperty("Ice.Override.Compress") == "")
p->ice_getCommunicator()->getProperties()->getIceProperty("Ice.Override.Compress") == "")
{
MyClassPrx prx = batch->ice_fixed(batch->ice_getConnection())->ice_batchOneway();

Expand Down
Loading

0 comments on commit f2b887b

Please sign in to comment.