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

00001 /*
00002  *
00003  * Licensed to the Apache Software Foundation (ASF) under one
00004  * or more contributor license agreements.  See the NOTICE file
00005  * distributed with this work for additional information
00006  * regarding copyright ownership.  The ASF licenses this file
00007  * to you under the Apache License, Version 2.0 (the
00008  * "License"); you may not use this file except in compliance
00009  * with the License.  You may obtain a copy of the License at
00010  * 
00011  *   http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing,
00014  * software distributed under the License is distributed on an
00015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00016  * KIND, either express or implied.  See the License for the
00017  * specific language governing permissions and limitations
00018  * under the License.
00019  *
00020  */
00021 #ifndef _MessageStore_
00022 #define _MessageStore_
00023 
00024 #include "PersistableExchange.h"
00025 #include "PersistableMessage.h"
00026 #include "PersistableQueue.h"
00027 #include "RecoveryManager.h"
00028 #include "TransactionalStore.h"
00029 #include "qpid/framing/FieldTable.h"
00030 
00031 #include <qpid/Options.h>
00032 
00033 #include <boost/shared_ptr.hpp>
00034 #include <boost/intrusive_ptr.hpp>
00035 
00036 namespace qpid {
00037 namespace broker {
00038 
00044 class MessageStore : public TransactionalStore, public Recoverable {
00045 public:
00046 
00055         virtual bool init(const Options* options) = 0;
00056 
00060     virtual void create(PersistableQueue& queue,
00061                         const framing::FieldTable& args) = 0;
00065     virtual void destroy(PersistableQueue& queue) = 0;
00066     
00070     virtual void create(const PersistableExchange& exchange,
00071                         const framing::FieldTable& args) = 0;
00075     virtual void destroy(const PersistableExchange& exchange) = 0;
00076     
00080     virtual void bind(const PersistableExchange& exchange, const PersistableQueue& queue, 
00081                       const std::string& key, const framing::FieldTable& args) = 0;
00082 
00086     virtual void unbind(const PersistableExchange& exchange, const PersistableQueue& queue, 
00087                         const std::string& key, const framing::FieldTable& args) = 0;
00088 
00105     virtual void stage(boost::intrusive_ptr<PersistableMessage>& msg) = 0;
00106             
00113     virtual void destroy(PersistableMessage& msg) = 0;
00114 
00118     virtual void appendContent(boost::intrusive_ptr<const PersistableMessage>& msg,
00119                                const std::string& data) = 0;
00120     
00129     virtual void loadContent(const qpid::broker::PersistableQueue& queue, 
00130                                  boost::intrusive_ptr<const PersistableMessage>& msg,
00131                              std::string& data, uint64_t offset, uint32_t length) = 0;
00132     
00147     virtual void enqueue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00148                          const PersistableQueue& queue) = 0;
00149     
00164     virtual void dequeue(TransactionContext* ctxt, boost::intrusive_ptr<PersistableMessage>& msg,
00165                          const PersistableQueue& queue) = 0;
00166 
00175     virtual void flush(const qpid::broker::PersistableQueue& queue)=0;
00176 
00185     virtual u_int32_t outstandingQueueAIO(const PersistableQueue& queue) = 0;
00186 
00187     
00188     virtual ~MessageStore(){}
00189 };
00190 
00191 }
00192 }
00193 
00194 
00195 #endif

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