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

io.github.dibog.AwsProxyConfig Maven / Gradle / Ivy

The newest version!
package io.github.dibog;

import ch.qos.logback.core.spi.ContextAwareBase;
import software.amazon.awssdk.http.apache.ProxyConfiguration;

import java.net.URI;
import java.util.Arrays;
import java.util.HashSet;

public class AwsProxyConfig extends ContextAwareBase {
    private ProxyConfiguration.Builder builder = ProxyConfiguration.builder();

    public void setEndpoint(String aEndpoint) {
        addInfo("endpoint = "+aEndpoint);
        builder.endpoint(URI.create(aEndpoint));
    }

    public void setNonProxies(String aNonProxies) {
        addInfo("nonProxies = "+aNonProxies);
        String[] nonProxies = aNonProxies.split("[,;|]");
        for(int i=0, size=nonProxies.length;i(Arrays.asList(nonProxies)));
    }

    public void setNtlmDomain(String aProxyDomain) {
        addInfo("ntlmDomain = "+aProxyDomain);
        builder.ntlmDomain(aProxyDomain);
    }

    public void setNtlmWorkstation(String aProxyWorkstation) {
        addInfo("ntlmWorkstation = "+aProxyWorkstation);
        builder.ntlmWorkstation(aProxyWorkstation);
    }

    public void setPassword(String aPassword) {
        addInfo("password = *********");
        builder.password(aPassword);
    }

    public void setPreemptiveBasicAuthenticationEnabled(boolean aPreemptiveBasicAuthenticationEnabled) {
        addInfo("preemptiveBasicAuthenticationEnabled = "+aPreemptiveBasicAuthenticationEnabled);
        builder.preemptiveBasicAuthenticationEnabled(aPreemptiveBasicAuthenticationEnabled);
    }

    public void setUsername(String aUsername) {
        addInfo("username = "+aUsername);
        builder.username(aUsername);
    }

    public void setUseSystemPropertyValues(boolean aUseSystemPropertyValues) {
        addInfo("useSystemPropertyValues = "+aUseSystemPropertyValues);
        builder.useSystemPropertyValues(aUseSystemPropertyValues);
    }

    public ProxyConfiguration build() {
        return builder.build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy