aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java14
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java49
2 files changed, 56 insertions, 7 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
index ab40cefb4e..0d7a6dbd1f 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
@@ -136,6 +136,9 @@ public class Service implements Serializable {
@JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID")
private ToscaCsar csar;
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "service")
+ private List<ServiceArtifact> serviceArtifactList;
+
@Column(name = "NAMING_POLICY")
private String namingPolicy;
@@ -371,6 +374,17 @@ public class Service implements Serializable {
this.csar = csar;
}
+ public List<ServiceArtifact> getServiceArtifactList() {
+ if (serviceArtifactList == null) {
+ serviceArtifactList = new ArrayList<>();
+ }
+ return serviceArtifactList;
+ }
+
+ public void setServiceArtifactList(List<ServiceArtifact> serviceArtifactList) {
+ this.serviceArtifactList = serviceArtifactList;
+ }
+
public String getWorkloadContext() {
return this.workloadContext;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
index f9cbb0d462..ec4e922c8f 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java
@@ -20,14 +20,10 @@
package org.onap.so.db.catalog.rest.beans;
+import com.openpojo.business.annotation.BusinessKey;
+import org.onap.so.db.catalog.beans.*;
import java.io.Serializable;
import java.util.ArrayList;
-import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
-import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
-import org.onap.so.db.catalog.beans.Service;
-import org.onap.so.db.catalog.beans.VnfResource;
-import org.onap.so.db.catalog.beans.VnfResourceCustomization;
-import com.openpojo.business.annotation.BusinessKey;
/*
* A simple holder for Service and its associated elements: VnfResource, 1-n VfModule, Network TBD
@@ -42,6 +38,8 @@ public class ServiceMacroHolder implements Serializable {
private ArrayList<NetworkResourceCustomization> networkResourceCustomizations;
private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations;
private ArrayList<VnfResourceCustomization> vnfResourceCustomizations;
+ private ArrayList<ServiceProxyResourceCustomization> serviceProxyResourceCustomizations;
+ private ServiceInfo serviceInfo;
public ServiceMacroHolder() {
@@ -51,6 +49,8 @@ public class ServiceMacroHolder implements Serializable {
this.networkResourceCustomizations = new ArrayList<>();
this.allottedResourceCustomizations = new ArrayList<>();
this.vnfResourceCustomizations = new ArrayList<>();
+ this.serviceProxyResourceCustomizations = new ArrayList<>();
+ this.serviceInfo = null;
}
public ServiceMacroHolder(Service service) {
@@ -66,6 +66,14 @@ public class ServiceMacroHolder implements Serializable {
this.service = service;
}
+ public ServiceInfo getServiceInfo() {
+ return serviceInfo;
+ }
+
+ public void setServiceInfo(ServiceInfo serviceInfo) {
+ this.serviceInfo = serviceInfo;
+ }
+
public void setVnfResources(ArrayList<VnfResource> vnfResources) {
this.vnfResources = vnfResources;
}
@@ -139,6 +147,15 @@ public class ServiceMacroHolder implements Serializable {
}
}
+ public void addServiceProxyResourceCustomization(ServiceProxyResourceCustomization sprc) {
+ if (this.serviceProxyResourceCustomizations != null) {
+ this.serviceProxyResourceCustomizations.add(sprc);
+ } else {
+ this.serviceProxyResourceCustomizations = new ArrayList<>();
+ this.serviceProxyResourceCustomizations.add(sprc);
+ }
+ }
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -148,6 +165,11 @@ public class ServiceMacroHolder implements Serializable {
} else {
sb.append("service: null");
}
+ if (this.serviceInfo != null) {
+ sb.append("serviceInfo: " + this.serviceInfo.toString());
+ } else {
+ sb.append("serviceInfo: null");
+ }
if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) {
int i = 0;
sb.append("VnfResources: ");
@@ -180,6 +202,13 @@ public class ServiceMacroHolder implements Serializable {
sb.append("ARC[" + i++ + "]: " + arc.toString());
}
}
+ if (this.serviceProxyResourceCustomizations != null && this.serviceProxyResourceCustomizations.size() > 0) {
+ int i = 0;
+ sb.append("ServiceProxyResourceCustomizations:");
+ for (ServiceProxyResourceCustomization sprc : this.serviceProxyResourceCustomizations) {
+ sb.append("SPRC[" + i++ + "]: " + sprc.toString());
+ }
+ }
return sb.toString();
}
@@ -202,6 +231,12 @@ public class ServiceMacroHolder implements Serializable {
this.allottedResourceCustomizations = allottedResourceCustomizations;
}
+ public ArrayList<ServiceProxyResourceCustomization> getServiceProxyResourceCustomizations() {
+ return serviceProxyResourceCustomizations;
+ }
-
+ public void setServiceProxyResourceCustomizations(
+ ArrayList<ServiceProxyResourceCustomization> serviceProxyResourceCustomizations) {
+ this.serviceProxyResourceCustomizations = serviceProxyResourceCustomizations;
+ }
}