summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java
index 85be50b..3480c68 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/catalog/VnfCatalogArtifactHandler.java
@@ -89,7 +89,7 @@ public class VnfCatalogArtifactHandler extends ArtifactHandler {
// If an empty dataItem is supplied, do nothing.
if (dataItem.isEmpty()) {
logger.warn(ModelLoaderMsgs.DISTRIBUTION_EVENT, "Empty image data supplied, skipping ingestion.");
- return;
+ continue;
}
String urlParams;
@@ -142,18 +142,13 @@ public class VnfCatalogArtifactHandler extends ArtifactHandler {
String uuid = UUID.randomUUID().toString();
dataItem.put(ATTR_UUID, uuid);
- String payload = createVnfImagePayload(dataItem);
+ String payload = new Gson().toJson(dataItem);
String putUrl = config.getAaiBaseUrl() + config.getAaiVnfImageUrl() + "/vnf-image/" + uuid;
OperationResult putResp =
restClient.putResource(putUrl, payload, distributionId, MediaType.APPLICATION_JSON_TYPE);
return putResp != null && putResp.getResultCode() == Response.Status.CREATED.getStatusCode();
}
- private String createVnfImagePayload(Map<String, String> dataItem) {
- dataItem.put(ATTR_UUID, UUID.randomUUID().toString());
- return new Gson().toJson(dataItem);
- }
-
private List<Map<String, String>> unmarshallVnfcData(Artifact vnfcArtifact) {
// Unmarshall Babel JSON payload into a List of Maps of JSON attribute name/values.
return new Gson().fromJson(StringEscapeUtils.unescapeJson(vnfcArtifact.getPayload()),