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 _NullMessageStore_ 00022 #define _NullMessageStore_ 00023 00024 #include "BrokerMessage.h" 00025 #include "MessageStore.h" 00026 #include "BrokerQueue.h" 00027 00028 namespace qpid { 00029 namespace broker { 00030 00034 class NullMessageStore : public MessageStore 00035 { 00036 const bool warn; 00037 public: 00038 NullMessageStore(bool warn = false); 00039 00040 virtual std::auto_ptr<TransactionContext> begin(); 00041 virtual std::auto_ptr<TPCTransactionContext> begin(const std::string& xid); 00042 virtual void prepare(TPCTransactionContext& txn); 00043 virtual void commit(TransactionContext& txn); 00044 virtual void abort(TransactionContext& txn); 00045 virtual void collectPreparedXids(std::set<std::string>& xids); 00046 00047 virtual void create(const PersistableQueue& queue); 00048 virtual void destroy(const PersistableQueue& queue); 00049 virtual void create(const PersistableExchange& exchange); 00050 virtual void destroy(const PersistableExchange& exchange); 00051 virtual void recover(RecoveryManager& queues); 00052 virtual void stage(PersistableMessage& msg); 00053 virtual void destroy(PersistableMessage& msg); 00054 virtual void appendContent(PersistableMessage& msg, const std::string& data); 00055 virtual void loadContent(PersistableMessage& msg, std::string& data, uint64_t offset, uint32_t length); 00056 virtual void enqueue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue); 00057 virtual void dequeue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue); 00058 ~NullMessageStore(){} 00059 }; 00060 00061 } 00062 } 00063 00064 00065 #endif