summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-05-25 14:02:49 +0000
committerTed Ross <tross@apache.org>2010-05-25 14:02:49 +0000
commit20def4fc6769f8ade4cf5b341c40249745ff95e2 (patch)
tree11fcc54c98ba911cd9d9dd933244cb9d9626b5d5 /cpp/src
parent708b53fae2a61e608d4f7329c4ae81a7a0556dc5 (diff)
downloadqpid-python-20def4fc6769f8ade4cf5b341c40249745ff95e2.tar.gz
Replaced the earlier-removed init function (in ManagementAgent.h) that uses
ConnectionSettings. Created a ConnectionSettings in the qpid::management name space that mirrors that from the qpid::client namespace. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@948046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/CMakeLists.txt1
-rw-r--r--cpp/src/Makefile.am2
-rw-r--r--cpp/src/qpid/agent/ManagementAgentImpl.cpp25
-rw-r--r--cpp/src/qpid/agent/ManagementAgentImpl.h2
-rw-r--r--cpp/src/qpid/management/ConnectionSettings.cpp40
5 files changed, 66 insertions, 4 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
index aa40fd7a2e..70835746fb 100644
--- a/cpp/src/CMakeLists.txt
+++ b/cpp/src/CMakeLists.txt
@@ -616,6 +616,7 @@ set (qpidcommon_SOURCES
qpid/log/Selector.cpp
qpid/log/Statement.cpp
qpid/management/Buffer.cpp
+ qpid/management/ConnectionSettings.cpp
qpid/management/Mutex.cpp
qpid/management/Manageable.cpp
qpid/management/ManagementObject.cpp
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am
index 15a0eb448a..fbce21d579 100644
--- a/cpp/src/Makefile.am
+++ b/cpp/src/Makefile.am
@@ -422,6 +422,7 @@ libqpidcommon_la_SOURCES += \
qpid/log/Selector.cpp \
qpid/log/Statement.cpp \
qpid/management/Buffer.cpp \
+ qpid/management/ConnectionSettings.cpp \
qpid/management/Manageable.cpp \
qpid/management/ManagementObject.cpp \
qpid/management/Mutex.cpp \
@@ -809,6 +810,7 @@ nobase_include_HEADERS += \
../include/qpid/log/Statement.h \
../include/qpid/management/Args.h \
../include/qpid/management/Buffer.h \
+ ../include/qpid/management/ConnectionSettings.h \
../include/qpid/management/Manageable.h \
../include/qpid/management/ManagementEvent.h \
../include/qpid/management/ManagementObject.h \
diff --git a/cpp/src/qpid/agent/ManagementAgentImpl.cpp b/cpp/src/qpid/agent/ManagementAgentImpl.cpp
index 5c2c6c54e6..6a07d8c0e7 100644
--- a/cpp/src/qpid/agent/ManagementAgentImpl.cpp
+++ b/cpp/src/qpid/agent/ManagementAgentImpl.cpp
@@ -148,7 +148,7 @@ void ManagementAgentImpl::init(const string& brokerHost,
const string& mech,
const string& proto)
{
- client::ConnectionSettings settings;
+ management::ConnectionSettings settings;
settings.protocol = proto;
settings.host = brokerHost;
settings.port = brokerPort;
@@ -158,7 +158,7 @@ void ManagementAgentImpl::init(const string& brokerHost,
init(settings, intervalSeconds, useExternalThread, _storeFile);
}
-void ManagementAgentImpl::init(const qpid::client::ConnectionSettings& settings,
+void ManagementAgentImpl::init(const qpid::management::ConnectionSettings& settings,
uint16_t intervalSeconds,
bool useExternalThread,
const string& _storeFile)
@@ -170,7 +170,26 @@ void ManagementAgentImpl::init(const qpid::client::ConnectionSettings& settings,
QPID_LOG(info, "QMF Agent Initialized: broker=" << settings.host << ":" << settings.port <<
" interval=" << intervalSeconds << " storeFile=" << _storeFile);
- connectionSettings = settings;
+
+ //
+ // Convert from management::ConnectionSettings to client::ConnectionSettings
+ //
+ connectionSettings.protocol = settings.protocol;
+ connectionSettings.host = settings.host;
+ connectionSettings.port = settings.port;
+ connectionSettings.virtualhost = settings.virtualhost;
+ connectionSettings.username = settings.username;
+ connectionSettings.password = settings.password;
+ connectionSettings.mechanism = settings.mechanism;
+ connectionSettings.locale = settings.locale;
+ connectionSettings.heartbeat = settings.heartbeat;
+ connectionSettings.maxChannels = settings.maxChannels;
+ connectionSettings.maxFrameSize = settings.maxFrameSize;
+ connectionSettings.bounds = settings.bounds;
+ connectionSettings.tcpNoDelay = settings.tcpNoDelay;
+ connectionSettings.service = settings.service;
+ connectionSettings.minSsf = settings.minSsf;
+ connectionSettings.maxSsf = settings.maxSsf;
retrieveData();
bootSequence++;
diff --git a/cpp/src/qpid/agent/ManagementAgentImpl.h b/cpp/src/qpid/agent/ManagementAgentImpl.h
index d1609341be..7d4531f1b8 100644
--- a/cpp/src/qpid/agent/ManagementAgentImpl.h
+++ b/cpp/src/qpid/agent/ManagementAgentImpl.h
@@ -63,7 +63,7 @@ class ManagementAgentImpl : public ManagementAgent, public client::MessageListen
const std::string& pwd = "guest",
const std::string& mech = "PLAIN",
const std::string& proto = "tcp");
- void init(const client::ConnectionSettings& settings,
+ void init(const management::ConnectionSettings& settings,
uint16_t intervalSeconds = 10,
bool useExternalThread = false,
const std::string& storeFile = "");
diff --git a/cpp/src/qpid/management/ConnectionSettings.cpp b/cpp/src/qpid/management/ConnectionSettings.cpp
new file mode 100644
index 0000000000..1421a26867
--- /dev/null
+++ b/cpp/src/qpid/management/ConnectionSettings.cpp
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include "qpid/management/ConnectionSettings.h"
+#include "qpid/Version.h"
+
+qpid::management::ConnectionSettings::ConnectionSettings() :
+ protocol("tcp"),
+ host("localhost"),
+ port(5672),
+ locale("en_US"),
+ heartbeat(0),
+ maxChannels(32767),
+ maxFrameSize(65535),
+ bounds(2),
+ tcpNoDelay(false),
+ service(qpid::saslName),
+ minSsf(0),
+ maxSsf(256)
+{}
+
+qpid::management::ConnectionSettings::~ConnectionSettings() {}
+