Remove deprecated settings
This commit is contained in:
parent
00edc8bc87
commit
98fdb39d3d
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.cloud.aws;
|
||||
|
||||
import com.amazonaws.services.ec2.AmazonEC2;
|
||||
|
||||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
|
||||
public interface AwsEc2Service extends LifecycleComponent<AwsEc2Service> {
|
||||
|
@ -33,10 +34,6 @@ public interface AwsEc2Service extends LifecycleComponent<AwsEc2Service> {
|
|||
public static final String PROXY_PASSWORD = "cloud.aws.proxy.password";
|
||||
public static final String SIGNER = "cloud.aws.signer";
|
||||
public static final String REGION = "cloud.aws.region";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_HOST = "cloud.aws.proxy_host";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_PORT = "cloud.aws.proxy_port";
|
||||
}
|
||||
|
||||
final class CLOUD_EC2 {
|
||||
|
@ -49,10 +46,6 @@ public interface AwsEc2Service extends LifecycleComponent<AwsEc2Service> {
|
|||
public static final String PROXY_PASSWORD = "cloud.aws.ec2.proxy.password";
|
||||
public static final String SIGNER = "cloud.aws.ec2.signer";
|
||||
public static final String ENDPOINT = "cloud.aws.ec2.endpoint";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_HOST = "cloud.aws.ec2.proxy_host";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_PORT = "cloud.aws.ec2.proxy_port";
|
||||
}
|
||||
|
||||
final class DISCOVERY_EC2 {
|
||||
|
|
|
@ -73,7 +73,6 @@ public class AwsEc2ServiceImpl extends AbstractLifecycleComponent<AwsEc2Service>
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation") // Supports deprecated parameters for backwards compatibility
|
||||
public synchronized AmazonEC2 client() {
|
||||
if (client != null) {
|
||||
return client;
|
||||
|
@ -94,11 +93,11 @@ public class AwsEc2ServiceImpl extends AbstractLifecycleComponent<AwsEc2Service>
|
|||
String account = settings.get(CLOUD_EC2.KEY, settings.get(CLOUD_AWS.KEY));
|
||||
String key = settings.get(CLOUD_EC2.SECRET, settings.get(CLOUD_AWS.SECRET));
|
||||
|
||||
String proxyHost = settings.get(CLOUD_AWS.PROXY_HOST, settings.get(CLOUD_AWS.DEPRECATED_PROXY_HOST));
|
||||
proxyHost = settings.get(CLOUD_EC2.PROXY_HOST, settings.get(CLOUD_EC2.DEPRECATED_PROXY_HOST, proxyHost));
|
||||
String proxyHost = settings.get(CLOUD_AWS.PROXY_HOST);
|
||||
proxyHost = settings.get(CLOUD_EC2.PROXY_HOST, proxyHost);
|
||||
if (proxyHost != null) {
|
||||
String portString = settings.get(CLOUD_AWS.PROXY_PORT, settings.get(CLOUD_AWS.DEPRECATED_PROXY_PORT, "80"));
|
||||
portString = settings.get(CLOUD_EC2.PROXY_PORT, settings.get(CLOUD_EC2.DEPRECATED_PROXY_PORT, portString));
|
||||
String portString = settings.get(CLOUD_AWS.PROXY_PORT, "80");
|
||||
portString = settings.get(CLOUD_EC2.PROXY_PORT, portString);
|
||||
Integer proxyPort;
|
||||
try {
|
||||
proxyPort = Integer.parseInt(portString, 10);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.cloud.aws;
|
||||
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
|
||||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
|
||||
/**
|
||||
|
@ -37,10 +38,6 @@ public interface AwsS3Service extends LifecycleComponent<AwsS3Service> {
|
|||
public static final String PROXY_PASSWORD = "cloud.aws.proxy.password";
|
||||
public static final String SIGNER = "cloud.aws.signer";
|
||||
public static final String REGION = "cloud.aws.region";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_HOST = "cloud.aws.proxy_host";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_PORT = "cloud.aws.proxy_port";
|
||||
}
|
||||
|
||||
final class CLOUD_S3 {
|
||||
|
@ -53,10 +50,6 @@ public interface AwsS3Service extends LifecycleComponent<AwsS3Service> {
|
|||
public static final String PROXY_PASSWORD = "cloud.aws.s3.proxy.password";
|
||||
public static final String SIGNER = "cloud.aws.s3.signer";
|
||||
public static final String ENDPOINT = "cloud.aws.s3.endpoint";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_HOST = "cloud.aws.s3.proxy_host";
|
||||
@Deprecated
|
||||
public static final String DEPRECATED_PROXY_PORT = "cloud.aws.s3.proxy_port";
|
||||
}
|
||||
|
||||
final class REPOSITORY_S3 {
|
||||
|
|
|
@ -95,7 +95,6 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
|||
return getClient(endpoint, protocol, account, key, maxRetries);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Handles deprecated settings.
|
||||
private synchronized AmazonS3 getClient(String endpoint, String protocol, String account, String key, Integer maxRetries) {
|
||||
Tuple<String, String> clientDescriptor = new Tuple<String, String>(endpoint, account);
|
||||
AmazonS3Client client = clients.get(clientDescriptor);
|
||||
|
@ -120,11 +119,11 @@ public class InternalAwsS3Service extends AbstractLifecycleComponent<AwsS3Servic
|
|||
throw new IllegalArgumentException("No protocol supported [" + protocol + "], can either be [http] or [https]");
|
||||
}
|
||||
|
||||
String proxyHost = settings.get(CLOUD_AWS.PROXY_HOST, settings.get(CLOUD_AWS.DEPRECATED_PROXY_HOST));
|
||||
proxyHost = settings.get(CLOUD_S3.PROXY_HOST, settings.get(CLOUD_S3.DEPRECATED_PROXY_HOST, proxyHost));
|
||||
String proxyHost = settings.get(CLOUD_AWS.PROXY_HOST);
|
||||
proxyHost = settings.get(CLOUD_S3.PROXY_HOST, proxyHost);
|
||||
if (proxyHost != null) {
|
||||
String portString = settings.get(CLOUD_AWS.PROXY_PORT, settings.get(CLOUD_AWS.DEPRECATED_PROXY_PORT, "80"));
|
||||
portString = settings.get(CLOUD_S3.PROXY_PORT, settings.get(CLOUD_S3.DEPRECATED_PROXY_PORT, portString));
|
||||
String portString = settings.get(CLOUD_AWS.PROXY_PORT, "80");
|
||||
portString = settings.get(CLOUD_S3.PROXY_PORT, portString);
|
||||
Integer proxyPort;
|
||||
try {
|
||||
proxyPort = Integer.parseInt(portString, 10);
|
||||
|
|
Loading…
Reference in New Issue