package cz.senslog.connector.fetch.alapans;

import cz.senslog.connector.model.config.PropertyConfig;

public class AlapansSessionProxyConfig {

    public static class SenslogAuth {
        private final String username, password;

        SenslogAuth(String username, String password) {
            this.username = username;
            this.password = password;
        }

        public String getUsername() {
            return username;
        }

        public String getPassword() {
            return password;
        }
    }

    private final String baseUrl;

    private final String user;
    private final String group;

    private final SenslogAuth senslogAuth;

    public AlapansSessionProxyConfig(PropertyConfig defaultConfig) {
        this.baseUrl = defaultConfig.getStringProperty("baseUrl");
        this.user = defaultConfig.getStringProperty("user");
        this.group = defaultConfig.getStringProperty("group");
        PropertyConfig sensogAuth = defaultConfig.getPropertyConfig("senslogAuth");
        this.senslogAuth = new SenslogAuth(sensogAuth.getStringProperty("username"), sensogAuth.getStringProperty("password"));
    }

    public SenslogAuth getSenslogAuth() {
        return senslogAuth;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public String getUser() {
        return user;
    }

    public String getGroup() {
        return group;
    }
}
