Polishing.
Consistent constant naming.
This commit is contained in:
@@ -65,13 +65,13 @@ import static org.springframework.vault.client.ClientHttpRequestFactoryFactory.*
|
||||
*/
|
||||
public class ClientHttpConnectorFactory {
|
||||
|
||||
private static final boolean REACTOR_NETTY_PRESENT = ClassUtils.isPresent("reactor.netty.http.client.HttpClient",
|
||||
private static final boolean reactorNettyPresent = ClassUtils.isPresent("reactor.netty.http.client.HttpClient",
|
||||
ClientHttpConnectorFactory.class.getClassLoader());
|
||||
|
||||
private static final boolean HTTP_COMPONENTS_PRESENT = ClassUtils.isPresent("org.apache.hc.client5.http.impl.async",
|
||||
private static final boolean httpComponentsPresent = ClassUtils.isPresent("org.apache.hc.client5.http.impl.async",
|
||||
ClientHttpConnectorFactory.class.getClassLoader());
|
||||
|
||||
private static final boolean JETTY_PRESENT = ClassUtils.isPresent("org.eclipse.jetty.client.HttpClient",
|
||||
private static final boolean jettyPresent = ClassUtils.isPresent("org.eclipse.jetty.client.HttpClient",
|
||||
ClientHttpConnectorFactory.class.getClassLoader());
|
||||
|
||||
/**
|
||||
@@ -87,16 +87,16 @@ public class ClientHttpConnectorFactory {
|
||||
Assert.notNull(sslConfiguration, "SslConfiguration must not be null");
|
||||
|
||||
try {
|
||||
if (REACTOR_NETTY_PRESENT) {
|
||||
if (reactorNettyPresent) {
|
||||
return ReactorNetty.usingReactorNetty(options, sslConfiguration);
|
||||
}
|
||||
|
||||
if (HTTP_COMPONENTS_PRESENT) {
|
||||
if (httpComponentsPresent) {
|
||||
return HttpComponents.usingHttpComponents(options, sslConfiguration);
|
||||
|
||||
}
|
||||
|
||||
if (JETTY_PRESENT) {
|
||||
if (jettyPresent) {
|
||||
return JettyClient.usingJetty(options, sslConfiguration);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,11 +89,11 @@ public class ClientHttpRequestFactoryFactory {
|
||||
@SuppressWarnings("FieldMayBeFinal") // allow setting via reflection.
|
||||
private static Log logger = LogFactory.getLog(ClientHttpRequestFactoryFactory.class);
|
||||
|
||||
private static final boolean HTTP_COMPONENTS_PRESENT = ClassUtils.isPresent(
|
||||
private static final boolean httpComponentsPresent = ClassUtils.isPresent(
|
||||
"org.apache.hc.client5.http.impl.classic.HttpClientBuilder",
|
||||
ClientHttpRequestFactoryFactory.class.getClassLoader());
|
||||
|
||||
private static final boolean OKHTTP3_PRESENT = ClassUtils.isPresent("okhttp3.OkHttpClient",
|
||||
private static final boolean okHttp3Present = ClassUtils.isPresent("okhttp3.OkHttpClient",
|
||||
ClientHttpRequestFactoryFactory.class.getClassLoader());
|
||||
|
||||
/**
|
||||
@@ -111,11 +111,11 @@ public class ClientHttpRequestFactoryFactory {
|
||||
|
||||
try {
|
||||
|
||||
if (HTTP_COMPONENTS_PRESENT) {
|
||||
if (httpComponentsPresent) {
|
||||
return HttpComponents.usingHttpComponents(options, sslConfiguration);
|
||||
}
|
||||
|
||||
if (OKHTTP3_PRESENT) {
|
||||
if (okHttp3Present) {
|
||||
return OkHttp3.usingOkHttp3(options, sslConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user