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 00030 namespace qpid { 00031 namespace broker { 00032 00038 class MessageStore : public TransactionalStore{ 00039 public: 00043 virtual void create(const PersistableQueue& queue) = 0; 00047 virtual void destroy(const PersistableQueue& queue) = 0; 00048 00052 virtual void create(const PersistableExchange& exchange) = 0; 00056 virtual void destroy(const PersistableExchange& exchange) = 0; 00057 00061 virtual void recover(RecoveryManager& queues) = 0; 00062 00072 virtual void stage(PersistableMessage& msg) = 0; 00073 00080 virtual void destroy(PersistableMessage& msg) = 0; 00081 00085 virtual void appendContent(PersistableMessage& msg, const std::string& data) = 0; 00086 00095 virtual void loadContent(PersistableMessage& msg, std::string& data, uint64_t offset, uint32_t length) = 0; 00096 00108 virtual void enqueue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue) = 0; 00120 virtual void dequeue(TransactionContext* ctxt, PersistableMessage& msg, const PersistableQueue& queue) = 0; 00121 00122 virtual ~MessageStore(){} 00123 }; 00124 00125 } 00126 } 00127 00128 00129 #endif