- logInfoMsg(getType().toString() + " " + getUniqueIdentifier() + " successfully ingested.");
- } else {
- logErrorMsg(
- FAILURE_MSG_PREFIX + getType().toString() + " " + getUniqueIdentifier() + ROLLBACK_MSG_SUFFIX);
- }
+ private boolean createNewModel(AaiRestClient aaiClient, String distId, List<Artifact> completedArtifacts,
+ String resourceUrl) {
+ boolean success;
+ // Assume that the model does not exist and attempt the PUT
+ success = putXmlResource(aaiClient, distId, resourceUrl, getPayload());
+ if (success) {
+ completedArtifacts.add(this);
+
+ // Record state to remember that this is the first version of the model (just added).
+ firstVersionOfModel = true;
+
+ logInfoMsg(getType() + " " + getUniqueIdentifier() + " successfully ingested.");
+ } else {
+ logModelUpdateFailure("Error creating model. Skipping ingestion.");