/home/aconway/svn/qpid/cpp/src/qpid/client/MessageChannel.h

00001 #ifndef _client_MessageChannel_h
00002 #define _client_MessageChannel_h
00003 
00004 /*
00005  *
00006  * Copyright (c) 2006 The Apache Software Foundation
00007  *
00008  * Licensed under the Apache License, Version 2.0 (the "License");
00009  * you may not use this file except in compliance with the License.
00010  * You may obtain a copy of the License at
00011  *
00012  *    http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  *
00020  */
00021 
00022 #include "qpid/shared_ptr.h"
00023 #include "qpid/sys/Runnable.h"
00024 #include "AckMode.h"
00025 
00026 namespace qpid {
00027 
00028 namespace framing {
00029 class AMQMethodBody;
00030 class AMQHeaderBody;
00031 class AMQContentBody;
00032 class FieldTable;
00033 }
00034 
00035 namespace client {
00036 
00037 class Channel;
00038 class Message;
00039 class Queue;
00040 class Exchange;
00041 class MessageListener;
00042 class ReturnedMessageHandler;
00043 
00049 class MessageChannel : public sys::Runnable
00050 {
00051   public:
00053     virtual void consume(
00054         Queue& queue, std::string& tag, MessageListener* listener, 
00055         AckMode ackMode = NO_ACK, bool noLocal = false, bool synch = true,
00056         const framing::FieldTable* fields = 0) = 0;
00057         
00059     virtual void cancel(const std::string& tag, bool synch = true) = 0;
00060 
00062     virtual bool get(
00063         Message& msg, const Queue& queue, AckMode ackMode = NO_ACK) = 0;
00064 
00066     virtual void publish(const Message& msg, const Exchange& exchange,
00067                  const std::string& routingKey, 
00068                  bool mandatory = false, bool immediate = false) = 0;
00069 
00071     virtual void setReturnedMessageHandler(
00072         ReturnedMessageHandler* handler) = 0;
00073 
00075     virtual void handle(shared_ptr<framing::AMQMethodBody>) = 0;
00076 
00078     virtual void handle(shared_ptr<framing::AMQHeaderBody>) = 0;
00079 
00081     virtual void handle(shared_ptr<framing::AMQContentBody>) = 0;
00082     
00084     virtual void setQos() = 0;
00085 
00087     virtual void close() = 0;
00088 };
00089 
00090 }} // namespace qpid::client
00091 
00092 
00093 
00094 #endif  

Generated on Tue Apr 17 14:22:03 2007 for Qpid by  doxygen 1.4.7