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.broker.jmx;
018    
019    import org.apache.activemq.network.NetworkConnector;
020    
021    public class NetworkConnectorView implements NetworkConnectorViewMBean {
022    
023        private final NetworkConnector connector;
024    
025        public NetworkConnectorView(NetworkConnector connector) {
026            this.connector = connector;
027        }
028    
029        public void start() throws Exception {
030            connector.start();
031        }
032    
033        public void stop() throws Exception {
034            connector.stop();
035        }
036    
037        public String getName() {
038            return connector.getName();
039        }
040    
041        public int getNetworkTTL() {
042            return connector.getNetworkTTL();
043        }
044    
045        public int getPrefetchSize() {
046            return connector.getPrefetchSize();
047        }
048    
049        public String getUserName() {
050            return connector.getUserName();
051        }
052    
053        public boolean isBridgeTempDestinations() {
054            return connector.isBridgeTempDestinations();
055        }
056    
057        public boolean isConduitSubscriptions() {
058            return connector.isConduitSubscriptions();
059        }
060    
061        public boolean isDecreaseNetworkConsumerPriority() {
062            return connector.isDecreaseNetworkConsumerPriority();
063        }
064    
065        public boolean isDispatchAsync() {
066            return connector.isDispatchAsync();
067        }
068    
069        public boolean isDynamicOnly() {
070            return connector.isDynamicOnly();
071        }
072    
073        public boolean isDuplex() {
074            return connector.isDuplex();
075        }
076    
077        public boolean isSuppressDuplicateQueueSubscriptions() {
078            return connector.isSuppressDuplicateQueueSubscriptions();
079        }
080    
081        public boolean isSuppressDuplicateTopicSubscriptions() {
082            return connector.isSuppressDuplicateTopicSubscriptions();
083        }
084    
085        public void setBridgeTempDestinations(boolean bridgeTempDestinations) {
086            connector.setBridgeTempDestinations(bridgeTempDestinations);
087        }
088    
089        public void setConduitSubscriptions(boolean conduitSubscriptions) {
090            connector.setConduitSubscriptions(conduitSubscriptions);
091        }
092    
093        public void setDispatchAsync(boolean dispatchAsync) {
094            connector.setDispatchAsync(dispatchAsync);
095        }
096    
097        public void setDynamicOnly(boolean dynamicOnly) {
098            connector.setDynamicOnly(dynamicOnly);
099        }
100    
101        public void setNetworkTTL(int networkTTL) {
102            connector.setNetworkTTL(networkTTL);
103        }
104    
105        public void setPassword(String password) {
106            connector.setPassword(password);
107        }
108    
109        public void setPrefetchSize(int prefetchSize) {
110            connector.setPrefetchSize(prefetchSize);
111        }
112    
113        public void setUserName(String userName) {
114            connector.setUserName(userName);
115        }
116    
117        public String getPassword() {
118            String pw = connector.getPassword();
119            // Hide the password for security reasons.
120            if (pw != null) {
121                pw = pw.replaceAll(".", "*");
122            }
123            return pw;
124        }
125    
126        public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority) {
127            connector.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
128        }
129    
130        public void setSuppressDuplicateQueueSubscriptions(boolean val) {
131            connector.setSuppressDuplicateQueueSubscriptions(val);
132        }
133    
134        public void setSuppressDuplicateTopicSubscriptions(boolean val) {
135            connector.setSuppressDuplicateTopicSubscriptions(val);
136        }
137    }