import java.net.URI;
import java.util.Map;
import java.util.Optional;
-
import javax.ws.rs.core.Response;
-
import org.onap.so.client.ResponseExceptionMapper;
import org.onap.so.client.graphinventory.GraphInventoryPatchConverter;
import org.onap.so.client.graphinventory.GraphInventoryRestClient;
public class AAIRestClient extends GraphInventoryRestClient {
- private final AAIProperties aaiProperties;
+ private final AAIProperties aaiProperties;
- protected AAIRestClient(AAIProperties props, URI uri) {
- super(props, uri);
- this.aaiProperties = props;
- }
+ protected AAIRestClient(AAIProperties props, URI uri) {
+ super(props, uri);
+ this.aaiProperties = props;
+ }
- @Override
- public TargetEntity getTargetEntity(){
- return TargetEntity.AAI;
+ @Override
+ public TargetEntity getTargetEntity() {
+ return TargetEntity.AAI;
}
- @Override
- protected void initializeHeaderMap(Map<String, String> headerMap) {
- headerMap.put("X-FromAppId", aaiProperties.getSystemName());
- headerMap.put("X-TransactionId", requestId);
- String auth = aaiProperties.getAuth();
- String key = aaiProperties.getKey();
+ @Override
+ protected void initializeHeaderMap(Map<String, String> headerMap) {
+ headerMap.put("X-FromAppId", aaiProperties.getSystemName());
+ headerMap.put("X-TransactionId", requestId);
+ String auth = aaiProperties.getAuth();
+ String key = aaiProperties.getKey();
- if (auth != null && !auth.isEmpty() && key != null && !key.isEmpty()) {
- addBasicAuthHeader(auth, key);
- }
- }
+ if (auth != null && !auth.isEmpty() && key != null && !key.isEmpty()) {
+ addBasicAuthHeader(auth, key);
+ }
+ }
- @Override
- protected Optional<ResponseExceptionMapper> addResponseExceptionMapper() {
+ @Override
+ protected Optional<ResponseExceptionMapper> addResponseExceptionMapper() {
- return Optional.of(new AAIClientResponseExceptionMapper());
- }
-
- protected GraphInventoryPatchConverter getPatchConverter() {
- return this.patchConverter;
- }
+ return Optional.of(new AAIClientResponseExceptionMapper());
+ }
+
+ protected GraphInventoryPatchConverter getPatchConverter() {
+ return this.patchConverter;
+ }
}