activemq-cpp-3.3.0

src/main/activemq/wireformat/stomp/StompHelper.h

Go to the documentation of this file.
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     using decaf::lang::Pointer;
00037     using activemq::commands::Message;
00038     using activemq::commands::MessageId;
00039     using activemq::commands::ProducerId;
00040     using activemq::commands::ConsumerId;
00041     using activemq::commands::TransactionId;
00042     using activemq::commands::ActiveMQDestination;
00043 
00049     class StompHelper {
00050     private:
00051 
00052         activemq::util::LongSequenceGenerator messageIdGenerator;
00053 
00054     public:
00055 
00056         StompHelper();
00057 
00058         virtual ~StompHelper();
00059 
00060     public:
00061 
00069         void convertProperties( const Pointer<StompFrame>& frame, const Pointer<Message>& message );
00070 
00078         void convertProperties( const Pointer<Message>& message, const Pointer<StompFrame>& frame );
00079 
00086         Pointer<ActiveMQDestination> convertDestination( const std::string& destination );
00087 
00094         std::string convertDestination( const Pointer<ActiveMQDestination>& destination );
00095 
00102         std::string convertMessageId( const Pointer<MessageId>& messageId );
00103 
00110         Pointer<MessageId> convertMessageId( const std::string& messageId );
00111 
00118         std::string convertConsumerId( const Pointer<ConsumerId>& consumerId );
00119 
00126         Pointer<ConsumerId> convertConsumerId( const std::string& consumerId );
00127 
00134         std::string convertProducerId( const Pointer<ProducerId>& producerId );
00135 
00142         Pointer<ProducerId> convertProducerId( const std::string& producerId );
00143 
00150         std::string convertTransactionId( const Pointer<TransactionId>& transactionId );
00151 
00158         Pointer<TransactionId> convertTransactionId( const std::string& transactionId );
00159 
00160     };
00161 
00162 }}}
00163 
00164 #endif /* _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_ */