summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/BrokerAdapter.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-09-21 18:26:37 +0000
committerAlan Conway <aconway@apache.org>2007-09-21 18:26:37 +0000
commit2f6d6ad7efd788b71204af67dff51b6233881e2e (patch)
treea3d123bc112d12dfcef341a312f418624c98e342 /cpp/src/qpid/broker/BrokerAdapter.h
parent3b80f903b6174b4346d7d7b537d783f628fe28d6 (diff)
downloadqpid-python-2f6d6ad7efd788b71204af67dff51b6233881e2e.tar.gz
Split broker::Session into:
broker::SessionState: session info (uuid etc.) + handler chains. broker::SemanticState: session state for the SemanticHandler. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@578219 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/BrokerAdapter.h')
-rw-r--r--cpp/src/qpid/broker/BrokerAdapter.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/cpp/src/qpid/broker/BrokerAdapter.h b/cpp/src/qpid/broker/BrokerAdapter.h
index ec6b4aa0fc..5537dc67f5 100644
--- a/cpp/src/qpid/broker/BrokerAdapter.h
+++ b/cpp/src/qpid/broker/BrokerAdapter.h
@@ -20,7 +20,7 @@
*/
#include "DtxHandlerImpl.h"
#include "MessageHandlerImpl.h"
-#include "NameGenerator.h"
+
#include "qpid/Exception.h"
#include "qpid/framing/AMQP_ServerOperations.h"
#include "qpid/framing/reply_exceptions.h"
@@ -44,6 +44,7 @@ class StreamHandler;
class DtxHandler;
class TunnelHandler;
class MessageHandlerImpl;
+class Exchange;
/**
* Per-channel protocol adapter.
@@ -54,16 +55,10 @@ class MessageHandlerImpl;
* peer.
*
*/
-
-// TODO aconway 2007-09-18: BrokerAdapter is no longer an appropriate way
-// to group methods as seen by the BADHANDLERs below.
-// Handlers should be grouped by layer, the BrokerAdapter stuff
-// belongs on the SemanticHandler.
-//
class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
{
public:
- BrokerAdapter(Session& session);
+ BrokerAdapter(SemanticState& session);
BasicHandler* getBasicHandler() { return &basicHandler; }
ExchangeHandler* getExchangeHandler() { return &exchangeHandler; }
@@ -73,7 +68,8 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
MessageHandler* getMessageHandler() { return &messageHandler; }
DtxCoordinationHandler* getDtxCoordinationHandler() { return &dtxHandler; }
DtxDemarcationHandler* getDtxDemarcationHandler() { return &dtxHandler; }
- framing::ProtocolVersion getVersion() const { return getConnection().getVersion(); }
+
+ framing::ProtocolVersion getVersion() const { return session.getVersion();}
AccessHandler* getAccessHandler() {
@@ -99,7 +95,7 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
public HandlerImpl
{
public:
- ExchangeHandlerImpl(Session& session) : HandlerImpl(session) {}
+ ExchangeHandlerImpl(SemanticState& session) : HandlerImpl(session) {}
void declare(uint16_t ticket,
const std::string& exchange, const std::string& type,
@@ -108,10 +104,13 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
const qpid::framing::FieldTable& arguments);
void delete_(uint16_t ticket,
const std::string& exchange, bool ifUnused);
- framing::ExchangeQueryResult query(u_int16_t ticket, const string& name);
+ framing::ExchangeQueryResult query(u_int16_t ticket,
+ const std::string& name);
private:
- void checkType(Exchange::shared_ptr exchange, const std::string& type);
- void checkAlternate(Exchange::shared_ptr exchange, Exchange::shared_ptr alternate);
+ void checkType(shared_ptr<Exchange> exchange, const std::string& type);
+
+ void checkAlternate(shared_ptr<Exchange> exchange,
+ shared_ptr<Exchange> alternate);
};
class BindingHandlerImpl :
@@ -119,7 +118,7 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
public HandlerImpl
{
public:
- BindingHandlerImpl(Session& session) : HandlerImpl(session) {}
+ BindingHandlerImpl(SemanticState& session) : HandlerImpl(session) {}
framing::BindingQueryResult query(u_int16_t ticket,
const std::string& exchange,
@@ -133,7 +132,7 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
public HandlerImpl
{
public:
- QueueHandlerImpl(Session& session) : HandlerImpl(session) {}
+ QueueHandlerImpl(SemanticState& session) : HandlerImpl(session) {}
void declare(uint16_t ticket, const std::string& queue,
const std::string& alternateExchange,
@@ -148,7 +147,7 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
const std::string& exchange,
const std::string& routingKey,
const qpid::framing::FieldTable& arguments );
- framing::QueueQueryResult query(const string& queue);
+ framing::QueueQueryResult query(const std::string& queue);
void purge(uint16_t ticket, const std::string& queue);
void delete_(uint16_t ticket, const std::string& queue,
bool ifUnused, bool ifEmpty);
@@ -159,9 +158,8 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
public HandlerImpl
{
NameGenerator tagGenerator;
-
public:
- BasicHandlerImpl(Session& session) : HandlerImpl(session), tagGenerator("sgen") {}
+ BasicHandlerImpl(SemanticState& session) : HandlerImpl(session), tagGenerator("sgen") {}
void qos(uint32_t prefetchSize,
uint16_t prefetchCount, bool global);
@@ -181,7 +179,7 @@ class BrokerAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
public HandlerImpl
{
public:
- TxHandlerImpl(Session& session) : HandlerImpl(session) {}
+ TxHandlerImpl(SemanticState& session) : HandlerImpl(session) {}
void select();
void commit();