Skip to content

Commit

Permalink
SAMZA-1632: KinesisConfig: Making getProxyHost and getProxyPort APIs …
Browse files Browse the repository at this point in the history
…protected

Author: Aditya Toomula <atoomula@linkedin.com>

Reviewers: Jagadish<jagadish@apache.org>

Closes apache#457 from atoomula/kconfig
  • Loading branch information
atoomula authored and jagadish-v0 committed Mar 29, 2018
1 parent 57fea26 commit e58e3ca
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,13 @@ protected ConnectionSocketFactory getSSLSocketFactory(String system) {
return null;
}

/**
* @param system name of the system
* @return {@link ClientConfiguration} which has options controlling how the client connects to kinesis
* (eg: proxy settings, retry counts, etc)
*/
ClientConfiguration getAWSClientConfig(String system) {
ClientConfiguration awsClientConfig = new ClientConfiguration();
setAwsClientConfigs(subset(String.format(CONFIG_AWS_CLIENT_CONFIG, system)), awsClientConfig);
awsClientConfig.getApacheHttpClientConfig().setSslSocketFactory(getSSLSocketFactory(system));
return awsClientConfig;
}

/**
* Get the proxy host as a system level config. This is needed when
* users need to go through a proxy for the Kinesis connections.
* @param system name of the system
* @return proxy host name or empty string if not defined
*/
String getProxyHost(String system) {
protected String getProxyHost(String system) {
return get(String.format(CONFIG_PROXY_HOST, system), DEFAULT_CONFIG_PROXY_HOST);
}

Expand All @@ -169,10 +157,22 @@ String getProxyHost(String system) {
* @param system name of the system
* @return proxy port number or 0 if not defined
*/
int getProxyPort(String system) {
protected int getProxyPort(String system) {
return getInt(String.format(CONFIG_PROXY_PORT, system), DEFAULT_CONFIG_PROXY_PORT);
}

/**
* @param system name of the system
* @return {@link ClientConfiguration} which has options controlling how the client connects to kinesis
* (eg: proxy settings, retry counts, etc)
*/
ClientConfiguration getAWSClientConfig(String system) {
ClientConfiguration awsClientConfig = new ClientConfiguration();
setAwsClientConfigs(subset(String.format(CONFIG_AWS_CLIENT_CONFIG, system)), awsClientConfig);
awsClientConfig.getApacheHttpClientConfig().setSslSocketFactory(getSSLSocketFactory(system));
return awsClientConfig;
}

/**
* Get the Kinesis region for the system stream
* @param system name of the system
Expand Down

0 comments on commit e58e3ca

Please sign in to comment.