+ }
+
+ 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.");
+ }
+ return success;
+ }
+
+ private void logModelUpdateFailure(String message) {
+ logErrorMsg(FAILURE_MSG_PREFIX + getType() + " " + getUniqueIdentifier() + " " + message + ROLLBACK_MSG_SUFFIX);
+ }