blob: 4cb7023302788160305569d9349b58fba3991bf1 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
#define ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_
#include <cms/Message.h>
#include <activemq/connector/stomp/commands/StompMessage.h>
#include <activemq/connector/stomp/commands/CommandConstants.h>
namespace activemq{
namespace connector{
namespace stomp{
namespace commands{
/**
* Message command which represents a ActiveMQMessage with no body
* can be sent or recieved.
*/
class MessageCommand : public StompMessage< cms::Message >
{
public:
MessageCommand() :
StompMessage< cms::Message >() {
initialize( getFrame() );
}
MessageCommand( StompFrame* frame ) :
StompMessage< cms::Message >( frame ) {
validate( getFrame() );
}
virtual ~MessageCommand() {}
/**
* Clone this message exactly, returns a new instance that the
* caller is required to delete.
* @return new copy of this message
*/
virtual cms::Message* clone() const {
MessageCommand* command =
new MessageCommand( getFrame().clone() );
command->setAckHandler( this->getAckHandler() );
return command;
}
};
}}}}
#endif /*ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_MESSAGECOMMAND_H_*/