All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scouterx.webapp.framework.configure.StandAloneConfigureAdaptor Maven / Gradle / Ivy

There is a newer version: 2.20.0
Show newest version
/*
 *  Copyright 2015 the original author or authors.
 *  @https://github.com/scouter-project/scouter
 *
 *  Licensed 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 scouterx.webapp.framework.configure;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author Gun Lee ([email protected]) on 2017. 8. 26.
 */
public class StandAloneConfigureAdaptor implements ConfigureAdaptor {
    private static StandAloneConfigure conf = StandAloneConfigure.getInstance();

    private static StandAloneConfigureAdaptor instance = new StandAloneConfigureAdaptor();

    public static StandAloneConfigureAdaptor getInstance() {
        return instance;
    }

    private StandAloneConfigureAdaptor() {}

    @Override
    public String getLogDir() {
        return conf.log_dir;
    }

    @Override
    public int getLogKeepDays() {
        return conf.log_keep_days;
    }

    @Override
    public int getNetHttpPort() {
        return conf.net_http_port;
    }

    @Override
    public boolean isNetHttpApiAuthIpEnabled() {
        return conf.net_http_api_auth_ip_enabled;
    }

    @Override
    public boolean isNetHttpApiAuthSessionEnabled() {
        return conf.net_http_api_auth_session_enabled;
    }

    @Override
    public boolean isNetHttpApiAuthBearerTokenEnabled() {
        return conf.net_http_api_auth_bearer_token_enabled;
    }

    @Override
    public Set getNetHttpApiAllowIps() {
        return Stream.of(conf.net_http_api_allow_ips.split(",")).collect(Collectors.toSet());
    }

    @Override
    public String getNetHttpApiAuthIpHeaderKey() {
        return conf.net_http_api_auth_ip_header_key;
    }

    @Override
    public int getNetHttpApiSessionTimeout() {
        return conf.net_http_api_session_timeout;
    }

    @Override
    public List getServerConfigs() {
        return conf.getServerConfigs();
    }

    @Override
    public String getTempDir() {
        return conf.temp_dir;
    }

    @Override
    public boolean isTrace() {
        return conf._trace;
    }

    @Override
    public int getNetWebappTcpClientPoolSize() {
        return conf.net_webapp_tcp_client_pool_size;
    }

    @Override
    public int getNetWebappTcpClientPoolTimeout() {
        return conf.net_webapp_tcp_client_pool_timeout;
    }

    @Override
    public boolean isNetHttpApiSwaggerEnabled() {
        return conf.net_http_api_swagger_enabled;
    }

    @Override
    public String getNetHttpApiSwaggerHostIp() {
        return conf.net_http_api_swagger_host_ip;
    }

    @Override
    public String getNetHttpApiCorsAllowOrigin() {
        return conf.net_http_api_cors_allow_origin;
    }

    @Override
    public String getNetHttpApiCorsAllowCredentials() {
        return conf.net_http_api_cors_allow_credentials;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy