/*
 *  Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 *  WSO2 Inc. licenses this file to you under the Apache License,
 *  Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.wso2.carbon.apimgt.impl.dto;

import java.util.Properties;

public class EventHubConfigurationDto {
    private boolean enabled = false;
    private String serviceUrl;
    private int initDelay = 0;
    private String username;
    private char[] password;
    private EventHubReceiverConfiguration eventHubReceiverConfiguration;
    private EventHubPublisherConfiguration eventHubPublisherConfiguration ;
    public boolean isEnabled() {

        return enabled;
    }

    public void setEnabled(boolean enabled) {

        this.enabled = enabled;
    }

    public String getServiceUrl() {

        return serviceUrl;
    }

    public void setServiceUrl(String serviceUrl) {

        this.serviceUrl = serviceUrl;
    }

    public int getInitDelay() {

        return initDelay;
    }

    public void setInitDelay(int initDelay) {

        this.initDelay = initDelay;
    }

    public EventHubReceiverConfiguration getEventHubReceiverConfiguration() {

        return eventHubReceiverConfiguration;
    }

    public void setEventHubReceiverConfiguration(
            EventHubReceiverConfiguration eventHubReceiverConfiguration) {

        this.eventHubReceiverConfiguration = eventHubReceiverConfiguration;
    }



    public String getUsername() {

        return username;
    }

    public void setUsername(String username) {

        this.username = username;
    }

    public void setPassword(char[] password) {

        this.password = password;
    }

    public String getPassword() {

        return String.valueOf(password);
    }

    public EventHubPublisherConfiguration getEventHubPublisherConfiguration() {

        return eventHubPublisherConfiguration;
    }

    public void setEventHubPublisherConfiguration(
            EventHubPublisherConfiguration eventHubPublisherConfiguration) {

        this.eventHubPublisherConfiguration = eventHubPublisherConfiguration;
    }

    public static class EventHubReceiverConfiguration {
        private Properties jmsConnectionParameters = new Properties();

        public Properties getJmsConnectionParameters() {

            return jmsConnectionParameters;
        }

        public void setJmsConnectionParameters(Properties jmsConnectionParameters) {

            this.jmsConnectionParameters = jmsConnectionParameters;
        }
    }

    public static class EventHubPublisherConfiguration {

        private String type = "Binary";
        private String receiverUrlGroup = "tcp://localhost:9611";
        private String authUrlGroup = "ssl://localhost:9711";
        private String username = "admin";
        private String password = "admin";

        public String getType() {

            return type;
        }

        public void setType(String type) {

            this.type = type;
        }

        public String getReceiverUrlGroup() {

            return receiverUrlGroup;
        }

        public void setReceiverUrlGroup(String receiverUrlGroup) {

            this.receiverUrlGroup = receiverUrlGroup;
        }

        public String getAuthUrlGroup() {

            return authUrlGroup;
        }

        public void setAuthUrlGroup(String authUrlGroup) {

            this.authUrlGroup = authUrlGroup;
        }

        public String getUsername() {

            return username;
        }

        public void setUsername(String username) {

            this.username = username;
        }

        public String getPassword() {

            return password;
        }

        public void setPassword(String password) {

            this.password = password;
        }
    }

}

@@ -3226,94 +3226,8 @@
 11%22;
-%0A        private String username = %22admin%22;%0A        private String password = %22admin%22;
 %0A%0A  
@@ -3814,368 +3814,8 @@
    %7D
-%0A%0A        public String getUsername() %7B%0A%0A            return username;%0A        %7D%0A%0A        public void setUsername(String username) %7B%0A%0A            this.username = username;%0A        %7D%0A%0A        public String getPassword() %7B%0A%0A            return password;%0A        %7D%0A%0A        public void setPassword(String password) %7B%0A%0A            this.password = password;%0A        %7D
 %0A   

Remove unused hardcoded password and username fields