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 */
017 package org.apache.activemq.network.jms;
018
019 /**
020 * Create an Inbound Topic Bridge. By default this class uses the topic name for
021 * both the inbound and outbound topic. This behavior can be overridden however
022 * by using the setter methods to configure both the inbound and outboud topic names
023 * separately.
024 *
025 * @org.apache.xbean.XBean
026 */
027 public class InboundTopicBridge extends TopicBridge {
028
029 String inboundTopicName;
030 String localTopicName;
031
032 /**
033 * Constructor that takes a foreign destination as an argument
034 *
035 * @param inboundTopicName
036 */
037 public InboundTopicBridge(String inboundTopicName) {
038 this.inboundTopicName = inboundTopicName;
039 this.localTopicName = inboundTopicName;
040 }
041
042 /**
043 * Default Constructor
044 */
045 public InboundTopicBridge() {
046 }
047
048 /**
049 * @return Returns the outboundTopicName.
050 */
051 public String getInboundTopicName() {
052 return inboundTopicName;
053 }
054
055 /**
056 * Sets the topic name used for the inbound topic, if the outbound topic
057 * name has not been set, then this method uses the same name to configure
058 * the outbound topic name.
059 *
060 * @param inboundTopicName
061 */
062 public void setInboundTopicName(String inboundTopicName) {
063 this.inboundTopicName = inboundTopicName;
064 if (this.localTopicName == null) {
065 this.localTopicName = inboundTopicName;
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 }