00001 #ifndef QPID_FRAMING_EXCHANGEUNBINDBODY_H
00002 #define QPID_FRAMING_EXCHANGEUNBINDBODY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028
00029
00030 #include "qpid/framing/AMQMethodBody.h"
00031 #include "qpid/framing/AMQP_ServerOperations.h"
00032 #include "qpid/framing/MethodBodyConstVisitor.h"
00033 #include "qpid/framing/ModelMethod.h"
00034
00035 #include <ostream>
00036 #include "qpid/framing/amqp_types_full.h"
00037 #include "qpid/CommonImportExport.h"
00038
00039 namespace qpid {
00040 namespace framing {
00041
00042 class ExchangeUnbindBody : public ModelMethod {
00043 string queue;
00044 string exchange;
00045 string bindingKey;
00046 uint16_t flags;
00047 public:
00048 static const ClassId CLASS_ID = 0x7;
00049 static const MethodId METHOD_ID = 0x5;
00050 ExchangeUnbindBody(
00051 ProtocolVersion, const string& _queue,
00052 const string& _exchange,
00053 const string& _bindingKey) :
00054 queue(_queue),
00055 exchange(_exchange),
00056 bindingKey(_bindingKey),
00057 flags(0){
00058 flags |= (1 << 8);
00059 flags |= (1 << 9);
00060 flags |= (1 << 10);
00061 }
00062 ExchangeUnbindBody(ProtocolVersion=ProtocolVersion()) : flags(0) {}
00063
00064 QPID_COMMON_EXTERN void setQueue(const string& _queue);
00065 QPID_COMMON_EXTERN const string& getQueue() const;
00066 QPID_COMMON_EXTERN bool hasQueue() const;
00067 QPID_COMMON_EXTERN void clearQueueFlag();
00068 QPID_COMMON_EXTERN void setExchange(const string& _exchange);
00069 QPID_COMMON_EXTERN const string& getExchange() const;
00070 QPID_COMMON_EXTERN bool hasExchange() const;
00071 QPID_COMMON_EXTERN void clearExchangeFlag();
00072 QPID_COMMON_EXTERN void setBindingKey(const string& _bindingKey);
00073 QPID_COMMON_EXTERN const string& getBindingKey() const;
00074 QPID_COMMON_EXTERN bool hasBindingKey() const;
00075 QPID_COMMON_EXTERN void clearBindingKeyFlag();
00076 typedef void ResultType;
00077
00078 template <class T> ResultType invoke(T& invocable) const {
00079 return invocable.unbind(getQueue(), getExchange(), getBindingKey());
00080 }
00081
00082 using AMQMethodBody::accept;
00083 void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
00084 boost::intrusive_ptr<AMQBody> clone() const { return BodyFactory::copy(*this); }
00085
00086 ClassId amqpClassId() const { return CLASS_ID; }
00087 MethodId amqpMethodId() const { return METHOD_ID; }
00088 bool isContentBearing() const { return false; }
00089 bool resultExpected() const { return false; }
00090 bool responseExpected() const { return false; }
00091 QPID_COMMON_EXTERN void encode(Buffer&) const;
00092 QPID_COMMON_EXTERN void decode(Buffer&, uint32_t=0);
00093 QPID_COMMON_EXTERN void encodeStructBody(Buffer&) const;
00094 QPID_COMMON_EXTERN void decodeStructBody(Buffer&, uint32_t=0);
00095 QPID_COMMON_EXTERN uint32_t encodedSize() const;
00096 QPID_COMMON_EXTERN uint32_t bodySize() const;
00097 QPID_COMMON_EXTERN void print(std::ostream& out) const;
00098 };
00099
00100 }}
00101 #endif