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.network.jms;
018
019/**
020 * Create an Outbound Topic Bridge.  By default the bridge uses the same
021 * name for both the inbound and outbound topics, however this can be altered
022 * by using the public setter methods to configure both inbound and outbound
023 * topic names.
024 *
025 * @org.apache.xbean.XBean
026 */
027public class OutboundTopicBridge extends TopicBridge {
028
029    String outboundTopicName;
030    String localTopicName;
031
032    /**
033     * Constructor that takes a foreign destination as an argument
034     *
035     * @param outboundTopicName
036     */
037    public OutboundTopicBridge(String outboundTopicName) {
038        this.outboundTopicName = outboundTopicName;
039        this.localTopicName = outboundTopicName;
040    }
041
042    /**
043     * Default Contructor
044     */
045    public OutboundTopicBridge() {
046    }
047
048    /**
049     * @return Returns the outboundTopicName.
050     */
051    public String getOutboundTopicName() {
052        return outboundTopicName;
053    }
054
055    /**
056     * Sets the name of the outbound topic name.  If the inbound topic name
057     * has not been set already then this method uses the provided topic name
058     * to set the inbound topic name as well.
059     *
060     * @param outboundTopicName The outboundTopicName to set.
061     */
062    public void setOutboundTopicName(String outboundTopicName) {
063        this.outboundTopicName = outboundTopicName;
064        if (this.localTopicName == null) {
065            this.localTopicName = outboundTopicName;
066        }
067    }
068
069    /**
070     * @return the localTopicName
071     */
072    public String getLocalTopicName() {
073        return localTopicName;
074    }
075
076    /**
077     * @param localTopicName the localTopicName to set
078     */
079    public void setLocalTopicName(String localTopicName) {
080        this.localTopicName = localTopicName;
081    }
082
083}