X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Fentity%2Fmodel%2FNamedQueryArtifact.java;h=ff3b73486bc7f0fff079518b64049e0b776b793c;hb=HEAD;hp=ba5d12bdc20a31e563d2a661450500da24e35b80;hpb=270656abb1ed24930b2f9e57f5bef659494f5e8e;p=aai%2Fmodel-loader.git diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java index ba5d12b..ff3b734 100644 --- a/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java +++ b/src/main/java/org/onap/aai/modelloader/entity/model/NamedQueryArtifact.java @@ -21,15 +21,15 @@ package org.onap.aai.modelloader.entity.model; import java.util.List; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.onap.aai.modelloader.config.ModelLoaderConfig; import org.onap.aai.modelloader.entity.ArtifactType; import org.onap.aai.modelloader.restclient.AaiRestClient; import org.onap.aai.modelloader.entity.Artifact; -import org.onap.aai.restclient.client.OperationResult; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; public class NamedQueryArtifact extends AbstractModelArtifact { @@ -56,7 +56,7 @@ public class NamedQueryArtifact extends AbstractModelArtifact { @Override public boolean push(AaiRestClient aaiClient, ModelLoaderConfig config, String distId, List completedArtifacts) { if (config.useGizmo()) { - return pushToGizmo(aaiClient, config, distId, completedArtifacts); + return pushToGizmo(aaiClient, config, distId); } return pushToResources(aaiClient, config, distId, completedArtifacts); @@ -64,13 +64,13 @@ public class NamedQueryArtifact extends AbstractModelArtifact { private boolean pushToResources(AaiRestClient aaiClient, ModelLoaderConfig config, String distId, List completedArtifacts) { - OperationResult getResponse = - aaiClient.getResource(getNamedQueryUrl(config), distId, MediaType.APPLICATION_XML_TYPE); - if (getResponse == null || getResponse.getResultCode() != Response.Status.OK.getStatusCode()) { + ResponseEntity getResponse = + aaiClient.getResource(getNamedQueryUrl(config), distId, MediaType.APPLICATION_XML, String.class); + if (getResponse == null || getResponse.getStatusCode() != HttpStatus.OK) { // Only attempt the PUT if the model doesn't already exist - OperationResult putResponse = aaiClient.putResource(getNamedQueryUrl(config), getPayload(), distId, - MediaType.APPLICATION_XML_TYPE); - if (putResponse != null && putResponse.getResultCode() == Response.Status.CREATED.getStatusCode()) { + ResponseEntity putResponse = aaiClient.putResource(getNamedQueryUrl(config), getPayload(), distId, + MediaType.APPLICATION_XML, String.class); + if (putResponse != null && putResponse.getStatusCode() == HttpStatus.CREATED) { completedArtifacts.add(this); logInfoMsg(getType().toString() + " " + getUniqueIdentifier() + " successfully ingested."); } else {