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