From 51c5e8433688c89552e1eef861a7c64ce54b88a4 Mon Sep 17 00:00:00 2001 From: biniek Date: Mon, 19 Nov 2018 17:39:49 +0100 Subject: Removed dependency from lombok Change-Id: Ia38f0458e74fd5f1899a01ca6219575ee446a4f2 Issue-ID: VID-349 Signed-off-by: biniek --- .../java/org/onap/vid/aai/AaiOverTLSClient.java | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java index 4f98bd37c..6e25e2715 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java @@ -33,7 +33,6 @@ import java.util.Base64; import java.util.Collections; import java.util.Map; import javax.ws.rs.core.MediaType; -import lombok.val; import org.onap.portalsdk.core.util.SystemProperties; import org.onap.vid.aai.model.AaiNodeQueryResponse; import org.onap.vid.aai.model.ResourceType; @@ -46,7 +45,7 @@ public class AaiOverTLSClient implements AaiOverTLSClientInterface { private final AaiOverTLSPropertySupplier propertySupplier; private SyncRestClientInterface syncRestClient; private boolean useClientCert; - private static String CALLER_APP_ID = "VidAaiController"; + private static final String CALLER_APP_ID = "VidAaiController"; private String urlBase; public AaiOverTLSClient(SyncRestClientInterface syncRestClient, AaiOverTLSPropertySupplier propertySupplier) { @@ -66,34 +65,34 @@ public class AaiOverTLSClient implements AaiOverTLSClientInterface { @Override public HttpResponse searchNodeTypeByName(String name, ResourceType type) { - val uri = urlBase + String.format(URIS.NODE_TYPE_BY_NAME, type.getAaiFormat(), type.getNameFilter(), name); + String uri = urlBase + String.format(URIS.NODE_TYPE_BY_NAME, type.getAaiFormat(), type.getNameFilter(), name); return syncRestClient.get(uri, getRequestHeaders(), Collections.emptyMap(), AaiNodeQueryResponse.class); } @Override public HttpResponse getAllSubscribers() { - val uri = urlBase + String.format(URIS.SUBSCRIBERS, 0); + String uri = urlBase + String.format(URIS.SUBSCRIBERS, 0); return syncRestClient.get(uri, getRequestHeaders(), Collections.emptyMap(), SubscriberList.class); } private Map getRequestHeaders() { - val result = HashMap.of( - TRANSACTION_ID_HEADER, propertySupplier.getRandomUUID(), - FROM_APP_ID_HEADER, CALLER_APP_ID, - CONTENT_TYPE, MediaType.APPLICATION_JSON, - REQUEST_ID, propertySupplier.getRequestId(), - ACCEPT, MediaType.APPLICATION_JSON) - .toJavaMap(); + Map result = HashMap.of( + TRANSACTION_ID_HEADER, propertySupplier.getRandomUUID(), + FROM_APP_ID_HEADER, CALLER_APP_ID, + CONTENT_TYPE, MediaType.APPLICATION_JSON, + REQUEST_ID, propertySupplier.getRequestId(), + ACCEPT, MediaType.APPLICATION_JSON) + .toJavaMap(); result.putAll(getAuthorizationHeader()); return result; } private Map getAuthorizationHeader() { if (!useClientCert) { - val vidUsername = propertySupplier.getUsername(); - val vidPassword = propertySupplier.getPassword(); - val encoded = Base64.getEncoder() - .encodeToString((vidUsername + ":" + vidPassword).getBytes(StandardCharsets.UTF_8)); + String vidUsername = propertySupplier.getUsername(); + String vidPassword = propertySupplier.getPassword(); + String encoded = Base64.getEncoder() + .encodeToString((vidUsername + ":" + vidPassword).getBytes(StandardCharsets.UTF_8)); return HashMap.of("Authorization", "Basic " + encoded).toJavaMap(); } return HashMap.empty().toJavaMap(); -- cgit 1.2.3-korg