diff options
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/aai')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/aai/AaiOverTLSClient.java | 29 |
1 files changed, 14 insertions, 15 deletions
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 4f98bd37..6e25e271 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<AaiNodeQueryResponse> 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<SubscriberList> 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<String, String> 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<String, String> 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<String, String> 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.<String, String>empty().toJavaMap(); |