Author: tross
Date: Tue May 25 14:02:49 2010
New Revision: 948046

URL: http://svn.apache.org/viewvc?rev=948046&view=rev
Log:
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.

Added:
    qpid/trunk/qpid/cpp/include/qpid/management/ConnectionSettings.h
    qpid/trunk/qpid/cpp/src/qpid/management/ConnectionSettings.cpp
Modified:
    qpid/trunk/qpid/cpp/include/qpid/agent/ManagementAgent.h
    qpid/trunk/qpid/cpp/src/CMakeLists.txt
    qpid/trunk/qpid/cpp/src/Makefile.am
    qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h

Modified: qpid/trunk/qpid/cpp/include/qpid/agent/ManagementAgent.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/agent/ManagementAgent.h?rev=948046&r1=948045&r2=948046&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/agent/ManagementAgent.h (original)
+++ qpid/trunk/qpid/cpp/include/qpid/agent/ManagementAgent.h Tue May 25 
14:02:49 2010
@@ -24,6 +24,7 @@
 #include "qpid/management/ManagementObject.h"
 #include "qpid/management/ManagementEvent.h"
 #include "qpid/management/Manageable.h"
+#include "qpid/management/ConnectionSettings.h"
 
 namespace qpid {
 namespace management {
@@ -103,6 +104,12 @@ class ManagementAgent
                       const std::string& mech = "PLAIN",
                       const std::string& proto = "tcp") = 0;
 
+    virtual void init(const management::ConnectionSettings& settings,
+                      uint16_t intervalSeconds = 10,
+                      bool useExternalThread = false,
+                      const std::string& storeFile = "") = 0;
+
+
     // Register a schema with the management agent.  This is normally called 
by the
     // package initializer generated by the management code generator.
     //
@@ -117,7 +124,7 @@ class ManagementAgent
                   const std::string& eventName,
                   uint8_t*    md5Sum,
                   management::ManagementEvent::writeSchemaCall_t schemaCall) = 
0;
-
+
     // Add a management object to the agent.  Once added, this object shall be 
visible
     // in the greater management context.
     //

Added: qpid/trunk/qpid/cpp/include/qpid/management/ConnectionSettings.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/include/qpid/management/ConnectionSettings.h?rev=948046&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/include/qpid/management/ConnectionSettings.h (added)
+++ qpid/trunk/qpid/cpp/include/qpid/management/ConnectionSettings.h Tue May 25 
14:02:49 2010
@@ -0,0 +1,118 @@
+#ifndef _management_ConnectionSettings_h
+#define _management_ConnectionSettings_h
+/*
+ *
+ * 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/CommonImportExport.h"
+#include "qpid/types/Variant.h"
+#include <string>
+
+namespace qpid {
+namespace management {
+
+/**
+ * Settings for a Connection.
+ */
+struct ConnectionSettings {
+
+    QPID_COMMON_EXTERN ConnectionSettings();
+    QPID_COMMON_EXTERN virtual ~ConnectionSettings();
+
+    /**
+     * The protocol used for the connection (defaults to 'tcp')
+     */
+    std::string protocol;
+
+    /**
+     * The host (or ip address) to connect to (defaults to 'localhost').
+     */
+    std::string host;
+    /**
+     * The port to connect to (defaults to 5672).
+     */
+    uint16_t port;
+    /**
+     * Allows an AMQP 'virtual host' to be specified for the
+     * connection.
+     */
+    std::string virtualhost;
+
+    /**
+     * The username to use when authenticating the connection. If not
+     * specified the current users login is used if available.
+     */
+    std::string username;
+    /**
+     * The password to use when authenticating the connection.
+     */
+    std::string password;
+    /**
+     * The SASL mechanism to use when authenticating the connection;
+     * the options are currently PLAIN or ANONYMOUS.
+     */
+    std::string mechanism;
+    /**
+     * Allows a locale to be specified for the connection.
+     */
+    std::string locale;
+    /**
+     * Allows a heartbeat frequency to be specified
+     */
+    uint16_t heartbeat;
+    /**
+     * The maximum number of channels that the client will request for
+     * use on this connection.
+     */
+    uint16_t maxChannels;
+    /**
+     * The maximum frame size that the client will request for this
+     * connection.
+     */
+    uint16_t maxFrameSize;
+    /**
+     * Limit the size of the connections send buffer . The buffer
+     * is limited to bounds * maxFrameSize.
+     */
+    unsigned int bounds;
+    /**
+     * If true, TCP_NODELAY will be set for the connection.
+     */
+    bool tcpNoDelay;
+    /**
+     * SASL service name
+     */
+    std::string service;
+    /**
+     * Minimum acceptable strength of any SASL negotiated security
+     * layer. 0 means no security layer required.
+     */
+    unsigned int minSsf;
+    /**
+     * Maximum acceptable strength of any SASL negotiated security
+     * layer. 0 means no security layer allowed.
+     */
+    unsigned int maxSsf;
+};
+
+}}
+
+#endif
+

Modified: qpid/trunk/qpid/cpp/src/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/CMakeLists.txt?rev=948046&r1=948045&r2=948046&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/src/CMakeLists.txt Tue May 25 14:02:49 2010
@@ -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

Modified: qpid/trunk/qpid/cpp/src/Makefile.am
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/Makefile.am?rev=948046&r1=948045&r2=948046&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/Makefile.am (original)
+++ qpid/trunk/qpid/cpp/src/Makefile.am Tue May 25 14:02:49 2010
@@ -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        \

Modified: qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp?rev=948046&r1=948045&r2=948046&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp Tue May 25 
14:02:49 2010
@@ -148,7 +148,7 @@ void ManagementAgentImpl::init(const str
                                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 str
     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 qpi
 
     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++;

Modified: qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h?rev=948046&r1=948045&r2=948046&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h Tue May 25 
14:02:49 2010
@@ -63,7 +63,7 @@ class ManagementAgentImpl : public Manag
               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 = "");

Added: qpid/trunk/qpid/cpp/src/qpid/management/ConnectionSettings.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/management/ConnectionSettings.cpp?rev=948046&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/management/ConnectionSettings.cpp (added)
+++ qpid/trunk/qpid/cpp/src/qpid/management/ConnectionSettings.cpp Tue May 25 
14:02:49 2010
@@ -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() {}
+



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to