aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java2
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java1
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java2
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java4
-rw-r--r--src/main/java/org/onap/aai/modelloader/entity/model/ModelV8ArtifactParser.java10
5 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java
index 32f2f0e..4079981 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/model/AbstractModelArtifact.java
@@ -36,7 +36,7 @@ public abstract class AbstractModelArtifact extends Artifact {
private String modelNamespace;
private String modelNamespaceVersion;
- private Set<String> referencedModelIds = new HashSet<String>();
+ private Set<String> referencedModelIds = new HashSet<>();
public AbstractModelArtifact(ArtifactType type) {
super(type);
diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java
index 0d34908..6d263a2 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/model/IModelParser.java
@@ -27,6 +27,7 @@ import java.util.List;
import org.onap.aai.modelloader.entity.Artifact;
+@FunctionalInterface
public interface IModelParser {
public List<Artifact> parse(byte[] artifactPayload, String artifactName);
}
diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java
index 47d93e7..3a5b543 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelArtifactHandler.java
@@ -57,7 +57,7 @@ public class ModelArtifactHandler extends ArtifactHandler {
// Push the ordered list of model artifacts to A&AI. If one fails, we need to roll back
// the changes.
- List<AbstractModelArtifact> completedModels = new ArrayList<AbstractModelArtifact>();
+ List<AbstractModelArtifact> completedModels = new ArrayList<>();
AaiRestClient aaiClient = new AaiRestClient(config);
for (Artifact art : sortedModelArtifacts) {
diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java
index 825cbcb..6838719 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelSorter.java
@@ -1,4 +1,4 @@
-/**
+ /**
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
@@ -133,7 +133,7 @@ public class ModelSorter {
// load list of models into a map, so we can later replace referenceIds with
// real Models
- HashMap<String, AbstractModelArtifact> versionIdToModelMap = new HashMap<String, AbstractModelArtifact>();
+ HashMap<String, AbstractModelArtifact> versionIdToModelMap = new HashMap<>();
for (Artifact art : models) {
AbstractModelArtifact ma = (AbstractModelArtifact) art;
versionIdToModelMap.put(ma.getUniqueIdentifier(), ma);
diff --git a/src/main/java/org/onap/aai/modelloader/entity/model/ModelV8ArtifactParser.java b/src/main/java/org/onap/aai/modelloader/entity/model/ModelV8ArtifactParser.java
index 1e90a04..ce23567 100644
--- a/src/main/java/org/onap/aai/modelloader/entity/model/ModelV8ArtifactParser.java
+++ b/src/main/java/org/onap/aai/modelloader/entity/model/ModelV8ArtifactParser.java
@@ -51,10 +51,10 @@ public class ModelV8ArtifactParser implements IModelParser {
private static Logger logger = LoggerFactory.getInstance().getLogger(ModelV8ArtifactParser.class.getName());
-
+ @Override
public List<Artifact> parse(byte[] artifactPayload, String artifactName) {
String payload = new String(artifactPayload);
- List<Artifact> modelList = new ArrayList<Artifact>();
+ List<Artifact> modelList = new ArrayList<>();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
@@ -127,10 +127,10 @@ public class ModelV8ArtifactParser implements IModelParser {
}
}
- if ( (key != null) && (key.equalsIgnoreCase(MODEL_ELEMENT_RELATIONSHIP_KEY )) ) {
- if (value != null) {
+ if ( (key != null) && (key.equalsIgnoreCase(MODEL_ELEMENT_RELATIONSHIP_KEY )) && (value != null) ) {
+
model.addDependentModelId(value);
- }
+
}
}
}