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_ServerProxy__
00029 #define qpid_framing_AMQP_ServerProxy__
00030
00031 #include "qpid/framing/Proxy.h"
00032
00033 namespace qpid {
00034 namespace framing {
00035
00036 class AMQP_ServerProxy : public Proxy
00037 {
00038 public:
00039 AMQP_ServerProxy(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_ServerProxy& proxy) { return proxy.getAccess();}
00057
00058
00059
00060 virtual RequestId request(const string& realm,
00061 bool exclusive,
00062 bool passive,
00063 bool active,
00064 bool write,
00065 bool read );
00066 };
00067
00068
00069 class Basic
00070 {
00071 private:
00072 ChannelAdapter& channel;
00073
00074 public:
00075
00076
00077 Basic(ChannelAdapter& ch) :
00078 channel(ch) {}
00079 virtual ~Basic() {}
00080
00081 static Basic& get(AMQP_ServerProxy& proxy) { return proxy.getBasic();}
00082
00083
00084
00085 virtual RequestId ack(u_int64_t deliveryTag,
00086 bool multiple );
00087
00088 virtual RequestId cancel(const string& consumerTag,
00089 bool nowait );
00090
00091 virtual RequestId consume(u_int16_t ticket,
00092 const string& queue,
00093 const string& consumerTag,
00094 bool noLocal,
00095 bool noAck,
00096 bool exclusive,
00097 bool nowait,
00098 const FieldTable& filter );
00099
00100 virtual RequestId get(u_int16_t ticket,
00101 const string& queue,
00102 bool noAck );
00103
00104 virtual RequestId publish(u_int16_t ticket,
00105 const string& exchange,
00106 const string& routingKey,
00107 bool mandatory,
00108 bool immediate );
00109
00110 virtual RequestId qos(u_int32_t prefetchSize,
00111 u_int16_t prefetchCount,
00112 bool global );
00113
00114 virtual RequestId recover(bool requeue );
00115
00116 virtual RequestId reject(u_int64_t deliveryTag,
00117 bool requeue );
00118 };
00119
00120
00121 class Channel
00122 {
00123 private:
00124 ChannelAdapter& channel;
00125
00126 public:
00127
00128
00129 Channel(ChannelAdapter& ch) :
00130 channel(ch) {}
00131 virtual ~Channel() {}
00132
00133 static Channel& get(AMQP_ServerProxy& proxy) { return proxy.getChannel();}
00134
00135
00136
00137 virtual RequestId close(u_int16_t replyCode,
00138 const string& replyText,
00139 u_int16_t classId,
00140 u_int16_t methodId );
00141
00142 virtual void closeOk( RequestId responseTo );
00143
00144 virtual RequestId flow(bool active );
00145
00146 virtual void flowOk(bool active,
00147 RequestId responseTo );
00148
00149 virtual void ok( RequestId responseTo );
00150
00151 virtual RequestId open(const string& outOfBand );
00152
00153 virtual RequestId ping( );
00154
00155 virtual RequestId pong( );
00156
00157 virtual RequestId resume(const string& channelId );
00158 };
00159
00160
00161 class Connection
00162 {
00163 private:
00164 ChannelAdapter& channel;
00165
00166 public:
00167
00168
00169 Connection(ChannelAdapter& ch) :
00170 channel(ch) {}
00171 virtual ~Connection() {}
00172
00173 static Connection& get(AMQP_ServerProxy& proxy) { return proxy.getConnection();}
00174
00175
00176
00177 virtual RequestId close(u_int16_t replyCode,
00178 const string& replyText,
00179 u_int16_t classId,
00180 u_int16_t methodId );
00181
00182 virtual void closeOk( RequestId responseTo );
00183
00184 virtual RequestId open(const string& virtualHost,
00185 const string& capabilities,
00186 bool insist );
00187
00188 virtual void secureOk(const string& response,
00189 RequestId responseTo );
00190
00191 virtual void startOk(const FieldTable& clientProperties,
00192 const string& mechanism,
00193 const string& response,
00194 const string& locale,
00195 RequestId responseTo );
00196
00197 virtual void tuneOk(u_int16_t channelMax,
00198 u_int32_t frameMax,
00199 u_int16_t heartbeat,
00200 RequestId responseTo );
00201 };
00202
00203
00204 class Dtx
00205 {
00206 private:
00207 ChannelAdapter& channel;
00208
00209 public:
00210
00211
00212 Dtx(ChannelAdapter& ch) :
00213 channel(ch) {}
00214 virtual ~Dtx() {}
00215
00216 static Dtx& get(AMQP_ServerProxy& proxy) { return proxy.getDtx();}
00217
00218
00219
00220 virtual RequestId select( );
00221
00222 virtual RequestId start(const string& dtxIdentifier );
00223 };
00224
00225
00226 class Exchange
00227 {
00228 private:
00229 ChannelAdapter& channel;
00230
00231 public:
00232
00233
00234 Exchange(ChannelAdapter& ch) :
00235 channel(ch) {}
00236 virtual ~Exchange() {}
00237
00238 static Exchange& get(AMQP_ServerProxy& proxy) { return proxy.getExchange();}
00239
00240
00241
00242 virtual RequestId declare(u_int16_t ticket,
00243 const string& exchange,
00244 const string& type,
00245 bool passive,
00246 bool durable,
00247 bool autoDelete,
00248 bool internal,
00249 bool nowait,
00250 const FieldTable& arguments );
00251
00252 virtual RequestId delete_(u_int16_t ticket,
00253 const string& exchange,
00254 bool ifUnused,
00255 bool nowait );
00256 };
00257
00258
00259 class File
00260 {
00261 private:
00262 ChannelAdapter& channel;
00263
00264 public:
00265
00266
00267 File(ChannelAdapter& ch) :
00268 channel(ch) {}
00269 virtual ~File() {}
00270
00271 static File& get(AMQP_ServerProxy& proxy) { return proxy.getFile();}
00272
00273
00274
00275 virtual RequestId ack(u_int64_t deliveryTag,
00276 bool multiple );
00277
00278 virtual RequestId cancel(const string& consumerTag,
00279 bool nowait );
00280
00281 virtual RequestId consume(u_int16_t ticket,
00282 const string& queue,
00283 const string& consumerTag,
00284 bool noLocal,
00285 bool noAck,
00286 bool exclusive,
00287 bool nowait,
00288 const FieldTable& filter );
00289
00290 virtual RequestId open(const string& identifier,
00291 u_int64_t contentSize );
00292
00293 virtual void openOk(u_int64_t stagedSize,
00294 RequestId responseTo );
00295
00296 virtual RequestId publish(u_int16_t ticket,
00297 const string& exchange,
00298 const string& routingKey,
00299 bool mandatory,
00300 bool immediate,
00301 const string& identifier );
00302
00303 virtual RequestId qos(u_int32_t prefetchSize,
00304 u_int16_t prefetchCount,
00305 bool global );
00306
00307 virtual RequestId reject(u_int64_t deliveryTag,
00308 bool requeue );
00309
00310 virtual void stage( RequestId responseTo );
00311 };
00312
00313
00314 class Message
00315 {
00316 private:
00317 ChannelAdapter& channel;
00318
00319 public:
00320
00321
00322 Message(ChannelAdapter& ch) :
00323 channel(ch) {}
00324 virtual ~Message() {}
00325
00326 static Message& get(AMQP_ServerProxy& proxy) { return proxy.getMessage();}
00327
00328
00329
00330 virtual RequestId append(const string& reference,
00331 const string& bytes );
00332
00333 virtual RequestId cancel(const string& destination );
00334
00335 virtual RequestId checkpoint(const string& reference,
00336 const string& identifier );
00337
00338 virtual RequestId close(const string& reference );
00339
00340 virtual RequestId consume(u_int16_t ticket,
00341 const string& queue,
00342 const string& destination,
00343 bool noLocal,
00344 bool noAck,
00345 bool exclusive,
00346 const FieldTable& filter );
00347
00348 virtual void empty( RequestId responseTo );
00349
00350 virtual RequestId get(u_int16_t ticket,
00351 const string& queue,
00352 const string& destination,
00353 bool noAck );
00354
00355 virtual void offset(u_int64_t value,
00356 RequestId responseTo );
00357
00358 virtual void ok( RequestId responseTo );
00359
00360 virtual RequestId open(const string& reference );
00361
00362 virtual RequestId qos(u_int32_t prefetchSize,
00363 u_int16_t prefetchCount,
00364 bool global );
00365
00366 virtual RequestId recover(bool requeue );
00367
00368 virtual void reject(u_int16_t code,
00369 const string& text,
00370 RequestId responseTo );
00371
00372 virtual RequestId resume(const string& reference,
00373 const string& identifier );
00374
00375 virtual RequestId transfer(u_int16_t ticket,
00376 const string& destination,
00377 bool redelivered,
00378 bool immediate,
00379 u_int64_t ttl,
00380 u_int8_t priority,
00381 u_int64_t timestamp,
00382 u_int8_t deliveryMode,
00383 u_int64_t expiration,
00384 const string& exchange,
00385 const string& routingKey,
00386 const string& messageId,
00387 const string& correlationId,
00388 const string& replyTo,
00389 const string& contentType,
00390 const string& contentEncoding,
00391 const string& userId,
00392 const string& appId,
00393 const string& transactionId,
00394 const string& securityToken,
00395 const FieldTable& applicationHeaders,
00396 const Content& body,
00397 bool mandatory );
00398 };
00399
00400
00401 class Queue
00402 {
00403 private:
00404 ChannelAdapter& channel;
00405
00406 public:
00407
00408
00409 Queue(ChannelAdapter& ch) :
00410 channel(ch) {}
00411 virtual ~Queue() {}
00412
00413 static Queue& get(AMQP_ServerProxy& proxy) { return proxy.getQueue();}
00414
00415
00416
00417 virtual RequestId bind(u_int16_t ticket,
00418 const string& queue,
00419 const string& exchange,
00420 const string& routingKey,
00421 bool nowait,
00422 const FieldTable& arguments );
00423
00424 virtual RequestId declare(u_int16_t ticket,
00425 const string& queue,
00426 bool passive,
00427 bool durable,
00428 bool exclusive,
00429 bool autoDelete,
00430 bool nowait,
00431 const FieldTable& arguments );
00432
00433 virtual RequestId delete_(u_int16_t ticket,
00434 const string& queue,
00435 bool ifUnused,
00436 bool ifEmpty,
00437 bool nowait );
00438
00439 virtual RequestId purge(u_int16_t ticket,
00440 const string& queue,
00441 bool nowait );
00442
00443 virtual RequestId unbind(u_int16_t ticket,
00444 const string& queue,
00445 const string& exchange,
00446 const string& routingKey,
00447 const FieldTable& arguments );
00448 };
00449
00450
00451 class Stream
00452 {
00453 private:
00454 ChannelAdapter& channel;
00455
00456 public:
00457
00458
00459 Stream(ChannelAdapter& ch) :
00460 channel(ch) {}
00461 virtual ~Stream() {}
00462
00463 static Stream& get(AMQP_ServerProxy& proxy) { return proxy.getStream();}
00464
00465
00466
00467 virtual RequestId cancel(const string& consumerTag,
00468 bool nowait );
00469
00470 virtual RequestId consume(u_int16_t ticket,
00471 const string& queue,
00472 const string& consumerTag,
00473 bool noLocal,
00474 bool exclusive,
00475 bool nowait,
00476 const FieldTable& filter );
00477
00478 virtual RequestId publish(u_int16_t ticket,
00479 const string& exchange,
00480 const string& routingKey,
00481 bool mandatory,
00482 bool immediate );
00483
00484 virtual RequestId qos(u_int32_t prefetchSize,
00485 u_int16_t prefetchCount,
00486 u_int32_t consumeRate,
00487 bool global );
00488 };
00489
00490
00491 class Tunnel
00492 {
00493 private:
00494 ChannelAdapter& channel;
00495
00496 public:
00497
00498
00499 Tunnel(ChannelAdapter& ch) :
00500 channel(ch) {}
00501 virtual ~Tunnel() {}
00502
00503 static Tunnel& get(AMQP_ServerProxy& proxy) { return proxy.getTunnel();}
00504
00505
00506
00507 virtual RequestId request(const FieldTable& metaData );
00508 };
00509
00510
00511 class Tx
00512 {
00513 private:
00514 ChannelAdapter& channel;
00515
00516 public:
00517
00518
00519 Tx(ChannelAdapter& ch) :
00520 channel(ch) {}
00521 virtual ~Tx() {}
00522
00523 static Tx& get(AMQP_ServerProxy& proxy) { return proxy.getTx();}
00524
00525
00526
00527 virtual RequestId commit( );
00528
00529 virtual RequestId rollback( );
00530
00531 virtual RequestId select( );
00532 };
00533
00534
00535
00536 Access& getAccess();
00537 Basic& getBasic();
00538 Channel& getChannel();
00539 Connection& getConnection();
00540 Dtx& getDtx();
00541 Exchange& getExchange();
00542 File& getFile();
00543 Message& getMessage();
00544 Queue& getQueue();
00545 Stream& getStream();
00546 Tunnel& getTunnel();
00547 Tx& getTx();
00548
00549 private:
00550
00551
00552 Access accessProxy;
00553 Basic basicProxy;
00554 Channel channelProxy;
00555 Connection connectionProxy;
00556 Dtx dtxProxy;
00557 Exchange exchangeProxy;
00558 File fileProxy;
00559 Message messageProxy;
00560 Queue queueProxy;
00561 Stream streamProxy;
00562 Tunnel tunnelProxy;
00563 Tx txProxy;
00564 };
00565
00566 }
00567 }
00568
00569 #endif