001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.command;
018
019import javax.jms.JMSException;
020import javax.jms.Topic;
021
022/**
023 * @org.apache.xbean.XBean element="topic" description="An ActiveMQ Topic
024 *                         Destination"
025 * @openwire:marshaller code="101"
026 * 
027 */
028public class ActiveMQTopic extends ActiveMQDestination implements Topic {
029
030    public static final byte DATA_STRUCTURE_TYPE = CommandTypes.ACTIVEMQ_TOPIC;
031    private static final long serialVersionUID = 7300307405896488588L;
032
033    public ActiveMQTopic() {
034    }
035
036    public ActiveMQTopic(String name) {
037        super(name);
038    }
039
040    public byte getDataStructureType() {
041        return DATA_STRUCTURE_TYPE;
042    }
043
044    public boolean isTopic() {
045        return true;
046    }
047
048    public String getTopicName() throws JMSException {
049        return getPhysicalName();
050    }
051
052    public byte getDestinationType() {
053        return TOPIC_TYPE;
054    }
055
056    protected String getQualifiedPrefix() {
057        return TOPIC_QUALIFIED_PREFIX;
058    }
059
060}