/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/broker/MessageAdapter.h

00001 #ifndef _broker_MessageAdapter_h
00002 #define _broker_MessageAdapter_h
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  * 
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  * 
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include <string>
00026 #include "qpid/framing/BasicPublishBody.h"
00027 #include "qpid/framing/FieldTable.h"
00028 #include "qpid/framing/FrameSet.h"
00029 #include "qpid/framing/DeliveryProperties.h"
00030 #include "qpid/framing/MessageProperties.h"
00031 #include "qpid/framing/MessageTransferBody.h"
00032 #include "qpid/framing/Message010TransferBody.h"
00033 
00034 namespace qpid {        
00035 namespace broker {
00036 
00037 // TODO aconway 2007-11-09: No longer needed, we only have one type of message.
00038 struct MessageAdapter
00039 {
00040     virtual ~MessageAdapter() {}
00041 
00042     virtual std::string getRoutingKey(const framing::FrameSet& f) = 0;
00043     virtual std::string getExchange(const framing::FrameSet& f) = 0;
00044     virtual bool isImmediate(const framing::FrameSet& f) = 0;
00045     virtual const framing::FieldTable* getApplicationHeaders(const framing::FrameSet& f) = 0;
00046     virtual bool isPersistent(const framing::FrameSet& f) = 0;
00047     virtual bool requiresAccept(const framing::FrameSet& f) = 0;    
00048 };
00049 
00050 struct TransferAdapter : MessageAdapter
00051 {
00052     virtual std::string getRoutingKey(const framing::FrameSet& f);
00053     virtual std::string getExchange(const framing::FrameSet& f);
00054     virtual const framing::FieldTable* getApplicationHeaders(const framing::FrameSet& f);
00055     virtual bool isPersistent(const framing::FrameSet& f);
00056     bool isImmediate(const framing::FrameSet&);
00057     bool requiresAccept(const framing::FrameSet& f);    
00058 };
00059 
00060 struct PreviewAdapter : TransferAdapter
00061 {
00062     std::string getExchange(const framing::FrameSet& f);
00063     std::string getRoutingKey(const framing::FrameSet& f);
00064     const framing::FieldTable* getApplicationHeaders(const framing::FrameSet& f);
00065     bool isPersistent(const framing::FrameSet& f);
00066 };
00067 
00068 }}
00069 
00070 
00071 #endif

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7