00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_ 00019 #define _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_ 00020 00021 #include <activemq/util/Config.h> 00022 #include <activemq/util/LongSequenceGenerator.h> 00023 #include <activemq/wireformat/stomp/StompFrame.h> 00024 #include <activemq/commands/Message.h> 00025 #include <activemq/commands/MessageId.h> 00026 #include <activemq/commands/ProducerId.h> 00027 #include <activemq/commands/ConsumerId.h> 00028 #include <activemq/commands/TransactionId.h> 00029 #include <activemq/commands/ActiveMQDestination.h> 00030 #include <decaf/lang/Pointer.h> 00031 00032 namespace activemq { 00033 namespace wireformat { 00034 namespace stomp { 00035 00036 class StompWireFormat; 00037 00038 using decaf::lang::Pointer; 00039 using activemq::commands::Message; 00040 using activemq::commands::MessageId; 00041 using activemq::commands::ProducerId; 00042 using activemq::commands::ConsumerId; 00043 using activemq::commands::TransactionId; 00044 using activemq::commands::ActiveMQDestination; 00045 00051 class StompHelper { 00052 private: 00053 00054 activemq::util::LongSequenceGenerator messageIdGenerator; 00055 StompWireFormat* wireFormat; 00056 00057 private: 00058 00059 StompHelper(const StompHelper&); 00060 StompHelper& operator=(const StompHelper&); 00061 00062 public: 00063 00064 StompHelper(StompWireFormat* wireFormat); 00065 00066 virtual ~StompHelper(); 00067 00068 public: 00069 00077 void convertProperties(const Pointer<StompFrame>& frame, const Pointer<Message>& message); 00078 00086 void convertProperties(const Pointer<Message>& message, const Pointer<StompFrame>& frame); 00087 00094 Pointer<ActiveMQDestination> convertDestination(const std::string& destination); 00095 00102 std::string convertDestination(const Pointer<ActiveMQDestination>& destination); 00103 00110 std::string convertMessageId(const Pointer<MessageId>& messageId); 00111 00118 Pointer<MessageId> convertMessageId(const std::string& messageId); 00119 00126 std::string convertConsumerId(const Pointer<ConsumerId>& consumerId); 00127 00134 Pointer<ConsumerId> convertConsumerId(const std::string& consumerId); 00135 00142 std::string convertProducerId(const Pointer<ProducerId>& producerId); 00143 00150 Pointer<ProducerId> convertProducerId(const std::string& producerId); 00151 00158 std::string convertTransactionId(const Pointer<TransactionId>& transactionId); 00159 00166 Pointer<TransactionId> convertTransactionId(const std::string& transactionId); 00167 00168 }; 00169 00170 }}} 00171 00172 #endif /* _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_ */
1.6.1