aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2020-02-11 10:11:24 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-11 10:11:24 +0000
commit00ba764f619848bcd4a384e26b0806bd5fb80749 (patch)
treefd55661648e5a2515cda5cedf17bc1aa1c0ab02e /bpmn/MSOCommonBPMN/src/main
parent505b82d23d4340e67f619675bad4580fc3ae050a (diff)
parent6829555c125ee4243482acc792455272c214c6fe (diff)
Merge "AssignPnfBB - store model related PNF parameters in AAI"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java13
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java27
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java13
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java48
4 files changed, 90 insertions, 11 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
index 772c61e48b..1953ba410b 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/bbobjects/Pnf.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
import javax.persistence.Id;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
@@ -41,7 +42,7 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
@JsonProperty("pnf-name")
private String pnfName;
- @JsonProperty("role")
+ @JsonProperty("nf-role")
private String role;
@JsonProperty("orchestration-status")
@@ -50,6 +51,8 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
@JsonProperty("cloud-region")
private CloudRegion cloudRegion;
+ @JsonProperty("model-info-pnf")
+ private ModelInfoPnf modelInfoPnf;
public String getPnfId() {
return pnfId;
@@ -97,6 +100,14 @@ public class Pnf implements Serializable, ShallowCopy<Pnf> {
this.cloudRegion = cloudRegion;
}
+ public ModelInfoPnf getModelInfoPnf() {
+ return modelInfoPnf;
+ }
+
+ public void setModelInfoPnf(ModelInfoPnf modelInfoPnf) {
+ this.modelInfoPnf = modelInfoPnf;
+ }
+
@Override
public boolean equals(final Object other) {
if (!(other instanceof Pnf)) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java
new file mode 100644
index 0000000000..a01fa9698b
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoPnf.java
@@ -0,0 +1,27 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.servicedecomposition.modelinfo;
+
+import java.io.Serializable;
+
+public class ModelInfoPnf extends ModelInfoMetadata implements Serializable {
+ private static final long serialVersionUID = 50687109134317615L;
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index 145d4c83a7..e7e51bba77 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -6,7 +6,7 @@
* ================================================================================
* Modifications Copyright (c) 2019 Samsung
* ================================================================================
- * Modifications Copyright (c) 2019 Nokia
+ * Modifications Copyright (c) 2020 Nokia
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -815,13 +815,6 @@ public class BBInputSetup implements JavaDelegate {
}
}
- private void populatePnf(Pnfs pnf, String pnfId, ServiceInstance serviceInstance) {
- Pnf genericPnf = new Pnf();
- genericPnf.setPnfId(pnfId);
- genericPnf.setPnfName(pnf.getInstanceName());
- serviceInstance.getPnfs().add(genericPnf);
- }
-
protected boolean instanceGroupInList(GenericVnf vnf, String instanceGroupId) {
for (InstanceGroup instanceGroup : vnf.getInstanceGroups()) {
if (instanceGroup.getId() != null && instanceGroup.getId().equalsIgnoreCase(instanceGroupId)) {
@@ -1503,8 +1496,8 @@ public class BBInputSetup implements JavaDelegate {
} else if (bbName.contains(PNF)) {
String pnfId = lookupKeyMap.get(ResourceKey.PNF);
resources.getPnfs().stream()
- .filter(pnf -> Objects.equals(key, pnf.getModelInfo().getModelCustomizationId())).findFirst()
- .ifPresent(pnf -> this.populatePnf(pnf, pnfId, serviceInstance));
+ .filter(pnfs -> Objects.equals(key, pnfs.getModelInfo().getModelCustomizationId())).findFirst()
+ .ifPresent(pnfs -> BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance));
} else if (bbName.contains(VF_MODULE) || bbName.contains(VOLUME_GROUP)) {
Pair<Vnfs, VfModules> vnfsAndVfModules = getVfModulesAndItsVnfsByKey(key, resources);
if (vnfsAndVfModules != null) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java
new file mode 100644
index 0000000000..68161a8dd5
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupPnf.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2020 Nokia Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+package org.onap.so.bpmn.servicedecomposition.tasks;
+
+import org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
+import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
+import org.onap.so.db.catalog.beans.OrchestrationStatus;
+import org.onap.so.serviceinstancebeans.Pnfs;
+
+final class BBInputSetupPnf {
+
+ private BBInputSetupPnf() {
+ throw new IllegalStateException("Utility class");
+ }
+
+ static void populatePnfToServiceInstance(Pnfs pnfs, String pnfId, ServiceInstance serviceInstance) {
+ Pnf pnf = new Pnf();
+ pnf.setPnfId(pnfId);
+ pnf.setPnfName(pnfs.getInstanceName());
+ pnf.setModelInfoPnf(new ModelInfoPnf());
+ pnf.getModelInfoPnf().setModelCustomizationUuid(pnfs.getModelInfo().getModelCustomizationId());
+ pnf.getModelInfoPnf().setModelInvariantUuid(pnfs.getModelInfo().getModelInvariantId());
+ pnf.getModelInfoPnf().setModelUuid(pnfs.getModelInfo().getModelVersionId());
+ pnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
+
+ serviceInstance.getPnfs().add(pnf);
+ }
+}