From 7510d59aa2871477f2890cf065aa29eb925e1905 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Tue, 8 Aug 2017 14:43:16 +0200 Subject: Remove unnecessary instances of the character sequence 'yca' --- .../search/federation/http/HTTPParameters.java | 38 ++++++++-------- .../yahoo/search/federation/http/HTTPSearcher.java | 50 +++++++++++----------- 2 files changed, 44 insertions(+), 44 deletions(-) (limited to 'container-search/src/main/java/com/yahoo/search') diff --git a/container-search/src/main/java/com/yahoo/search/federation/http/HTTPParameters.java b/container-search/src/main/java/com/yahoo/search/federation/http/HTTPParameters.java index c4227e06538..99dae4e20aa 100644 --- a/container-search/src/main/java/com/yahoo/search/federation/http/HTTPParameters.java +++ b/container-search/src/main/java/com/yahoo/search/federation/http/HTTPParameters.java @@ -42,12 +42,12 @@ public final class HTTPParameters { private int configuredReadTimeout = -1; private int configuredConnectionTimeout = -1; private int connectionPoolTimeout = -1; - private String ycaProxy = null; - private int ycaPort = 0; - private String ycaApplicationId = null; - private boolean ycaUseProxy = false; - private long ycaTtl = 0L; - private long ycaRetry = 0L; + private String certificateProxy = null; + private int certificatePort = 0; + private String certificateApplicationId = null; + private boolean certificateUseProxy = false; + private long certificateTtl = 0L; + private long certificateRetry = 0L; private PingOption.Enum pingOption = PingOption.NORMAL; @@ -66,14 +66,14 @@ public final class HTTPParameters { connectionPoolTimeout = (int) (providerConfig.connectionPoolTimeout() * 1000.0d); retries = providerConfig.retries(); setPath(providerConfig.path()); - ycaUseProxy = providerConfig.yca().useProxy(); - if (ycaUseProxy) { - ycaProxy = providerConfig.yca().host(); - ycaPort = providerConfig.yca().port(); + certificateUseProxy = providerConfig.yca().useProxy(); + if (certificateUseProxy) { + certificateProxy = providerConfig.yca().host(); + certificatePort = providerConfig.yca().port(); } - ycaApplicationId = providerConfig.yca().applicationId(); - ycaTtl = providerConfig.yca().ttl() * 1000L; - ycaRetry = providerConfig.yca().retry() * 1000L; + certificateApplicationId = providerConfig.yca().applicationId(); + certificateTtl = providerConfig.yca().ttl() * 1000L; + certificateRetry = providerConfig.yca().retry() * 1000L; followRedirects = providerConfig.followRedirects(); pingOption = providerConfig.pingOption(); } @@ -289,27 +289,27 @@ public final class HTTPParameters { } public String getYcaProxy() { - return ycaProxy; + return certificateProxy; } public int getYcaPort() { - return ycaPort; + return certificatePort; } public String getYcaApplicationId() { - return ycaApplicationId; + return certificateApplicationId; } public boolean getYcaUseProxy() { - return ycaUseProxy; + return certificateUseProxy; } public long getYcaTtl() { - return ycaTtl; + return certificateTtl; } public long getYcaRetry() { - return ycaRetry; + return certificateRetry; } } diff --git a/container-search/src/main/java/com/yahoo/search/federation/http/HTTPSearcher.java b/container-search/src/main/java/com/yahoo/search/federation/http/HTTPSearcher.java index 1afe08414b2..3707d7fa77a 100644 --- a/container-search/src/main/java/com/yahoo/search/federation/http/HTTPSearcher.java +++ b/container-search/src/main/java/com/yahoo/search/federation/http/HTTPSearcher.java @@ -177,17 +177,17 @@ public abstract class HTTPSearcher extends ClusterSearcher { private final CertificateStore certificateStore; - /** The (optional) YCA application ID. */ - private String ycaApplicationId = null; + /** The (optional) certificate application ID. */ + private String certificateApplicationId = null; - /** The (optional) YCA proxy */ - protected HttpHost ycaProxy = null; + /** The (optional) certificate server proxy */ + protected HttpHost certificateProxy = null; - /** YCA cache TTL in ms */ - private long ycaTtl = 0L; + /** Certificate cache TTL in ms */ + private long certificateTtl = 0L; - /** YCA retry rate in the cache if no cert is found, in ms */ - private long ycaRetry = 0L; + /** Certificate server retry rate in the cache if no cert is found, in ms */ + private long certificateRetry = 0L; /** Set at construction if this is using persistent connections */ private ClientConnectionManager sharedConnectionManager = null; @@ -275,15 +275,15 @@ public abstract class HTTPSearcher extends ClusterSearcher { singleClientConnManagerThreadLocal =new ThreadLocal<>(); } - initializeYCA(httpParameters, certificateStore); + initializeCertificate(httpParameters, certificateStore); } /** - * Initialize YCA certificate and proxy if they have been set to non-null, - * non-empty values. It will wrap thrown exceptions from the YCA layer into + * Initialize certificate store and proxy if they have been set to non-null, + * non-empty values. It will wrap thrown exceptions from the certificate store into * RuntimeException and propagate them. */ - private void initializeYCA(HTTPParameters parameters, CertificateStore certificateStore) { + private void initializeCertificate(HTTPParameters parameters, CertificateStore certificateStore) { String applicationId = parameters.getYcaApplicationId(); String proxy = parameters.getYcaProxy(); int port = parameters.getYcaPort(); @@ -314,7 +314,7 @@ public abstract class HTTPSearcher extends ClusterSearcher { } /** - * Initialize the YCA certificate. + * Initialize the certificate. * This will warn but not throw if certificates could not be loaded, as the certificates * are external state which can fail independently. */ @@ -328,9 +328,9 @@ public abstract class HTTPSearcher extends ClusterSearcher { } this.useCertificate = true; - this.ycaApplicationId = applicationId; - this.ycaTtl = ttl; - this.ycaRetry = retry; + this.certificateApplicationId = applicationId; + this.certificateTtl = ttl; + this.certificateRetry = retry; getLogger().log(LogLevel.CONFIG, "Got certificate: " + certificate); } catch (Exception e) { @@ -340,11 +340,11 @@ public abstract class HTTPSearcher extends ClusterSearcher { } /** - * Initialize the YCA proxy setting. + * Initialize the certificate proxy setting. */ private void initializeProxy(String host, int port) { - ycaProxy = new HttpHost(host, port); - getLogger().log(LogLevel.CONFIG,"Proxy is configured; will use proxy: " + ycaProxy); + certificateProxy = new HttpHost(host, port); + getLogger().log(LogLevel.CONFIG, "Proxy is configured; will use proxy: " + certificateProxy); } /** @@ -644,8 +644,8 @@ public abstract class HTTPSearcher extends ClusterSearcher { /** * Returns the set of headers to be passed in the http request to provider backend. The default - * implementation returns null, unless YCA is in use. If YCA is used, it will return a map - * only containing the needed YCA headers. + * implementation returns null, unless certificates are in use. If certificates are used, it will return a map + * only containing the needed certificate headers. */ protected Map getRequestHeaders(Query query, Hit requestMeta) { if (useCertificate) { @@ -781,13 +781,13 @@ public abstract class HTTPSearcher extends ClusterSearcher { /** * Creates a http client for one request. Override to customize the client - * to use, e.g for testing. This default implementation will add the YCA + * to use, e.g for testing. This default implementation will add a certificate store * proxy to params if is necessary, and then do * return new SearcherHttpClient(getConnectionManager(params), params); */ protected HttpClient createClient(HttpParams params) { - if (ycaProxy != null) { - params.setParameter(ConnRoutePNames.DEFAULT_PROXY, ycaProxy); + if (certificateProxy != null) { + params.setParameter(ConnRoutePNames.DEFAULT_PROXY, certificateProxy); } return new SearcherHttpClient(getConnectionManager(params), params); } @@ -830,7 +830,7 @@ public abstract class HTTPSearcher extends ClusterSearcher { private Map generateYCAHeaders() { Map headers = new HashMap<>(); - String certificate = certificateStore.getCertificate(ycaApplicationId, ycaTtl, ycaRetry); + String certificate = certificateStore.getCertificate(certificateApplicationId, certificateTtl, certificateRetry); headers.put(YCA_HTTP_HEADER, certificate); return headers; } -- cgit v1.2.3