Java Code Examples for com.amazonaws.ClientConfiguration#setNonProxyHosts()

The following examples show how to use com.amazonaws.ClientConfiguration#setNonProxyHosts() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProxyConfiguration.java    From pipeline-aws-plugin with Apache License 2.0 6 votes vote down vote up
private static void useJenkinsProxy(ClientConfiguration config) {
	if (Jenkins.getInstance() != null) {
		hudson.ProxyConfiguration proxyConfiguration = Jenkins.getInstance().proxy;
		if (proxyConfiguration != null) {
			config.setProxyHost(proxyConfiguration.name);
			config.setProxyPort(proxyConfiguration.port);
			config.setProxyUsername(proxyConfiguration.getUserName());
			config.setProxyPassword(proxyConfiguration.getPassword());

			if (proxyConfiguration.noProxyHost != null) {
				String[] noProxyParts = proxyConfiguration.noProxyHost.split("[ \t\n,|]+");
				config.setNonProxyHosts(Joiner.on('|').join(noProxyParts));
			}
		}
	}
}
 
Example 2
Source File: LambdaClientConfig.java    From aws-lambda-jenkins-plugin with MIT License 6 votes vote down vote up
private ClientConfiguration getClientConfiguration() {
    /*
    Jenkins instance = Jenkins.getInstance();

    if (instance != null) {
        ProxyConfiguration proxy = instance.proxy;
    */
    ClientConfiguration config = new ClientConfiguration();

    if (proxyConfiguration != null) {
        config.setProxyHost(proxyConfiguration.name);
        config.setProxyPort(proxyConfiguration.port);
        if (proxyConfiguration.getUserName() != null) {
            config.setProxyUsername(proxyConfiguration.getUserName());
            config.setProxyPassword(proxyConfiguration.getPassword());
        }
        if (proxyConfiguration.noProxyHost != null) {
            config.setNonProxyHosts(proxyConfiguration.noProxyHost);
        }
    }

    return config;

}
 
Example 3
Source File: HttpUtil.java    From snowflake-jdbc with Apache License 2.0 5 votes vote down vote up
public static void setProxyForS3(ClientConfiguration clientConfig)
{
  if (useProxy)
  {
    clientConfig.setProxyHost(proxyHost);
    clientConfig.setProxyPort(proxyPort);
    clientConfig.setNonProxyHosts(nonProxyHosts);
    if (!Strings.isNullOrEmpty(proxyUser) && !Strings.isNullOrEmpty(proxyPassword))
    {
      clientConfig.setProxyUsername(proxyUser);
      clientConfig.setProxyPassword(proxyPassword);
    }
  }
}
 
Example 4
Source File: ProxyConfiguration.java    From pipeline-aws-plugin with Apache License 2.0 4 votes vote down vote up
private static void configureNonProxyHosts(EnvVars vars, ClientConfiguration config) {
	String noProxy = vars.get(NO_PROXY, vars.get(NO_PROXY_LC));
	if (noProxy != null) {
		config.setNonProxyHosts(Joiner.on('|').join(noProxy.split(",")));
	}
}