Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

gen/qpid/framing/AMQP_ServerProxy.h

Go to the documentation of this file.
00001 #ifndef QPID_FRAMING_AMQP_SERVERPROXY_H
00002 #define QPID_FRAMING_AMQP_SERVERPROXY_H
00003 /*
00004  *
00005  * Licensed to the Apache Software Foundation (ASF) under one
00006  * or more contributor license agreements.  See the NOTICE file
00007  * distributed with this work for additional information
00008  * regarding copyright ownership.  The ASF licenses this file
00009  * to you under the Apache License, Version 2.0 (the
00010  * "License"); you may not use this file except in compliance
00011  * with the License.  You may obtain a copy of the License at
00012  *
00013  *   http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing,
00016  * software distributed under the License is distributed on an
00017  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00018  * KIND, either express or implied.  See the License for the
00019  * specific language governing permissions and limitations
00020  * under the License.
00021  *
00022  */
00023 
00028 
00029 
00030 #include "qpid/framing/Proxy.h"
00031 #include "qpid/framing/Array.h"
00032 #include "qpid/framing/amqp_types.h"
00033 #include "qpid/framing/amqp_structs.h"
00034 
00035 namespace qpid {
00036 namespace framing {
00037 
00038 class AMQP_ServerProxy:
00039     public Proxy
00040 {
00041   public:
00042     AMQP_ServerProxy(FrameHandler& out);
00043     
00044     class Connection:
00045         public Proxy
00046     {
00047         public:
00048         Connection(FrameHandler& f) : Proxy(f) {}
00049         static Connection& get(AMQP_ServerProxy& proxy) { return proxy.getConnection(); }
00050         virtual void startOk(const FieldTable& clientProperties,
00051                     const string& mechanism,
00052                     const string& response,
00053                     const string& locale);
00054         
00055         virtual void secureOk(const string& response);
00056         
00057         virtual void tuneOk(uint16_t channelMax,
00058                     uint16_t maxFrameSize,
00059                     uint16_t heartbeat);
00060         
00061         virtual void open(const string& virtualHost,
00062                     const Array& capabilities,
00063                     bool insist);
00064         
00065         virtual void heartbeat();
00066         
00067         virtual void close(uint16_t replyCode,
00068                     const string& replyText);
00069         
00070         virtual void closeOk();
00071         
00072     };
00073     
00074     Connection& getConnection() { return connectionProxy; }
00075     
00076     class Session:
00077         public Proxy
00078     {
00079         public:
00080         Session(FrameHandler& f) : Proxy(f) {}
00081         static Session& get(AMQP_ServerProxy& proxy) { return proxy.getSession(); }
00082         virtual void attach(const string& name,
00083                     bool force);
00084         
00085         virtual void attached(const string& name);
00086         
00087         virtual void detach(const string& name);
00088         
00089         virtual void detached(const string& name,
00090                     uint8_t code);
00091         
00092         virtual void requestTimeout(uint32_t timeout);
00093         
00094         virtual void timeout(uint32_t timeout);
00095         
00096         virtual void commandPoint(const SequenceNumber& commandId,
00097                     uint64_t commandOffset);
00098         
00099         virtual void expected(const SequenceSet& commands,
00100                     const Array& fragments);
00101         
00102         virtual void confirmed(const SequenceSet& commands,
00103                     const Array& fragments);
00104         
00105         virtual void completed(const SequenceSet& commands,
00106                     bool timelyReply);
00107         
00108         virtual void knownCompleted(const SequenceSet& commands);
00109         
00110         virtual void flush(bool expected,
00111                     bool confirmed,
00112                     bool completed);
00113         
00114         virtual void gap(const SequenceSet& commands);
00115         
00116     };
00117     
00118     Session& getSession() { return sessionProxy; }
00119     
00120     class Execution:
00121         public Proxy
00122     {
00123         public:
00124         Execution(FrameHandler& f) : Proxy(f) {}
00125         static Execution& get(AMQP_ServerProxy& proxy) { return proxy.getExecution(); }
00126         virtual void sync();
00127         
00128         virtual void result(const SequenceNumber& commandId,
00129                     const string& value);
00130         
00131         virtual void exception(uint16_t errorCode,
00132                     const SequenceNumber& commandId,
00133                     uint8_t classCode,
00134                     uint8_t commandCode,
00135                     uint8_t fieldIndex,
00136                     const string& description,
00137                     const FieldTable& errorInfo);
00138         
00139     };
00140     
00141     Execution& getExecution() { return executionProxy; }
00142     
00143     class Message:
00144         public Proxy
00145     {
00146         public:
00147         Message(FrameHandler& f) : Proxy(f) {}
00148         static Message& get(AMQP_ServerProxy& proxy) { return proxy.getMessage(); }
00149         virtual void transfer(const string& destination,
00150                     uint8_t acceptMode,
00151                     uint8_t acquireMode);
00152         
00153         virtual void accept(const SequenceSet& transfers);
00154         
00155         virtual void reject(const SequenceSet& transfers,
00156                     uint16_t code,
00157                     const string& text);
00158         
00159         virtual void release(const SequenceSet& transfers,
00160                     bool setRedelivered);
00161         
00162         virtual void acquire(const SequenceSet& transfers);
00163         
00164         virtual void resume(const string& destination,
00165                     const string& resumeId);
00166         
00167         virtual void subscribe(const string& queue,
00168                     const string& destination,
00169                     uint8_t acceptMode,
00170                     uint8_t acquireMode,
00171                     bool exclusive,
00172                     const string& resumeId,
00173                     uint64_t resumeTtl,
00174                     const FieldTable& arguments);
00175         
00176         virtual void cancel(const string& destination);
00177         
00178         virtual void setFlowMode(const string& destination,
00179                     uint8_t flowMode);
00180         
00181         virtual void flow(const string& destination,
00182                     uint8_t unit,
00183                     uint32_t value);
00184         
00185         virtual void flush(const string& destination);
00186         
00187         virtual void stop(const string& destination);
00188         
00189     };
00190     
00191     Message& getMessage() { return messageProxy; }
00192     
00193     class Tx:
00194         public Proxy
00195     {
00196         public:
00197         Tx(FrameHandler& f) : Proxy(f) {}
00198         static Tx& get(AMQP_ServerProxy& proxy) { return proxy.getTx(); }
00199         virtual void select();
00200         
00201         virtual void commit();
00202         
00203         virtual void rollback();
00204         
00205     };
00206     
00207     Tx& getTx() { return txProxy; }
00208     
00209     class Dtx:
00210         public Proxy
00211     {
00212         public:
00213         Dtx(FrameHandler& f) : Proxy(f) {}
00214         static Dtx& get(AMQP_ServerProxy& proxy) { return proxy.getDtx(); }
00215         virtual void select();
00216         
00217         virtual void start(const Xid& xid,
00218                     bool join,
00219                     bool resume);
00220         
00221         virtual void end(const Xid& xid,
00222                     bool fail,
00223                     bool suspend);
00224         
00225         virtual void commit(const Xid& xid,
00226                     bool onePhase);
00227         
00228         virtual void forget(const Xid& xid);
00229         
00230         virtual void getTimeout(const Xid& xid);
00231         
00232         virtual void prepare(const Xid& xid);
00233         
00234         virtual void recover();
00235         
00236         virtual void rollback(const Xid& xid);
00237         
00238         virtual void setTimeout(const Xid& xid,
00239                     uint32_t timeout);
00240         
00241     };
00242     
00243     Dtx& getDtx() { return dtxProxy; }
00244     
00245     class Exchange:
00246         public Proxy
00247     {
00248         public:
00249         Exchange(FrameHandler& f) : Proxy(f) {}
00250         static Exchange& get(AMQP_ServerProxy& proxy) { return proxy.getExchange(); }
00251         virtual void declare(const string& exchange,
00252                     const string& type,
00253                     const string& alternateExchange,
00254                     bool passive,
00255                     bool durable,
00256                     bool autoDelete,
00257                     const FieldTable& arguments);
00258         
00259         virtual void delete_(const string& exchange,
00260                     bool ifUnused);
00261         
00262         virtual void query(const string& name);
00263         
00264         virtual void bind(const string& queue,
00265                     const string& exchange,
00266                     const string& bindingKey,
00267                     const FieldTable& arguments);
00268         
00269         virtual void unbind(const string& queue,
00270                     const string& exchange,
00271                     const string& bindingKey);
00272         
00273         virtual void bound(const string& exchange,
00274                     const string& queue,
00275                     const string& bindingKey,
00276                     const FieldTable& arguments);
00277         
00278     };
00279     
00280     Exchange& getExchange() { return exchangeProxy; }
00281     
00282     class Queue:
00283         public Proxy
00284     {
00285         public:
00286         Queue(FrameHandler& f) : Proxy(f) {}
00287         static Queue& get(AMQP_ServerProxy& proxy) { return proxy.getQueue(); }
00288         virtual void declare(const string& queue,
00289                     const string& alternateExchange,
00290                     bool passive,
00291                     bool durable,
00292                     bool exclusive,
00293                     bool autoDelete,
00294                     const FieldTable& arguments);
00295         
00296         virtual void delete_(const string& queue,
00297                     bool ifUnused,
00298                     bool ifEmpty);
00299         
00300         virtual void purge(const string& queue);
00301         
00302         virtual void query(const string& queue);
00303         
00304     };
00305     
00306     Queue& getQueue() { return queueProxy; }
00307     
00308     class File:
00309         public Proxy
00310     {
00311         public:
00312         File(FrameHandler& f) : Proxy(f) {}
00313         static File& get(AMQP_ServerProxy& proxy) { return proxy.getFile(); }
00314         virtual void qos(uint32_t prefetchSize,
00315                     uint16_t prefetchCount,
00316                     bool global);
00317         
00318         virtual void consume(const string& queue,
00319                     const string& consumerTag,
00320                     bool noLocal,
00321                     bool noAck,
00322                     bool exclusive,
00323                     bool nowait,
00324                     const FieldTable& arguments);
00325         
00326         virtual void cancel(const string& consumerTag);
00327         
00328         virtual void open(const string& identifier,
00329                     uint64_t contentSize);
00330         
00331         virtual void openOk(uint64_t stagedSize);
00332         
00333         virtual void stage();
00334         
00335         virtual void publish(const string& exchange,
00336                     const string& routingKey,
00337                     bool mandatory,
00338                     bool immediate,
00339                     const string& identifier);
00340         
00341         virtual void ack(uint64_t deliveryTag,
00342                     bool multiple);
00343         
00344         virtual void reject(uint64_t deliveryTag,
00345                     bool requeue);
00346         
00347     };
00348     
00349     File& getFile() { return fileProxy; }
00350     
00351     class Stream:
00352         public Proxy
00353     {
00354         public:
00355         Stream(FrameHandler& f) : Proxy(f) {}
00356         static Stream& get(AMQP_ServerProxy& proxy) { return proxy.getStream(); }
00357         virtual void qos(uint32_t prefetchSize,
00358                     uint16_t prefetchCount,
00359                     uint32_t consumeRate,
00360                     bool global);
00361         
00362         virtual void consume(const string& queue,
00363                     const string& consumerTag,
00364                     bool noLocal,
00365                     bool exclusive,
00366                     bool nowait,
00367                     const FieldTable& arguments);
00368         
00369         virtual void cancel(const string& consumerTag);
00370         
00371         virtual void publish(const string& exchange,
00372                     const string& routingKey,
00373                     bool mandatory,
00374                     bool immediate);
00375         
00376     };
00377     
00378     Stream& getStream() { return streamProxy; }
00379     
00380     class Cluster:
00381         public Proxy
00382     {
00383         public:
00384         Cluster(FrameHandler& f) : Proxy(f) {}
00385         static Cluster& get(AMQP_ServerProxy& proxy) { return proxy.getCluster(); }
00386     };
00387     
00388     Cluster& getCluster() { return clusterProxy; }
00389     
00390     class ClusterConnection:
00391         public Proxy
00392     {
00393         public:
00394         ClusterConnection(FrameHandler& f) : Proxy(f) {}
00395         static ClusterConnection& get(AMQP_ServerProxy& proxy) { return proxy.getClusterConnection(); }
00396     };
00397     
00398     ClusterConnection& getClusterConnection() { return clusterConnectionProxy; }
00399     
00400   private:
00401     Connection connectionProxy;
00402     Session sessionProxy;
00403     Execution executionProxy;
00404     Message messageProxy;
00405     Tx txProxy;
00406     Dtx dtxProxy;
00407     Exchange exchangeProxy;
00408     Queue queueProxy;
00409     File fileProxy;
00410     Stream streamProxy;
00411     Cluster clusterProxy;
00412     ClusterConnection clusterConnectionProxy;
00413 };
00414 
00415 }} // namespace qpid::framing
00416 
00417 #endif  

Qpid C++ API Reference
Generated on Tue Dec 8 15:39:46 2009 for Qpid C++ Client API by doxygen 1.4.7