summaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-04-30 21:00:08 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-04-30 21:00:20 -0400
commitacb8997a69725a39270a6527b33995f51c1e4586 (patch)
tree44984771fe8b939093982ef049f0aa393336136e /mso-catalog-db
parentd26574fe0e44f43bfbf507adbf91a28c1b53c63a (diff)
Add Model Version Query
Fix the sql migration version numbering to be proper Fix marking test as private, mark public Clean up public declarations to private Fix schema.sql to have new column for unit test Revert POM Change, add License, clean up comments Fix bad spelling of method name issue Update catalog db to support new rest endpoint Update local query service and mappers Localstaging of potential catalog db changes Update logic to write overall distro status Change-Id: I84d53b972ede3176c5af32d13444583a36606efa Issue-ID: SO-1820 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java16
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java19
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatEnvironment.java160
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatFile.java115
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplate.java147
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplateParam.java73
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java165
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java196
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java218
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java3
-rw-r--r--mso-catalog-db/src/test/resources/schema.sql1
12 files changed, 1093 insertions, 22 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 ffcc8e9717..3b57ae0f72 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
@@ -25,11 +25,9 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
@@ -93,6 +91,9 @@ public class Service implements Serializable {
@Column(name = "RESOURCE_ORDER")
private String resourceOrder;
+ @Column(name = "OVERALL_DISTRIBUTION_STATUS")
+ private String distrobutionStatus;
+
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "network_resource_customization_to_service",
joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"),
@@ -135,6 +136,7 @@ public class Service implements Serializable {
@JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID")
private ToscaCsar csar;
+
@Override
public String toString() {
return new ToStringBuilder(this).append("modelName", modelName).append("description", description)
@@ -367,4 +369,14 @@ public class Service implements Serializable {
public void setResourceOrder(String resourceOrder) {
this.resourceOrder = resourceOrder;
}
+
+
+ public String getDistrobutionStatus() {
+ return distrobutionStatus;
+ }
+
+ public void setDistrobutionStatus(String distrobutionStatus) {
+ this.distrobutionStatus = distrobutionStatus;
+ }
+
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
index 5d9deb6c89..fb54449d5f 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
@@ -38,9 +38,9 @@ import javax.persistence.TemporalType;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
-import com.openpojo.business.annotation.BusinessKey;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
+import com.openpojo.business.annotation.BusinessKey;
import uk.co.blackpepper.bowman.annotation.LinkedResource;
@Entity
@@ -93,9 +93,6 @@ public class VnfResource implements Serializable {
@JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID")
private HeatTemplate heatTemplates;
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources")
- private List<VnfResourceCustomization> vnfResourceCustomizations;
-
@OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource")
private List<VnfResourceWorkflow> vnfResourceWorkflow;
@@ -111,8 +108,7 @@ public class VnfResource implements Serializable {
.append("toscaNodeType", toscaNodeType).append("description", description)
.append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin)
.append("aicVersionMax", aicVersionMax).append("created", created)
- .append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations)
- .append("vnfResourceWorkflow", vnfResourceWorkflow).toString();
+ .append("heatTemplates", heatTemplates).append("vnfResourceWorkflow", vnfResourceWorkflow).toString();
}
@Override
@@ -230,17 +226,6 @@ public class VnfResource implements Serializable {
}
@LinkedResource
- public List<VnfResourceCustomization> getVnfResourceCustomizations() {
- if (vnfResourceCustomizations == null)
- vnfResourceCustomizations = new ArrayList<>();
- return vnfResourceCustomizations;
- }
-
- public void setVnfResourceCustomizations(List<VnfResourceCustomization> vnfResourceCustomizations) {
- this.vnfResourceCustomizations = vnfResourceCustomizations;
- }
-
- @LinkedResource
public HeatTemplate getHeatTemplates() {
return heatTemplates;
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
index c107192060..b456beaeff 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java
@@ -30,6 +30,8 @@ import java.util.List;
public interface ServiceRepository extends JpaRepository<Service, String> {
List<Service> findByModelName(String modelName);
+ List<Service> findByModelNameAndDistrobutionStatus(String modelName, String distrobutionStatus);
+
Service findOneByModelName(String modelName);
/**
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatEnvironment.java
new file mode 100644
index 0000000000..97f67a5438
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatEnvironment.java
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Lob;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import com.openpojo.business.annotation.BusinessKey;
+
+@Entity
+@Table(name = "heat_environment")
+public class HeatEnvironment implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305392L;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ARTIFACT_UUID")
+ private String artifactUuid;
+
+ @Column(name = "NAME")
+ private String name = null;
+
+ @Column(name = "DESCRIPTION")
+ private String description = null;
+
+ @Lob
+ @Column(name = "BODY", columnDefinition = "LONGTEXT")
+ private String environment = null;
+
+ @Column(name = "ARTIFACT_CHECKSUM")
+ private String artifactChecksum;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @BusinessKey
+ @Column(name = "VERSION")
+ private String version;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof HeatEnvironment)) {
+ return false;
+ }
+ HeatEnvironment castOther = (HeatEnvironment) other;
+ return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version)
+ .isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode();
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getArtifactUuid() {
+ return this.artifactUuid;
+ }
+
+ public void setArtifactUuid(String artifactUuid) {
+ this.artifactUuid = artifactUuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getEnvironment() {
+ return this.environment;
+ }
+
+ public void setEnvironment(String environment) {
+ this.environment = environment;
+ }
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Artifact UUID=" + this.artifactUuid);
+ sb.append(", name=");
+ sb.append(name);
+ sb.append(", version=");
+ sb.append(version);
+ sb.append(", description=");
+ sb.append(this.description == null ? "null" : this.description);
+ sb.append(", body=");
+ sb.append(this.environment == null ? "null" : this.environment);
+ if (this.created != null) {
+ sb.append(",creationTimestamp=");
+ sb.append(DateFormat.getInstance().format(this.created));
+ }
+ return sb.toString();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatFile.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatFile.java
new file mode 100644
index 0000000000..94f61d30e3
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatFile.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+
+public class HeatFile implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3280125018687060890L;
+
+ private String artifactUuid;
+
+ private String description = null;
+
+ private String fileName;
+
+ private String fileBody;
+
+ private Date created;
+
+ private String artifactChecksum;
+
+ private String version;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
+ .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
+ .append("artifactChecksum", artifactChecksum).toString();
+ }
+
+ public String getArtifactUuid() {
+ return this.artifactUuid;
+ }
+
+ public void setArtifactUuid(String artifactUuid) {
+ this.artifactUuid = artifactUuid;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getFileName() {
+ return this.fileName;
+ }
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public String getFileBody() {
+ return this.fileBody;
+ }
+
+ public void setFileBody(String fileBody) {
+ this.fileBody = fileBody;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public String getAsdcUuid() {
+ return this.artifactUuid;
+ }
+
+ public void setAsdcUuid(String artifactUuid) {
+ this.artifactUuid = artifactUuid;
+ }
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplate.java
new file mode 100644
index 0000000000..cb346e4167
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplate.java
@@ -0,0 +1,147 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+
+public class HeatTemplate implements Serializable {
+
+
+ private String artifactUuid;
+
+ private String templateName;
+
+ private String templateBody = null;
+
+ private Integer timeoutMinutes;
+
+ private String version;
+
+ private String description;
+
+ private String artifactChecksum;
+
+ private Date created;
+
+ private Set<HeatTemplateParam> parameters;
+
+ private List<HeatTemplate> childTemplates;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("templateName", templateName)
+ .append("templateBody", templateBody).append("timeoutMinutes", timeoutMinutes)
+ .append("version", version).append("description", description)
+ .append("artifactChecksum", artifactChecksum).append("created", created)
+ .append("parameters", parameters).append("childTemplates", childTemplates).toString();
+ }
+
+ public List<HeatTemplate> getChildTemplates() {
+ if (childTemplates == null)
+ childTemplates = new ArrayList<>();
+ return childTemplates;
+ }
+
+ public void setChildTemplates(List<HeatTemplate> childTemplates) {
+ this.childTemplates = childTemplates;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getArtifactUuid() {
+ return this.artifactUuid;
+ }
+
+ public void setArtifactUuid(String artifactUuid) {
+ this.artifactUuid = artifactUuid;
+ }
+
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ public void setTemplateName(String templateName) {
+ this.templateName = templateName;
+ }
+
+ public String getTemplateBody() {
+ return templateBody;
+ }
+
+ public void setTemplateBody(String templateBody) {
+ this.templateBody = templateBody;
+ }
+
+ public Integer getTimeoutMinutes() {
+ return timeoutMinutes;
+ }
+
+ public void setTimeoutMinutes(Integer timeout) {
+ this.timeoutMinutes = timeout;
+ }
+
+ public Set<HeatTemplateParam> getParameters() {
+ if (parameters == null)
+ parameters = new HashSet<>();
+ return parameters;
+ }
+
+ public void setParameters(Set<HeatTemplateParam> parameters) {
+ this.parameters = parameters;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getHeatTemplate() {
+ return this.templateBody;
+ }
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplateParam.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplateParam.java
new file mode 100644
index 0000000000..a79ec962f8
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/HeatTemplateParam.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+
+public class HeatTemplateParam implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8251042980747916191L;
+
+ private String paramName;
+
+ private Boolean required;
+
+ private String paramType;
+
+ private String paramAlias;
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public void setParamName(String paramName) {
+ this.paramName = paramName;
+ }
+
+ public Boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(Boolean required) {
+ this.required = required;
+ }
+
+ public String getParamAlias() {
+ return paramAlias;
+ }
+
+ public void setParamAlias(String paramAlias) {
+ this.paramAlias = paramAlias;
+ }
+
+ public String getParamType() {
+ return paramType;
+ }
+
+ public void setParamType(String paramType) {
+ this.paramType = paramType;
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java
new file mode 100644
index 0000000000..1620058e1e
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Service.java
@@ -0,0 +1,165 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public class Service implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305392L;
+
+ private String modelName;
+
+ private String description;
+
+ private String modelVersionId;
+
+ private String modelInvariantId;
+
+ private Date created;
+
+ private String modelVersion;
+
+ private String serviceType;
+
+ private String serviceRole;
+
+ private String environmentContext;
+
+ private String workloadContext;
+
+ private String category;
+
+ private String distrobutionStatus;
+
+ private List<Vnf> vnf = new ArrayList<>();
+
+ public List<Vnf> getVnf() {
+ return vnf;
+ }
+
+ public void setVnf(List<Vnf> vnf) {
+ this.vnf = vnf;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public String getEnvironmentContext() {
+ return environmentContext;
+ }
+
+ public void setEnvironmentContext(String environmentContext) {
+ this.environmentContext = environmentContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getDistrobutionStatus() {
+ return distrobutionStatus;
+ }
+
+ public void setDistrobutionStatus(String distrobutionStatus) {
+ this.distrobutionStatus = distrobutionStatus;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java
new file mode 100644
index 0000000000..8e18f94faf
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/VfModule.java
@@ -0,0 +1,196 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.util.Date;
+import java.util.List;
+import org.onap.so.db.catalog.beans.HeatEnvironment;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public class VfModule {
+
+ // VfModule
+ private String modelVersionId;
+ private String modelInvariantId;
+ private String modelName;
+ private String modelVersion;
+ private String description;
+ private Boolean isBase;
+ private HeatTemplate heatTemplate;
+ private Date created;
+ private List<HeatFile> heatFile;
+
+ // Customization
+ private String modelCustomizationId;
+ private String label;
+ private Integer minInstances;
+ private Integer maxInstances;
+ private Integer initialCount;
+ private Integer availabilityZoneCount;
+ private HeatEnvironment heatEnv;
+ private Boolean isVolumeGroup;
+
+
+ // Add in cvnfcCustomization
+
+
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId = modelCustomizationId;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Boolean getIsBase() {
+ return isBase;
+ }
+
+ public void setIsBase(Boolean isBase) {
+ this.isBase = isBase;
+ }
+
+ public HeatTemplate getHeatTemplate() {
+ return heatTemplate;
+ }
+
+ public void setHeatTemplate(HeatTemplate heatTemplate) {
+ this.heatTemplate = heatTemplate;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public List<HeatFile> getHeatFile() {
+ return heatFile;
+ }
+
+ public void setHeatFile(List<HeatFile> heatFile) {
+ this.heatFile = heatFile;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public Integer getMinInstances() {
+ return minInstances;
+ }
+
+ public void setMinInstances(Integer minInstances) {
+ this.minInstances = minInstances;
+ }
+
+ public Integer getMaxInstances() {
+ return maxInstances;
+ }
+
+ public void setMaxInstances(Integer maxInstances) {
+ this.maxInstances = maxInstances;
+ }
+
+ public Integer getInitialCount() {
+ return initialCount;
+ }
+
+ public void setInitialCount(Integer integer) {
+ this.initialCount = integer;
+ }
+
+ public Integer getAvailabilityZoneCount() {
+ return availabilityZoneCount;
+ }
+
+ public void setAvailabilityZoneCount(Integer availabilityZoneCount) {
+ this.availabilityZoneCount = availabilityZoneCount;
+ }
+
+ public HeatEnvironment getHeatEnv() {
+ return heatEnv;
+ }
+
+ public void setHeatEnv(HeatEnvironment heatEnv) {
+ this.heatEnv = heatEnv;
+ }
+
+ public Boolean getIsVolumeGroup() {
+ return isVolumeGroup;
+ }
+
+ public void setIsVolumeGroup(Boolean isVolumeGroup) {
+ this.isVolumeGroup = isVolumeGroup;
+ }
+
+
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java
new file mode 100644
index 0000000000..40d701c3c5
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/rest/catalog/beans/Vnf.java
@@ -0,0 +1,218 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T 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.rest.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public class Vnf implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2956199674955504834L;
+
+ private String modelName;
+ private String modelVersionId;
+ private String modelInvariantId;
+ private String modelVersion;
+ private String modelCustomizationId;
+ private String modelInstanceName;
+ private Integer minInstances;
+ private Integer maxInstances;
+ private Integer availabilityZoneMaxCount;
+ private String toscaNodeType;
+ private String nfFunction;
+ private String nfRole;
+ private String nfNamingCode;
+ private String multiStageDesign;
+ private String orchestrationMode;
+ private String cloudVersionMin;
+ private String cloudVersionMax;
+ private String category;
+ private String subCategory;
+ private List<VfModule> vfModule = new ArrayList<>();
+
+ public List<VfModule> getVfModule() {
+ return vfModule;
+ }
+
+ public void setVfModule(List<VfModule> vfModule) {
+ this.vfModule = vfModule;
+ }
+
+ public Integer getAvailabilityZoneMaxCount() {
+ return availabilityZoneMaxCount;
+ }
+
+ public void setAvailabilityZoneMaxCount(Integer availabilityZoneMaxCount) {
+ this.availabilityZoneMaxCount = availabilityZoneMaxCount;
+ }
+
+ public Integer getMinInstances() {
+ return minInstances;
+ }
+
+ public void setMinInstances(Integer minInstances) {
+ this.minInstances = minInstances;
+ }
+
+ public Integer getMaxInstances() {
+ return maxInstances;
+ }
+
+ public void setMaxInstances(Integer maxInstances) {
+ this.maxInstances = maxInstances;
+ }
+
+ public String getCloudVersionMin() {
+ return cloudVersionMin;
+ }
+
+ public void setCloudVersionMin(String cloudVersionMin) {
+ this.cloudVersionMin = cloudVersionMin;
+ }
+
+ public String getCloudVersionMax() {
+ return cloudVersionMax;
+ }
+
+ public void setCloudVersionMax(String cloudVersionMax) {
+ this.cloudVersionMax = cloudVersionMax;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelCustomizationId() {
+ return modelCustomizationId;
+ }
+
+ public void setModelCustomizationId(String modelCustomizationId) {
+ this.modelCustomizationId = modelCustomizationId;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ public String getOrchestrationMode() {
+ return orchestrationMode;
+ }
+
+ public void setOrchestrationMode(String orchestrationMode) {
+ this.orchestrationMode = orchestrationMode;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+
+ public String getModelInstanceName() {
+ return modelInstanceName;
+ }
+
+ public void setModelInstanceName(String modelInstanceName) {
+ this.modelInstanceName = modelInstanceName;
+ }
+
+ public String getToscaNodeType() {
+ return toscaNodeType;
+ }
+
+ public void setToscaNodeType(String toscaNodeType) {
+ this.toscaNodeType = toscaNodeType;
+ }
+
+ public String getNfFunction() {
+ return nfFunction;
+ }
+
+ public void setNfFunction(String nfFunction) {
+ this.nfFunction = nfFunction;
+ }
+
+ public String getNfRole() {
+ return nfRole;
+ }
+
+ public void setNfRole(String nfRole) {
+ this.nfRole = nfRole;
+ }
+
+ public String getNfNamingCode() {
+ return nfNamingCode;
+ }
+
+ public void setNfNamingCode(String nfNamingCode) {
+ this.nfNamingCode = nfNamingCode;
+ }
+
+ public String getMultiStageDesign() {
+ return multiStageDesign;
+ }
+
+ public void setMultiStageDesign(String multiStepDesign) {
+ this.multiStageDesign = multiStepDesign;
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java
index 371a9c13e0..e8addc4aa8 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepositoryTest.java
@@ -74,7 +74,6 @@ public class CvnfcCustomizationRepositoryTest extends BaseTest {
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
vnfResourceCustomizations.add(vnfResourceCustomization);
- vnfResource.setVnfResourceCustomizations(vnfResourceCustomizations);
vnfResourceCustomization.setVnfResources(vnfResource);
@@ -123,7 +122,6 @@ public class CvnfcCustomizationRepositoryTest extends BaseTest {
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList<>();
vnfResourceCustomizations.add(vnfResourceCustomization);
- vnfResource.setVnfResourceCustomizations(vnfResourceCustomizations);
vnfResourceCustomization.setVnfResources(vnfResource);
@@ -177,7 +175,6 @@ public class CvnfcCustomizationRepositoryTest extends BaseTest {
List<VnfResourceCustomization> vnfResourceCustomizations = new ArrayList();
vnfResourceCustomizations.add(vnfResourceCustomization);
- vnfResource.setVnfResourceCustomizations(vnfResourceCustomizations);
vnfResourceCustomization.setVnfResources(vnfResource);
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 34340f1357..0856a4cbe2 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -803,6 +803,7 @@ CREATE TABLE `service` (
`WORKLOAD_CONTEXT` varchar(200) DEFAULT NULL,
`SERVICE_CATEGORY` varchar(200) DEFAULT NULL,
`RESOURCE_ORDER` varchar(200) default NULL,
+ OVERALL_DISTRIBUTION_STATUS varchar(45),
PRIMARY KEY (`MODEL_UUID`),
KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`),
CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE