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.broker.jmx;
018
019import org.apache.activemq.network.NetworkConnector;
020
021public 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 getMessageTTL() {
042        return connector.getMessageTTL();
043    }
044
045    public int getConsumerTTL() {
046        return connector.getConsumerTTL();
047    }
048
049    public int getPrefetchSize() {
050        return connector.getPrefetchSize();
051    }
052
053    public String getUserName() {
054        return connector.getUserName();
055    }
056
057    public boolean isBridgeTempDestinations() {
058        return connector.isBridgeTempDestinations();
059    }
060
061    public boolean isConduitSubscriptions() {
062        return connector.isConduitSubscriptions();
063    }
064
065    public boolean isDecreaseNetworkConsumerPriority() {
066        return connector.isDecreaseNetworkConsumerPriority();
067    }
068
069    public boolean isDispatchAsync() {
070        return connector.isDispatchAsync();
071    }
072
073    public boolean isDynamicOnly() {
074        return connector.isDynamicOnly();
075    }
076
077    public boolean isDuplex() {
078        return connector.isDuplex();
079    }
080
081    public boolean isSuppressDuplicateQueueSubscriptions() {
082        return connector.isSuppressDuplicateQueueSubscriptions();
083    }
084
085    public boolean isSuppressDuplicateTopicSubscriptions() {
086        return connector.isSuppressDuplicateTopicSubscriptions();
087    }
088
089    public void setBridgeTempDestinations(boolean bridgeTempDestinations) {
090        connector.setBridgeTempDestinations(bridgeTempDestinations);
091    }
092
093    public void setConduitSubscriptions(boolean conduitSubscriptions) {
094        connector.setConduitSubscriptions(conduitSubscriptions);
095    }
096
097    public void setDispatchAsync(boolean dispatchAsync) {
098        connector.setDispatchAsync(dispatchAsync);
099    }
100
101    public void setDynamicOnly(boolean dynamicOnly) {
102        connector.setDynamicOnly(dynamicOnly);
103    }
104
105    public void setMessageTTL(int messageTTL) {
106        connector.setMessageTTL(messageTTL);
107    }
108
109    public void setConsumerTTL(int consumerTTL) {
110        connector.setConsumerTTL(consumerTTL);
111    }
112
113    public void setPassword(String password) {
114        connector.setPassword(password);
115    }
116
117    public void setPrefetchSize(int prefetchSize) {
118        connector.setPrefetchSize(prefetchSize);
119    }
120
121    public void setUserName(String userName) {
122        connector.setUserName(userName);
123    }
124
125    public String getPassword() {
126        String pw = connector.getPassword();
127        // Hide the password for security reasons.
128        if (pw != null) {
129            pw = pw.replaceAll(".", "*");
130        }
131        return pw;
132    }
133
134    public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority) {
135        connector.setDecreaseNetworkConsumerPriority(decreaseNetworkConsumerPriority);
136    }
137
138    public void setSuppressDuplicateQueueSubscriptions(boolean val) {
139        connector.setSuppressDuplicateQueueSubscriptions(val);
140    }
141
142    public void setSuppressDuplicateTopicSubscriptions(boolean val) {
143        connector.setSuppressDuplicateTopicSubscriptions(val);
144    }
145}