diff options
author | Alan Conway <aconway@apache.org> | 2007-01-12 18:39:26 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-01-12 18:39:26 +0000 |
commit | 7abe972eb67e965bc1ec8d171c4dadba2db5afae (patch) | |
tree | 1a6f28596b6f346c1d3a6fbae6563334c8e16916 /cpp/lib | |
parent | a2f603a03b5a6451139d4fcb22fd6e34f55c11e5 (diff) | |
download | qpid-python-7abe972eb67e965bc1ec8d171c4dadba2db5afae.tar.gz |
Andrew Stitcher <astitcher@redhat.com>
* Add empty implementation of handler class for protocol Message class.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@495681 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/lib')
-rw-r--r-- | cpp/lib/broker/SessionHandlerImpl.cpp | 144 | ||||
-rw-r--r-- | cpp/lib/broker/SessionHandlerImpl.h | 139 |
2 files changed, 254 insertions, 29 deletions
diff --git a/cpp/lib/broker/SessionHandlerImpl.cpp b/cpp/lib/broker/SessionHandlerImpl.cpp index 3110c7ca3d..adf2758eda 100644 --- a/cpp/lib/broker/SessionHandlerImpl.cpp +++ b/cpp/lib/broker/SessionHandlerImpl.cpp @@ -47,9 +47,9 @@ SessionHandlerImpl::SessionHandlerImpl(SessionContext* _context, exchangeHandler(new ExchangeHandlerImpl(this)), queueHandler(new QueueHandlerImpl(this)), txHandler(new TxHandlerImpl(this)), + messageHandler(new MessageHandlerImpl(this)), framemax(65536), - heartbeat(0) - { + heartbeat(0){ client =NULL; } @@ -511,4 +511,144 @@ SessionHandlerImpl::ChannelHandlerImpl::resume( assert(0); // FIXME aconway 2007-01-04: 0-9 feature } +// Message class method handlers +void +SessionHandlerImpl::MessageHandlerImpl::append( u_int16_t /*channel*/, + const string& /*reference*/, + const string& /*bytes*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + + +void +SessionHandlerImpl::MessageHandlerImpl::cancel( u_int16_t /*channel*/, + const string& /*destination*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::checkpoint( u_int16_t /*channel*/, + const string& /*reference*/, + const string& /*identifier*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::close( u_int16_t /*channel*/, + const string& /*reference*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::consume( u_int16_t /*channel*/, + u_int16_t /*ticket*/, + const string& /*queue*/, + const string& /*destination*/, + bool /*noLocal*/, + bool /*noAck*/, + bool /*exclusive*/, + const qpid::framing::FieldTable& /*filter*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::empty( u_int16_t /*channel*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::get( u_int16_t /*channel*/, + u_int16_t /*ticket*/, + const string& /*queue*/, + const string& /*destination*/, + bool /*noAck*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::offset( u_int16_t /*channel*/, + u_int64_t /*value*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::ok( u_int16_t /*channel*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::open( u_int16_t /*channel*/, + const string& /*reference*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::qos( u_int16_t /*channel*/, + u_int32_t /*prefetchSize*/, + u_int16_t /*prefetchCount*/, + bool /*global*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} +void +SessionHandlerImpl::MessageHandlerImpl::recover( u_int16_t /*channel*/, + bool /*requeue*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::reject( u_int16_t /*channel*/, + u_int16_t /*code*/, + const string& /*text*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::resume( u_int16_t /*channel*/, + const string& /*reference*/, + const string& /*identifier*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + +void +SessionHandlerImpl::MessageHandlerImpl::transfer( u_int16_t /*channel*/, + u_int16_t /*ticket*/, + const string& /*destination*/, + bool /*redelivered*/, + bool /*immediate*/, + u_int64_t /*ttl*/, + u_int8_t /*priority*/, + u_int64_t /*timestamp*/, + u_int8_t /*deliveryMode*/, + u_int64_t /*expiration*/, + const string& /*exchange*/, + const string& /*routingKey*/, + const string& /*messageId*/, + const string& /*correlationId*/, + const string& /*replyTo*/, + const string& /*contentType*/, + const string& /*contentEncoding*/, + const string& /*userId*/, + const string& /*appId*/, + const string& /*transactionId*/, + const string& /*securityToken*/, + const qpid::framing::FieldTable& /*applicationHeaders*/, + qpid::framing::Content /*body*/ ) +{ + assert(0); // FIXME astitcher 2007-01-11: 0-9 feature +} + diff --git a/cpp/lib/broker/SessionHandlerImpl.h b/cpp/lib/broker/SessionHandlerImpl.h index c4ce9e7fd0..25803fe1f7 100644 --- a/cpp/lib/broker/SessionHandlerImpl.h +++ b/cpp/lib/broker/SessionHandlerImpl.h @@ -68,9 +68,9 @@ class Settings { Settings(u_int32_t _timeout, u_int64_t _stagingThreshold) : timeout(_timeout), stagingThreshold(_stagingThreshold) {} }; -class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, - public virtual qpid::framing::AMQP_ServerOperations, - public virtual ConnectionToken +class SessionHandlerImpl : public qpid::sys::SessionHandler, + public qpid::framing::AMQP_ServerOperations, + public ConnectionToken { typedef std::map<u_int16_t, Channel*>::iterator channel_iterator; typedef std::vector<Queue::shared_ptr>::iterator queue_iterator; @@ -88,6 +88,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, std::auto_ptr<ExchangeHandler> exchangeHandler; std::auto_ptr<QueueHandler> queueHandler; std::auto_ptr<TxHandler> txHandler; + std::auto_ptr<MessageHandler> messageHandler; std::map<u_int16_t, Channel*> channels; std::vector<Queue::shared_ptr> exclusiveQueues; @@ -120,7 +121,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual void closed(); virtual ~SessionHandlerImpl(); - class ConnectionHandlerImpl : public virtual ConnectionHandler{ + class ConnectionHandlerImpl : public ConnectionHandler{ SessionHandlerImpl* parent; public: inline ConnectionHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -145,7 +146,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual ~ConnectionHandlerImpl(){} }; - class ChannelHandlerImpl : public virtual ChannelHandler{ + class ChannelHandlerImpl : public ChannelHandler{ SessionHandlerImpl* parent; public: inline ChannelHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -174,7 +175,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual ~ChannelHandlerImpl(){} }; - class ExchangeHandlerImpl : public virtual ExchangeHandler{ + class ExchangeHandlerImpl : public ExchangeHandler{ SessionHandlerImpl* parent; public: inline ExchangeHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -196,7 +197,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, }; - class QueueHandlerImpl : public virtual QueueHandler{ + class QueueHandlerImpl : public QueueHandler{ SessionHandlerImpl* parent; public: inline QueueHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -226,7 +227,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual ~QueueHandlerImpl(){} }; - class BasicHandlerImpl : public virtual BasicHandler{ + class BasicHandlerImpl : public BasicHandler{ SessionHandlerImpl* parent; public: inline BasicHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -255,7 +256,7 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual ~BasicHandlerImpl(){} }; - class TxHandlerImpl : public virtual TxHandler{ + class TxHandlerImpl : public TxHandler{ SessionHandlerImpl* parent; public: TxHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} @@ -265,26 +266,110 @@ class SessionHandlerImpl : public virtual qpid::sys::SessionHandler, virtual void rollback(u_int16_t channel); }; + class MessageHandlerImpl : public MessageHandler { + SessionHandlerImpl* parent; + + // Constructors and destructors + + public: + MessageHandlerImpl() {} + MessageHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {} + virtual ~MessageHandlerImpl() {} + + // Protocol methods + virtual void append( u_int16_t channel, + const string& reference, + const string& bytes ); + + virtual void cancel( u_int16_t channel, + const string& destination ); + + virtual void checkpoint( u_int16_t channel, + const string& reference, + const string& identifier ); + + virtual void close( u_int16_t channel, + const string& reference ); + + virtual void consume( u_int16_t channel, + u_int16_t ticket, + const string& queue, + const string& destination, + bool noLocal, + bool noAck, + bool exclusive, + const qpid::framing::FieldTable& filter ); + + virtual void empty( u_int16_t channel ); + + virtual void get( u_int16_t channel, + u_int16_t ticket, + const string& queue, + const string& destination, + bool noAck ); + + virtual void offset( u_int16_t channel, + u_int64_t value ); + + virtual void ok( u_int16_t channel ); + + virtual void open( u_int16_t channel, + const string& reference ); + + virtual void qos( u_int16_t channel, + u_int32_t prefetchSize, + u_int16_t prefetchCount, + bool global ); + + virtual void recover( u_int16_t channel, + bool requeue ); + + virtual void reject( u_int16_t channel, + u_int16_t code, + const string& text ); + + virtual void resume( u_int16_t channel, + const string& reference, + const string& identifier ); + + virtual void transfer( u_int16_t channel, + u_int16_t ticket, + const string& destination, + bool redelivered, + bool immediate, + u_int64_t ttl, + u_int8_t priority, + u_int64_t timestamp, + u_int8_t deliveryMode, + u_int64_t expiration, + const string& exchange, + const string& routingKey, + const string& messageId, + const string& correlationId, + const string& replyTo, + const string& contentType, + const string& contentEncoding, + const string& userId, + const string& appId, + const string& transactionId, + const string& securityToken, + const qpid::framing::FieldTable& applicationHeaders, + qpid::framing::Content body ); + }; - inline virtual ChannelHandler* getChannelHandler(){ return channelHandler.get(); } - inline virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler.get(); } - inline virtual BasicHandler* getBasicHandler(){ return basicHandler.get(); } - inline virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler.get(); } - inline virtual QueueHandler* getQueueHandler(){ return queueHandler.get(); } - inline virtual TxHandler* getTxHandler(){ return txHandler.get(); } + virtual ChannelHandler* getChannelHandler(){ return channelHandler.get(); } + virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler.get(); } + virtual BasicHandler* getBasicHandler(){ return basicHandler.get(); } + virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler.get(); } + virtual QueueHandler* getQueueHandler(){ return queueHandler.get(); } + virtual TxHandler* getTxHandler(){ return txHandler.get(); } + virtual MessageHandler* getMessageHandler(){ return messageHandler.get(); } - inline virtual AccessHandler* getAccessHandler(){ throw ConnectionException(540, "Access class not implemented"); } - inline virtual FileHandler* getFileHandler(){ throw ConnectionException(540, "File class not implemented"); } - inline virtual StreamHandler* getStreamHandler(){ throw ConnectionException(540, "Stream class not implemented"); } - inline virtual DtxHandler* getDtxHandler(){ throw ConnectionException(540, "Dtx class not implemented"); } - inline virtual TunnelHandler* getTunnelHandler(){ throw ConnectionException(540, "Tunnel class not implemented"); } - - virtual AMQP_ServerOperations::MessageHandler* getMessageHandler(){ throw ConnectionException(540, "Message class not implemented"); } - - // FIXME aconway 2007-01-04: Remove? - // Temporary add-in to resolve version conflicts: AMQP v8.0 still defines class Test; - // however v0.9 will not - kpvdr 2006-11-17 - // inline virtual TestHandler* getTestHandler(){ throw ConnectionException(540, "Test class not implemented"); } + virtual AccessHandler* getAccessHandler(){ throw ConnectionException(540, "Access class not implemented"); } + virtual FileHandler* getFileHandler(){ throw ConnectionException(540, "File class not implemented"); } + virtual StreamHandler* getStreamHandler(){ throw ConnectionException(540, "Stream class not implemented"); } + virtual DtxHandler* getDtxHandler(){ throw ConnectionException(540, "Dtx class not implemented"); } + virtual TunnelHandler* getTunnelHandler(){ throw ConnectionException(540, "Tunnel class not implemented"); } }; } |