2014-01-04 19:45:04 +08:00
|
|
|
/**
|
2014-04-08 20:42:07 +08:00
|
|
|
* Exchangeunbindokframe.h
|
2014-01-04 19:45:04 +08:00
|
|
|
*
|
|
|
|
|
* @copyright 2014 Copernica BV
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set up namespace
|
|
|
|
|
*/
|
|
|
|
|
namespace AMQP {
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-04 19:45:04 +08:00
|
|
|
/**
|
|
|
|
|
* Class definition
|
|
|
|
|
*/
|
|
|
|
|
class ExchangeUnbindOKFrame : 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:
|
|
|
|
|
/**
|
|
|
|
|
* Constructor based on incoming data
|
2014-04-08 20:42:07 +08:00
|
|
|
*
|
2014-01-04 19:45:04 +08:00
|
|
|
* @param frame received frame to decode
|
|
|
|
|
*/
|
2014-04-08 20:42:07 +08:00
|
|
|
ExchangeUnbindOKFrame(ReceivedFrame &frame) :
|
2014-01-04 19:45:04 +08:00
|
|
|
ExchangeFrame(frame)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor for an exchangebindframe
|
|
|
|
|
* @param destination
|
|
|
|
|
* @param source
|
|
|
|
|
* @param routingkey
|
|
|
|
|
* @param noWait
|
|
|
|
|
* @param arguments
|
|
|
|
|
*/
|
|
|
|
|
ExchangeUnbindOKFrame(uint16_t channel) :
|
|
|
|
|
ExchangeFrame(channel, 0)
|
|
|
|
|
{}
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-04 19:45:04 +08:00
|
|
|
virtual uint16_t methodID() const override
|
|
|
|
|
{
|
|
|
|
|
return 51;
|
|
|
|
|
}
|
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
|
|
|
|
|
{
|
|
|
|
|
// check if we have a 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;
|
|
|
|
|
|
|
|
|
|
// report to handler
|
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
|
|
|
};
|
2014-04-08 20:42:07 +08:00
|
|
|
|
2014-01-04 19:45:04 +08:00
|
|
|
// end namespace
|
|
|
|
|
}
|