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;
018    
019    import java.util.List;
020    
021    import org.apache.activemq.command.ActiveMQDestination;
022    
023    /**
024     * Configuration for a NetworkBridge
025     * 
026     * @version $Revision: 1.1 $
027     */
028    public class NetworkBridgeConfiguration {
029    
030        private boolean conduitSubscriptions = true;
031        private boolean dynamicOnly;
032        private boolean dispatchAsync = true;
033        private boolean decreaseNetworkConsumerPriority;
034        private boolean duplex;
035        private boolean bridgeTempDestinations = true;
036        private int prefetchSize = 1000;
037        private int networkTTL = 1;
038        private String brokerName = "localhost";
039        private String userName;
040        private String password;
041        private String destinationFilter = ">";
042        private String name = null;
043        
044        private List<ActiveMQDestination> excludedDestinations;
045        private List<ActiveMQDestination> dynamicallyIncludedDestinations;
046        private List<ActiveMQDestination> staticallyIncludedDestinations;
047    
048        private boolean suppressDuplicateQueueSubscriptions = false;
049    
050    
051        /**
052         * @return the conduitSubscriptions
053         */
054        public boolean isConduitSubscriptions() {
055            return this.conduitSubscriptions;
056        }
057    
058        /**
059         * @param conduitSubscriptions the conduitSubscriptions to set
060         */
061        public void setConduitSubscriptions(boolean conduitSubscriptions) {
062            this.conduitSubscriptions = conduitSubscriptions;
063        }
064    
065        /**
066         * @return the dynamicOnly
067         */
068        public boolean isDynamicOnly() {
069            return this.dynamicOnly;
070        }
071    
072        /**
073         * @param dynamicOnly the dynamicOnly to set
074         */
075        public void setDynamicOnly(boolean dynamicOnly) {
076            this.dynamicOnly = dynamicOnly;
077        }
078    
079        /**
080         * @return the bridgeTempDestinations
081         */
082        public boolean isBridgeTempDestinations() {
083            return this.bridgeTempDestinations;
084        }
085    
086        /**
087         * @param bridgeTempDestinations the bridgeTempDestinations to set
088         */
089        public void setBridgeTempDestinations(boolean bridgeTempDestinations) {
090            this.bridgeTempDestinations = bridgeTempDestinations;
091        }
092    
093        /**
094         * @return the decreaseNetworkConsumerPriority
095         */
096        public boolean isDecreaseNetworkConsumerPriority() {
097            return this.decreaseNetworkConsumerPriority;
098        }
099    
100        /**
101         * @param decreaseNetworkConsumerPriority the
102         *                decreaseNetworkConsumerPriority to set
103         */
104        public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority) {
105            this.decreaseNetworkConsumerPriority = decreaseNetworkConsumerPriority;
106        }
107    
108        /**
109         * @return the dispatchAsync
110         */
111        public boolean isDispatchAsync() {
112            return this.dispatchAsync;
113        }
114    
115        /**
116         * @param dispatchAsync the dispatchAsync to set
117         */
118        public void setDispatchAsync(boolean dispatchAsync) {
119            this.dispatchAsync = dispatchAsync;
120        }
121    
122        /**
123         * @return the duplex
124         */
125        public boolean isDuplex() {
126            return this.duplex;
127        }
128    
129        /**
130         * @param duplex the duplex to set
131         */
132        public void setDuplex(boolean duplex) {
133            this.duplex = duplex;
134        }
135    
136        /**
137         * @return the brokerName
138         */
139        public String getBrokerName() {
140            return this.brokerName;
141        }
142    
143        /**
144         * @param brokerName the localBrokerName to set
145         */
146        public void setBrokerName(String brokerName) {
147            this.brokerName = brokerName;
148        }
149    
150        /**
151         * @return the networkTTL
152         */
153        public int getNetworkTTL() {
154            return this.networkTTL;
155        }
156    
157        /**
158         * @param networkTTL the networkTTL to set
159         */
160        public void setNetworkTTL(int networkTTL) {
161            this.networkTTL = networkTTL;
162        }
163    
164        /**
165         * @return the password
166         */
167        public String getPassword() {
168            return this.password;
169        }
170    
171        /**
172         * @param password the password to set
173         */
174        public void setPassword(String password) {
175            this.password = password;
176        }
177    
178        /**
179         * @return the prefetchSize
180         */
181        public int getPrefetchSize() {
182            return this.prefetchSize;
183        }
184    
185        /**
186         * @param prefetchSize the prefetchSize to set
187         */
188        public void setPrefetchSize(int prefetchSize) {
189            this.prefetchSize = prefetchSize;
190        }
191    
192        /**
193         * @return the userName
194         */
195        public String getUserName() {
196            return this.userName;
197        }
198    
199        /**
200         * @param userName the userName to set
201         */
202        public void setUserName(String userName) {
203            this.userName = userName;
204        }
205    
206        /**
207         * @return the destinationFilter
208         */
209        public String getDestinationFilter() {
210            return this.destinationFilter;
211        }
212    
213        /**
214         * @param destinationFilter the destinationFilter to set
215         */
216        public void setDestinationFilter(String destinationFilter) {
217            this.destinationFilter = destinationFilter;
218        }
219    
220        /**
221         * @return the name
222         */
223        public String getName() {
224            if(this.name == null) {
225                this.name = "localhost";
226            }
227            return this.name;
228        }
229    
230        /**
231         * @param name the name to set
232         */
233        public void setName(String name) {
234            this.name = name;
235        }
236    
237            public List<ActiveMQDestination> getExcludedDestinations() {
238                    return excludedDestinations;
239            }
240    
241            public void setExcludedDestinations(
242                            List<ActiveMQDestination> excludedDestinations) {
243                    this.excludedDestinations = excludedDestinations;
244            }
245    
246            public List<ActiveMQDestination> getDynamicallyIncludedDestinations() {
247                    return dynamicallyIncludedDestinations;
248            }
249    
250            public void setDynamicallyIncludedDestinations(
251                            List<ActiveMQDestination> dynamicallyIncludedDestinations) {
252                    this.dynamicallyIncludedDestinations = dynamicallyIncludedDestinations;
253            }
254    
255            public List<ActiveMQDestination> getStaticallyIncludedDestinations() {
256                    return staticallyIncludedDestinations;
257            }
258    
259            public void setStaticallyIncludedDestinations(
260                            List<ActiveMQDestination> staticallyIncludedDestinations) {
261                    this.staticallyIncludedDestinations = staticallyIncludedDestinations;
262            }
263            
264        
265    
266        public boolean isSuppressDuplicateQueueSubscriptions() {
267            return suppressDuplicateQueueSubscriptions;
268        }
269        
270        /**
271         * 
272         * @param val if true, duplicate network queue subscriptions (in a cyclic network) will be suppressed
273         */
274        public void setSuppressDuplicateQueueSubscriptions(boolean val) {
275            suppressDuplicateQueueSubscriptions = val;
276        }
277    }