diff options
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src')
2 files changed, 4 insertions, 6 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java index db14006eb..956345cd4 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java @@ -24,11 +24,9 @@ package org.onap.policy.apex.plugins.event.carrier.restclient; import java.util.Properties; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.core.Response; import lombok.AccessLevel; import lombok.Setter; import org.apache.commons.lang3.StringUtils; @@ -148,11 +146,11 @@ public class ApexRestClientConsumer extends ApexPluginsEventConsumer { @Override public void run() { try { - final Response response = client.target(restConsumerProperties.getUrl()).request("application/json") + final var response = client.target(restConsumerProperties.getUrl()).request("application/json") .headers(restConsumerProperties.getHttpHeadersAsMultivaluedMap()).get(); // Match the return code - Matcher isPass = httpCodeFilterPattern.matcher(String.valueOf(response.getStatus())); + var isPass = httpCodeFilterPattern.matcher(String.valueOf(response.getStatus())); // Check that status code if (!isPass.matches()) { @@ -164,7 +162,7 @@ public class ApexRestClientConsumer extends ApexPluginsEventConsumer { } // Get the event we received - final String eventJsonString = response.readEntity(String.class); + final var eventJsonString = response.readEntity(String.class); // Check there is content if (StringUtils.isBlank(eventJsonString)) { diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java index cb6b55371..035bd6524 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java @@ -124,7 +124,7 @@ public class ApexRestClientProducer extends ApexPluginsEventProducer { NetLoggerUtil.log(EventType.OUT, CommInfrastructure.REST, untaggedUrl, event.toString()); // Send the event as a REST request - final Response response = sendEventAsRestRequest(untaggedUrl, (String) event); + final var response = sendEventAsRestRequest(untaggedUrl, (String) event); NetLoggerUtil.log(EventType.IN, CommInfrastructure.REST, untaggedUrl, response.readEntity(String.class)); |