2014-01-04 19:45:04 +08:00
|
|
|
/**
|
|
|
|
|
* Class describing an AMQP exchange declare ok frame
|
2014-04-08 20:42:07 +08:00
|
|
|
*
|
2014-01-04 19:45:04 +08:00
|
|
|
* @copyright 2014 Copernica BV
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class definition
|
|
|
|
|
*/
|
|
|
|
|
namespace AMQP{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class implementation
|
|
|
|
|
*/
|
|
|
|
|
class ExchangeDeclareOKFrame : public ExchangeFrame
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* Encode a frame on a string buffer
|
|
|
|
|
*
|
|
|
|
|
* @param buffer buffer to write frame to
|
|
|
|
|
*/
|
|
|
|
|
virtual void fill(OutBuffer& buffer) const override
|
|
|
|
|
{
|
|
|
|
|
// call base
|
|
|
|
|
ExchangeFrame::fill(buffer);
|
|
|
|
|
}
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Construct an exchange declare ok frame
|
|
|
|
|
*
|
|
|
|
|
* @param channel channel we're working on
|
|
|
|
|
*/
|
|
|
|
|
ExchangeDeclareOKFrame(uint16_t channel) : ExchangeFrame(channel, 0) {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Decode an exchange declare acknowledgement frame
|
|
|
|
|
*
|
|
|
|
|
* @param frame received frame to decode
|
|
|
|
|
*/
|
|
|
|
|
ExchangeDeclareOKFrame(ReceivedFrame &frame) :
|
|
|
|
|
ExchangeFrame(frame)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Destructor
|
|
|
|
|
*/
|
|
|
|
|
virtual ~ExchangeDeclareOKFrame() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* returns the method id
|
|
|
|
|
* @return uint16_t
|
|
|
|
|
*/
|
|
|
|
|
virtual uint16_t methodID() const override
|
|
|
|
|
{
|
|
|
|
|
return 11;
|
|
|
|
|
}
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-04 19:45:04 +08:00
|
|
|
/**
|
|
|
|
|
* Process the frame
|
|
|
|
|
* @param connection The connection over which it was received
|
|
|
|
|
* @return bool Was it succesfully processed?
|
|
|
|
|
*/
|
2014-01-06 01:50:41 +08:00
|
|
|
virtual bool process(ConnectionImpl *connection) override
|
|
|
|
|
{
|
|
|
|
|
// we need the appropriate channel
|
2014-08-20 17:47:16 +08:00
|
|
|
auto channel = connection->channel(this->channel());
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-06 01:50:41 +08:00
|
|
|
// channel does not exist
|
|
|
|
|
if(!channel) return false;
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-06 01:50:41 +08:00
|
|
|
// report exchange declare ok
|
2019-06-19 15:38:25 +08:00
|
|
|
channel->reportSuccess();
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-06 01:50:41 +08:00
|
|
|
// done
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-01-04 19:45:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* end namespace
|
|
|
|
|
*/
|
|
|
|
|
}
|