00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef qpid_framing_AMQP_ClientProxy__
00029 #define qpid_framing_AMQP_ClientProxy__
00030
00031 #include "qpid/framing/Proxy.h"
00032
00033 namespace qpid {
00034 namespace framing {
00035
00036 class AMQP_ClientProxy : public Proxy
00037 {
00038 public:
00039 AMQP_ClientProxy(ChannelAdapter& ch);
00040
00041
00042
00043
00044 class Access
00045 {
00046 private:
00047 ChannelAdapter& channel;
00048
00049 public:
00050
00051
00052 Access(ChannelAdapter& ch) :
00053 channel(ch) {}
00054 virtual ~Access() {}
00055
00056 static Access& get(AMQP_ClientProxy& proxy) { return proxy.getAccess();}
00057
00058
00059
00060 virtual void requestOk(u_int16_t ticket,
00061 RequestId responseTo );
00062 };
00063
00064
00065 class Basic
00066 {
00067 private:
00068 ChannelAdapter& channel;
00069
00070 public:
00071
00072
00073 Basic(ChannelAdapter& ch) :
00074 channel(ch) {}
00075 virtual ~Basic() {}
00076
00077 static Basic& get(AMQP_ClientProxy& proxy) { return proxy.getBasic();}
00078
00079
00080
00081 virtual void cancelOk(const string& consumerTag,
00082 RequestId responseTo );
00083
00084 virtual void consumeOk(const string& consumerTag,
00085 RequestId responseTo );
00086
00087 virtual RequestId deliver(const string& consumerTag,
00088 u_int64_t deliveryTag,
00089 bool redelivered,
00090 const string& exchange,
00091 const string& routingKey );
00092
00093 virtual void getEmpty(const string& clusterId,
00094 RequestId responseTo );
00095
00096 virtual void getOk(u_int64_t deliveryTag,
00097 bool redelivered,
00098 const string& exchange,
00099 const string& routingKey,
00100 u_int32_t messageCount,
00101 RequestId responseTo );
00102
00103 virtual void qosOk( RequestId responseTo );
00104
00105 virtual RequestId return_(u_int16_t replyCode,
00106 const string& replyText,
00107 const string& exchange,
00108 const string& routingKey );
00109 };
00110
00111
00112 class Channel
00113 {
00114 private:
00115 ChannelAdapter& channel;
00116
00117 public:
00118
00119
00120 Channel(ChannelAdapter& ch) :
00121 channel(ch) {}
00122 virtual ~Channel() {}
00123
00124 static Channel& get(AMQP_ClientProxy& proxy) { return proxy.getChannel();}
00125
00126
00127
00128 virtual RequestId close(u_int16_t replyCode,
00129 const string& replyText,
00130 u_int16_t classId,
00131 u_int16_t methodId );
00132
00133 virtual void closeOk( RequestId responseTo );
00134
00135 virtual RequestId flow(bool active );
00136
00137 virtual void flowOk(bool active,
00138 RequestId responseTo );
00139
00140 virtual void ok( RequestId responseTo );
00141
00142 virtual void openOk(const string& channelId,
00143 RequestId responseTo );
00144
00145 virtual RequestId ping( );
00146
00147 virtual RequestId pong( );
00148 };
00149
00150
00151 class Connection
00152 {
00153 private:
00154 ChannelAdapter& channel;
00155
00156 public:
00157
00158
00159 Connection(ChannelAdapter& ch) :
00160 channel(ch) {}
00161 virtual ~Connection() {}
00162
00163 static Connection& get(AMQP_ClientProxy& proxy) { return proxy.getConnection();}
00164
00165
00166
00167 virtual RequestId close(u_int16_t replyCode,
00168 const string& replyText,
00169 u_int16_t classId,
00170 u_int16_t methodId );
00171
00172 virtual void closeOk( RequestId responseTo );
00173
00174 virtual void openOk(const string& knownHosts,
00175 RequestId responseTo );
00176
00177 virtual void redirect(const string& host,
00178 const string& knownHosts,
00179 RequestId responseTo );
00180
00181 virtual RequestId secure(const string& challenge );
00182
00183 virtual RequestId start(u_int8_t versionMajor,
00184 u_int8_t versionMinor,
00185 const FieldTable& serverProperties,
00186 const string& mechanisms,
00187 const string& locales );
00188
00189 virtual RequestId tune(u_int16_t channelMax,
00190 u_int32_t frameMax,
00191 u_int16_t heartbeat );
00192 };
00193
00194
00195 class Dtx
00196 {
00197 private:
00198 ChannelAdapter& channel;
00199
00200 public:
00201
00202
00203 Dtx(ChannelAdapter& ch) :
00204 channel(ch) {}
00205 virtual ~Dtx() {}
00206
00207 static Dtx& get(AMQP_ClientProxy& proxy) { return proxy.getDtx();}
00208
00209
00210
00211 virtual void selectOk( RequestId responseTo );
00212
00213 virtual void startOk( RequestId responseTo );
00214 };
00215
00216
00217 class Exchange
00218 {
00219 private:
00220 ChannelAdapter& channel;
00221
00222 public:
00223
00224
00225 Exchange(ChannelAdapter& ch) :
00226 channel(ch) {}
00227 virtual ~Exchange() {}
00228
00229 static Exchange& get(AMQP_ClientProxy& proxy) { return proxy.getExchange();}
00230
00231
00232
00233 virtual void declareOk( RequestId responseTo );
00234
00235 virtual void deleteOk( RequestId responseTo );
00236 };
00237
00238
00239 class File
00240 {
00241 private:
00242 ChannelAdapter& channel;
00243
00244 public:
00245
00246
00247 File(ChannelAdapter& ch) :
00248 channel(ch) {}
00249 virtual ~File() {}
00250
00251 static File& get(AMQP_ClientProxy& proxy) { return proxy.getFile();}
00252
00253
00254
00255 virtual void cancelOk(const string& consumerTag,
00256 RequestId responseTo );
00257
00258 virtual void consumeOk(const string& consumerTag,
00259 RequestId responseTo );
00260
00261 virtual RequestId deliver(const string& consumerTag,
00262 u_int64_t deliveryTag,
00263 bool redelivered,
00264 const string& exchange,
00265 const string& routingKey,
00266 const string& identifier );
00267
00268 virtual RequestId open(const string& identifier,
00269 u_int64_t contentSize );
00270
00271 virtual void openOk(u_int64_t stagedSize,
00272 RequestId responseTo );
00273
00274 virtual void qosOk( RequestId responseTo );
00275
00276 virtual RequestId return_(u_int16_t replyCode,
00277 const string& replyText,
00278 const string& exchange,
00279 const string& routingKey );
00280
00281 virtual void stage( RequestId responseTo );
00282 };
00283
00284
00285 class Message
00286 {
00287 private:
00288 ChannelAdapter& channel;
00289
00290 public:
00291
00292
00293 Message(ChannelAdapter& ch) :
00294 channel(ch) {}
00295 virtual ~Message() {}
00296
00297 static Message& get(AMQP_ClientProxy& proxy) { return proxy.getMessage();}
00298
00299
00300
00301 virtual RequestId append(const string& reference,
00302 const string& bytes );
00303
00304 virtual RequestId checkpoint(const string& reference,
00305 const string& identifier );
00306
00307 virtual RequestId close(const string& reference );
00308
00309 virtual void empty( RequestId responseTo );
00310
00311 virtual void offset(u_int64_t value,
00312 RequestId responseTo );
00313
00314 virtual void ok( RequestId responseTo );
00315
00316 virtual RequestId open(const string& reference );
00317
00318 virtual void reject(u_int16_t code,
00319 const string& text,
00320 RequestId responseTo );
00321
00322 virtual RequestId resume(const string& reference,
00323 const string& identifier );
00324
00325 virtual RequestId transfer(u_int16_t ticket,
00326 const string& destination,
00327 bool redelivered,
00328 bool immediate,
00329 u_int64_t ttl,
00330 u_int8_t priority,
00331 u_int64_t timestamp,
00332 u_int8_t deliveryMode,
00333 u_int64_t expiration,
00334 const string& exchange,
00335 const string& routingKey,
00336 const string& messageId,
00337 const string& correlationId,
00338 const string& replyTo,
00339 const string& contentType,
00340 const string& contentEncoding,
00341 const string& userId,
00342 const string& appId,
00343 const string& transactionId,
00344 const string& securityToken,
00345 const FieldTable& applicationHeaders,
00346 const Content& body,
00347 bool mandatory );
00348 };
00349
00350
00351 class Queue
00352 {
00353 private:
00354 ChannelAdapter& channel;
00355
00356 public:
00357
00358
00359 Queue(ChannelAdapter& ch) :
00360 channel(ch) {}
00361 virtual ~Queue() {}
00362
00363 static Queue& get(AMQP_ClientProxy& proxy) { return proxy.getQueue();}
00364
00365
00366
00367 virtual void bindOk( RequestId responseTo );
00368
00369 virtual void declareOk(const string& queue,
00370 u_int32_t messageCount,
00371 u_int32_t consumerCount,
00372 RequestId responseTo );
00373
00374 virtual void deleteOk(u_int32_t messageCount,
00375 RequestId responseTo );
00376
00377 virtual void purgeOk(u_int32_t messageCount,
00378 RequestId responseTo );
00379
00380 virtual void unbindOk( RequestId responseTo );
00381 };
00382
00383
00384 class Stream
00385 {
00386 private:
00387 ChannelAdapter& channel;
00388
00389 public:
00390
00391
00392 Stream(ChannelAdapter& ch) :
00393 channel(ch) {}
00394 virtual ~Stream() {}
00395
00396 static Stream& get(AMQP_ClientProxy& proxy) { return proxy.getStream();}
00397
00398
00399
00400 virtual void cancelOk(const string& consumerTag,
00401 RequestId responseTo );
00402
00403 virtual void consumeOk(const string& consumerTag,
00404 RequestId responseTo );
00405
00406 virtual RequestId deliver(const string& consumerTag,
00407 u_int64_t deliveryTag,
00408 const string& exchange,
00409 const string& queue );
00410
00411 virtual void qosOk( RequestId responseTo );
00412
00413 virtual RequestId return_(u_int16_t replyCode,
00414 const string& replyText,
00415 const string& exchange,
00416 const string& routingKey );
00417 };
00418
00419
00420 class Tunnel
00421 {
00422 private:
00423 ChannelAdapter& channel;
00424
00425 public:
00426
00427
00428 Tunnel(ChannelAdapter& ch) :
00429 channel(ch) {}
00430 virtual ~Tunnel() {}
00431
00432 static Tunnel& get(AMQP_ClientProxy& proxy) { return proxy.getTunnel();}
00433
00434
00435
00436 };
00437
00438
00439 class Tx
00440 {
00441 private:
00442 ChannelAdapter& channel;
00443
00444 public:
00445
00446
00447 Tx(ChannelAdapter& ch) :
00448 channel(ch) {}
00449 virtual ~Tx() {}
00450
00451 static Tx& get(AMQP_ClientProxy& proxy) { return proxy.getTx();}
00452
00453
00454
00455 virtual void commitOk( RequestId responseTo );
00456
00457 virtual void rollbackOk( RequestId responseTo );
00458
00459 virtual void selectOk( RequestId responseTo );
00460 };
00461
00462
00463
00464 Access& getAccess();
00465 Basic& getBasic();
00466 Channel& getChannel();
00467 Connection& getConnection();
00468 Dtx& getDtx();
00469 Exchange& getExchange();
00470 File& getFile();
00471 Message& getMessage();
00472 Queue& getQueue();
00473 Stream& getStream();
00474 Tunnel& getTunnel();
00475 Tx& getTx();
00476
00477 private:
00478
00479
00480 Access accessProxy;
00481 Basic basicProxy;
00482 Channel channelProxy;
00483 Connection connectionProxy;
00484 Dtx dtxProxy;
00485 Exchange exchangeProxy;
00486 File fileProxy;
00487 Message messageProxy;
00488 Queue queueProxy;
00489 Stream streamProxy;
00490 Tunnel tunnelProxy;
00491 Tx txProxy;
00492 };
00493
00494 }
00495 }
00496
00497 #endif