/** * Sets the optional proxy host the client will connect through and returns the updated * ClientConfiguration object. * * @param proxyHost * The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
@Override public ClientConfiguration getAWSClientConfig() { ClientConfiguration awsClientConfig = new ClientConfiguration(); awsClientConfig.setProxyHost(proxyHost); awsClientConfig.setProxyPort(proxyPort); if ( proxyUsername != null ) { awsClientConfig.setProxyUsername(proxyUsername); } if ( proxyPassword != null ) { awsClientConfig.setProxyPassword(proxyPassword); } return awsClientConfig; }
private static ClientConfiguration setProxyConfig(ClientConfiguration conf, AWSProxyConfig proxyConfig) { if (StringUtils.isNotEmpty(proxyConfig.getHost())) { conf.setProxyHost(proxyConfig.getHost()); } if (proxyConfig.getPort() != -1) { conf.setProxyPort(proxyConfig.getPort()); } if (StringUtils.isNotEmpty(proxyConfig.getUsername())) { conf.setProxyUsername(proxyConfig.getUsername()); } if (StringUtils.isNotEmpty(proxyConfig.getPassword())) { conf.setProxyPassword(proxyConfig.getPassword()); } return conf; }
/** * Sets the optional proxy host the client will connect through and returns * the updated ClientConfiguration object. * * @param proxyHost The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
/** * Sets the optional proxy host the client will connect through and returns the updated * ClientConfiguration object. * * @param proxyHost * The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
String httpProxyHost = mConfig.getAwsProxyHttpHost(); int httpProxyPort = mConfig.getAwsProxyHttpPort(); clientConfiguration.setProxyHost(httpProxyHost); clientConfiguration.setProxyPort(httpProxyPort);
clientConf.setProxyHost(conf.get(PropertyKey.UNDERFS_S3_PROXY_HOST));
config.setProxyHost(proxyConfig.getProxyServerHost()); config.setProxyPort(proxyConfig.getProxyServerPort());
/** * Sets the optional proxy host the client will connect through and returns * the updated ClientConfiguration object. * * @param proxyHost The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
/** * Sets the optional proxy host the client will connect through and returns * the updated ClientConfiguration object. * * @param proxyHost The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ @SuppressWarnings("checkstyle:hiddenfield") public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
/** * Sets the optional proxy host the client will connect through and returns the updated * ClientConfiguration object. * * @param proxyHost * The proxy host the client will connect through. * @return The updated ClientConfiguration object. */ public ClientConfiguration withProxyHost(String proxyHost) { setProxyHost(proxyHost); return this; }
private ClientConfiguration getClientConfiguration(){ if (clientConfiguration == null) { clientConfiguration = new ClientConfiguration(); if(proxyHost != null && proxyHost.length() > 0) { clientConfiguration.setProxyHost(proxyHost); clientConfiguration.setProxyPort(Integer.parseInt(proxyPort)); } } return clientConfiguration; }
ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setProxyHost("proxyhost"); clientConfiguration.setProxyPort(proxyport); AmazonEC2Client ec2Client = new AmazonEC2Client(clientConfiguration);
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass, String profileName, ClientConfiguration config) { AWSCredentialsProvider credentialsProvider = newCredentialsProvider(profileName); ClientConfiguration configToUse = config == null ? new ClientConfiguration() : config; if (this.proxyHost != null && this.proxyPort > 0) { configToUse.setProxyHost(this.proxyHost); configToUse.setProxyPort(this.proxyPort); } return createClient(serviceClass, credentialsProvider, configToUse); }
static void configureProxy(ClientConfiguration configuration, ProxyConfig proxyConfig) { configuration.setProxyHost(proxyConfig.getHost()); configuration.setProxyPort(proxyConfig.getPort()); Optional<String> user = proxyConfig.getUser(); if (user.isPresent()) { configuration.setProxyUsername(user.get()); } Optional<String> password = proxyConfig.getPassword(); if (password.isPresent()) { configuration.setProxyPassword(password.get()); } }
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)); } } } }
private ClientConfiguration getClientConfiguration() { ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setProxyDomain(getConfig("proxy.domain")); clientConfiguration.setProxyHost(getConfig("proxy.host")); String port = getConfig("proxy.port"); if (port != null) { clientConfiguration.setProxyPort(Integer.parseInt(port)); } clientConfiguration.setProxyUsername(getConfig("proxy.username")); clientConfiguration.setProxyPassword(getConfig("proxy.password")); return clientConfiguration; }
protected ClientConfiguration getClientConfiguration() { ClientConfiguration clientConfiguration = new ClientConfiguration().withUserAgent(getUserAgent()); if (null != this.settings && null != settings.getActiveProxy()) { Proxy proxy = settings.getActiveProxy(); clientConfiguration.setProxyHost(proxy.getHost()); clientConfiguration.setProxyUsername(proxy.getUsername()); clientConfiguration.setProxyPassword(proxy.getPassword()); clientConfiguration.setProxyPort(proxy.getPort()); } return clientConfiguration; }
public AWSClients(String region, AWSCredentials credentials, String proxyHost, int proxyPort) { this.region = region; this.proxyHost = proxyHost; this.proxyPort = proxyPort; //setup proxy connection: ClientConfiguration clientCfg = new ClientConfiguration(); if (proxyHost != null && proxyPort > 0 ) { clientCfg.setProxyHost(proxyHost); clientCfg.setProxyPort(proxyPort); } this.s3 = credentials != null ? new AmazonS3Client(credentials, clientCfg) : new AmazonS3Client(clientCfg); this.codedeploy = credentials != null ? new AmazonCodeDeployClient(credentials, clientCfg) : new AmazonCodeDeployClient(clientCfg); codedeploy.setRegion(Region.getRegion(Regions.fromName(this.region))); s3.setRegion(Region.getRegion(Regions.fromName(this.region))); }
c.setProxyHost("two"); assertEquals(c.getProxyHost(), "two");