diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans')
30 files changed, 1524 insertions, 756 deletions
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java new file mode 100644 index 0000000000..477b688ff8 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResource.java @@ -0,0 +1,93 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class AllottedResource extends MavenLikeVersioning implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305392L;
+
+ private String modelUuid;
+ private String modelInvariantUuid;
+ private String modelVersion;
+ private String modelName;
+ private String toscaNodeType;
+ private String subcategory;
+ private String description;
+ private Timestamp created;
+
+ public AllottedResource() {
+ }
+
+ public String getModelUuid() {
+ return this.modelUuid;
+ }
+ public void setModelUuid(String modelUuid) {
+ this.modelUuid = modelUuid;
+ }
+ public String getModelInvariantUuid() {
+ return this.modelInvariantUuid;
+ }
+ public void setModelInvariantUuid(String modelInvariantUuid) {
+ this.modelInvariantUuid = modelInvariantUuid;
+ }
+ public String getModelVersion() {
+ return this.modelVersion;
+ }
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+ public String getModelName() {
+ return this.modelName;
+ }
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+ public String getToscaNodeType() {
+ return this.toscaNodeType;
+ }
+ public void setToscaNodeType(String toscaNodeType) {
+ this.toscaNodeType = toscaNodeType;
+ }
+ public String getSubcategory() {
+ return this.subcategory;
+ }
+ public void setSubcategory(String subcategory) {
+ this.subcategory = subcategory;
+ }
+ public String getDescription() {
+ return this.description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ public Timestamp getCreated() {
+ return created;
+ }
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java index d7dd2adfa6..d9a36a1a25 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/AllottedResourceCustomization.java @@ -19,20 +19,29 @@ */ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; +import org.openecomp.mso.db.catalog.beans.AllottedResource; -public class AllottedResourceCustomization extends MavenLikeVersioning { +public class AllottedResourceCustomization extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private String modelCustomizationUuid; - private String modelUuid; - private String modelInvariantUuid; - private String modelVersion = null; // duplicate of version kept in parent class - private String modelName; - private String description; + private String arModelUuid; private Timestamp created; private String modelInstanceName; + private String providingServiceModelInvariantUuid; + private String targetNetworkRole; + private String nfFunction; + private String nfType; + private String nfRole; + private String nfNamingCode; + private Integer minInstances; + private Integer maxInstances; + private AllottedResource ar = null; public AllottedResourceCustomization() { super(); @@ -45,32 +54,11 @@ public class AllottedResourceCustomization extends MavenLikeVersioning { this.modelCustomizationUuid = modelCustomizationUuid; } - public String getModelUuid() { - return this.modelUuid; + public String getArModelUuid() { + return this.arModelUuid; } - public void setModelUuid(String modelUuid) { - this.modelUuid = modelUuid; - } - - public String getModelInvariantUuid() { - return this.modelInvariantUuid; - } - public void setModelInvariantUuid(String modelInvariantUuid) { - this.modelInvariantUuid = modelInvariantUuid; - } - - public String getModelName() { - return this.modelName; - } - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getDescription() { - return this.description; - } - public void setDescription(String description) { - this.description = description; + public void setArModelUuid(String arModelUuid) { + this.arModelUuid = arModelUuid; } public Timestamp getCreated() { @@ -86,38 +74,74 @@ public class AllottedResourceCustomization extends MavenLikeVersioning { public void setModelInstanceName(String modelInstanceName) { this.modelInstanceName = modelInstanceName; } - public String getModelVersion() { - return this.modelVersion; + public AllottedResource getAllottedResource() { + return this.ar; } - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; + public void setAllottedResource(AllottedResource ar) { + this.ar = ar; + } + public String getProvidingServiceModelInvariantUuid() { + return this.providingServiceModelInvariantUuid; + } + public void setProvidingServiceModelInvariantUuid(String providingServiceModelInvariantUuid) { + this.providingServiceModelInvariantUuid = providingServiceModelInvariantUuid; + } + public String getTargetNetworkRole() { + return this.targetNetworkRole; + } + public void setTargetNetworkRole(String targetNetworkRole) { + this.targetNetworkRole = targetNetworkRole; + } + public String getNfFunction() { + return this.nfFunction; + } + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + public String getNfType() { + return this.nfType; + } + public void setNfType(String nfType) { + this.nfType = nfType; + } + public String getNfRole() { + return this.nfRole; + } + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + public String getNfNamingCode() { + return this.nfNamingCode; + } + public void setNfNamingCode(String nfNamingCode) { + this.nfNamingCode = nfNamingCode; + } + public Integer getMinInstances() { + return this.minInstances; + } + public void setMinInstances(Integer minInstances) { + this.minInstances = minInstances; + } + public Integer getMaxInstances() { + return this.maxInstances; + } + public void setMaxInstances(Integer maxInstances) { + this.maxInstances = maxInstances; } - - public String getModelInvariantId() { return "not yet implemented"; } @Override public String toString () { StringBuffer sb = new StringBuffer(); - sb.append("modelName="); - sb.append(this.modelName); - sb.append(",modelVersion="); - sb.append(this.modelVersion); - sb.append(",version="); - sb.append(this.version); - sb.append(",modelUuid="); - sb.append(this.modelUuid); - sb.append(",modelInvariantUuid="); - sb.append(this.modelInvariantUuid); - sb.append(",modelCustomizationUuid="); + sb.append("modelCustomizationUuid="); sb.append(this.modelCustomizationUuid); sb.append(",modelInstanceName="); sb.append(this.modelInstanceName); - sb.append(",description="); - sb.append(this.description); sb.append(",modelInstanceName="); sb.append(this.modelInstanceName); sb.append(",created="); sb.append(this.created); + sb.append(",ar="); + sb.append(this.ar); return sb.toString(); } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java index a920375bcd..b7275f1a24 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java @@ -20,47 +20,37 @@ package org.openecomp.mso.db.catalog.beans; - +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class HeatEnvironment extends MavenLikeVersioning { - private int id; +public class HeatEnvironment extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + + private String artifactUuid; private String name = null; private String description = null; private String environment = null; - - private String asdcUuid; - private String asdcResourceName; - private String asdcLabel; private String artifactChecksum; private Timestamp created; public HeatEnvironment() {} - public int getId() { - return this.id; + public String getArtifactUuid() { + return this.artifactUuid; } - - public void setId(int id) { - this.id = id; + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; } - - /** - * @return the name - */ public String getName () { return name; } - - /** - * @param name the name to set - */ public void setName (String name) { this.name = name; } @@ -79,20 +69,6 @@ public class HeatEnvironment extends MavenLikeVersioning { this.environment = environment; } - public String getAsdcUuid() { - return asdcUuid; - } - - public void setAsdcUuid(String asdcUuid) { - this.asdcUuid = asdcUuid; - } - public String getAsdcLabel() { - return this.asdcLabel; - } - public void setAsdcLabel(String asdcLabel) { - this.asdcLabel = asdcLabel; - } - public String getArtifactChecksum() { return artifactChecksum; } @@ -101,21 +77,6 @@ public class HeatEnvironment extends MavenLikeVersioning { this.artifactChecksum = artifactChecksum; } - /** - * @return the asdcResourceName - */ - public String getAsdcResourceName () { - return asdcResourceName; - } - - - /** - * @param asdcResourceName the asdcResourceName to set - */ - public void setAsdcResourceName (String asdcResourceName) { - this.asdcResourceName = asdcResourceName; - } - public Timestamp getCreated() { return created; } @@ -127,22 +88,18 @@ public class HeatEnvironment extends MavenLikeVersioning { @Override public String toString () { StringBuffer sb = new StringBuffer(); - sb.append ("ID=" + this.id); + sb.append ("Artifact UUID=" + this.artifactUuid); sb.append (", name="); sb.append (name); sb.append (", version="); sb.append (version); sb.append(", description="); - sb.append (description == null ? "null" : description); - sb.append(", environment="); - sb.append (environment == null ? "null" : environment); - sb.append(", asdcUuid="); - sb.append (asdcUuid == null ? "null" : asdcUuid); - sb.append (", asdcResourceName="); - sb.append (asdcResourceName == null ? "null" : asdcResourceName); - if (created != null) { - sb.append (",created="); - sb.append (DateFormat.getInstance().format(created)); + 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/openecomp/mso/db/catalog/beans/HeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java index d379c2471a..b85ff34365 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java @@ -20,32 +20,31 @@ package org.openecomp.mso.db.catalog.beans; - +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class HeatFiles extends MavenLikeVersioning { - private int id; +public class HeatFiles extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + + private String artifactUuid; private String description = null; private String fileName; private String fileBody; - private int vnfResourceId; private Timestamp created; - private String asdcUuid; - private String asdcLabel; - private String asdcResourceName; + private String version; private String artifactChecksum; public HeatFiles() {} - public int getId() { - return this.id; + public String getArtifactUuid() { + return this.artifactUuid; } - - public void setId(int id) { - this.id = id; + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; } public String getDescription() { @@ -69,13 +68,6 @@ public class HeatFiles extends MavenLikeVersioning { this.fileBody = fileBody; } - public int getVnfResourceId() { - return this.vnfResourceId; - } - public void setVnfResourceId(int vnfResourceId) { - this.vnfResourceId = vnfResourceId; - } - public Timestamp getCreated() { return created; } @@ -85,29 +77,22 @@ public class HeatFiles extends MavenLikeVersioning { } public String getAsdcUuid() { - return this.asdcUuid; + return this.artifactUuid; } - public void setAsdcUuid(String asdcUuid) { - this.asdcUuid = asdcUuid; + public void setAsdcUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; } - public String getAsdcLabel() { - return this.asdcLabel; - } - public void setAsdcLabel(String asdcLabel) { - this.asdcLabel = asdcLabel; - } - public String getAsdcResourceName() { - return asdcResourceName; + public String getVersion() { + return version; } - public void setAsdcResourceName(String asdcResourceName) { - this.asdcResourceName = asdcResourceName; + public void setVersion(String version) { + this.version = version; } public String getArtifactChecksum() { return artifactChecksum; } - public void setArtifactChecksum(String artifactChecksum) { this.artifactChecksum = artifactChecksum; } @@ -115,7 +100,7 @@ public class HeatFiles extends MavenLikeVersioning { @Override public String toString () { StringBuffer sb = new StringBuffer(); - sb.append ("ID=" + this.id); + sb.append ("artifactUuid=" + this.artifactUuid); if (this.description == null) { sb.append(", description=null"); } else { @@ -131,16 +116,11 @@ public class HeatFiles extends MavenLikeVersioning { } else { sb.append(",fileBody=" + this.fileBody); } - if (this.asdcResourceName == null) { - sb.append(", asdcResourceName=null"); - } else { - sb.append(",asdcResourceName=" + this.asdcResourceName); - } + sb.append(", artifactChecksum=" + this.artifactChecksum); if (created != null) { sb.append (",created="); sb.append (DateFormat.getInstance().format(created)); } - sb.append(", vnfResourceId=" + this.vnfResourceId); return sb.toString(); } } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java index eabbacf547..5bdf21b716 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java @@ -25,8 +25,8 @@ import java.io.Serializable; public class HeatNestedTemplate implements Serializable { - private int parentTemplateId; - private int childTemplateId; + private String parentTemplateId; + private String childTemplateId; private String providerResourceFile; public static final long serialVersionUID = -1322322139926390329L; @@ -34,19 +34,19 @@ public class HeatNestedTemplate implements Serializable { super (); } - public void setParentTemplateId (int parentTemplateId) { + public void setParentTemplateId (String parentTemplateId) { this.parentTemplateId = parentTemplateId; } - public int getParentTemplateId () { + public String getParentTemplateId () { return this.parentTemplateId; } - public void setChildTemplateId (int childTemplateId) { + public void setChildTemplateId (String childTemplateId) { this.childTemplateId = childTemplateId; } - public int getChildTemplateId () { + public String getChildTemplateId () { return this.childTemplateId; } @@ -91,7 +91,7 @@ public class HeatNestedTemplate implements Serializable { // hash code does not have to be a unique result - only that two objects that should be treated as equal // return the same value. so this should work. int result = 0; - result = this.parentTemplateId + this.childTemplateId; + result = this.parentTemplateId.hashCode() + this.childTemplateId.hashCode(); return result; } } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java index 5762837bfb..c045a7e39f 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java @@ -20,32 +20,28 @@ package org.openecomp.mso.db.catalog.beans; - -import java.io.BufferedReader; -import java.io.FileReader; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; -import java.util.Date; import java.util.Set; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; import org.openecomp.mso.logger.MsoLogger; -public class HeatTemplate extends MavenLikeVersioning { +public class HeatTemplate extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); - private int id; + private String artifactUuid; private String templateName; - private String templatePath = null; private String templateBody = null; private int timeoutMinutes; private Set <HeatTemplateParam> parameters; private Set <HeatNestedTemplate> files; private String description; private String asdcUuid; - private String asdcResourceName; - private String asdcLabel; private String artifactChecksum; private Timestamp created; @@ -57,12 +53,12 @@ public class HeatTemplate extends MavenLikeVersioning { public HeatTemplate () { } - public int getId () { - return id; + public String getArtifactUuid() { + return this.artifactUuid; } - public void setId (int id) { - this.id = id; + public void setArtifactUuid (String artifactUuid) { + this.artifactUuid = artifactUuid; } public String getTemplateName () { @@ -73,14 +69,6 @@ public class HeatTemplate extends MavenLikeVersioning { this.templateName = templateName; } - public String getTemplatePath () { - return templatePath; - } - - public void setTemplatePath (String templatePath) { - this.templatePath = templatePath; - } - public String getTemplateBody () { return templateBody; } @@ -114,26 +102,7 @@ public class HeatTemplate extends MavenLikeVersioning { } public String getHeatTemplate () { - if (templateBody != null && !templateBody.isEmpty ()) { - // The template body is in the DB table. Just return it. - return templateBody; - } - - String body = null; - - try (BufferedReader reader = new BufferedReader (new FileReader (templatePath))) - { - String line = null; - StringBuilder stringBuilder = new StringBuilder (); - while ((line = reader.readLine ()) != null) { - stringBuilder.append (line); - } - body = stringBuilder.toString (); - } catch (Exception e) { - LOGGER.debug ("Error reading template file " + templatePath, e); - } - - return body; + return this.templateBody; } public void setFiles (Set <HeatNestedTemplate> files) { @@ -152,20 +121,6 @@ public class HeatTemplate extends MavenLikeVersioning { this.asdcUuid = asdcUuidp; } - public String getAsdcResourceName() { - return asdcResourceName; - } - - public void setAsdcResourceName(String asdcResourceName) { - this.asdcResourceName = asdcResourceName; - } - public String getAsdcLabel() { - return this.asdcLabel; - } - public void setAsdcLabel(String asdcLabel) { - this.asdcLabel = asdcLabel; - } - public String getArtifactChecksum() { return artifactChecksum; } @@ -173,6 +128,7 @@ public class HeatTemplate extends MavenLikeVersioning { public void setArtifactChecksum(String artifactChecksum) { this.artifactChecksum = artifactChecksum; } + public Timestamp getCreated() { return created; } @@ -189,16 +145,12 @@ public class HeatTemplate extends MavenLikeVersioning { .append (templateName) .append (",version=") .append (version) - .append (",path=") - .append (templatePath) .append (",body=") .append (body) .append (",timeout=") .append (timeoutMinutes) .append (",asdcUuid=") .append (asdcUuid) - .append (",asdcResourceName=") - .append (asdcResourceName) .append (",description=") .append (description); if (created != null) { diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java new file mode 100644 index 0000000000..c507b3967f --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateArtifactUuidModelUuid.java @@ -0,0 +1,81 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+
+// an embeddable class to represent the Composite key for NetworkResource in the 1707 db refactoring
+public class HeatTemplateArtifactUuidModelUuid implements Serializable {
+
+ private String heatTemplateArtifactUuid;
+ private String modelUuid;
+ public static final long serialVersionUID = -1322322139926390329L;
+
+ public HeatTemplateArtifactUuidModelUuid() {
+ }
+
+ public String getHeatTemplateArtifactUuid() {
+ return this.heatTemplateArtifactUuid;
+ }
+ public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
+ this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
+ }
+ public String getModelUuid() {
+ return this.modelUuid;
+ }
+ public void setModelUuid(String modelUuid) {
+ this.modelUuid = modelUuid;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid);
+ sb.append(" modelUuid=" + this.modelUuid);
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals (Object o) {
+ if (!(o instanceof HeatTemplateArtifactUuidModelUuid)) {
+ return false;
+ }
+ if (this == o) {
+ return true;
+ }
+ HeatTemplateArtifactUuidModelUuid htaumu = (HeatTemplateArtifactUuidModelUuid) o;
+ if (htaumu.getHeatTemplateArtifactUuid().equals(this.getHeatTemplateArtifactUuid())
+ && htaumu.getModelUuid().equals(this.getModelUuid())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode () {
+ // hash code does not have to be a unique result - only that two objects that should be treated as equal
+ // return the same value. so this should work.
+ int result = 0;
+ result = this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();
+ return result;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java index 0d77a0a4f8..939b0d1f11 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java @@ -20,29 +20,26 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; -public class HeatTemplateParam { - private int id; - private int heatTemplateId; +public class HeatTemplateParam implements Serializable { + + private String heatTemplateArtifactUuid; private String paramName; private boolean required; private String paramType; private String paramAlias; + public static final long serialVersionUID = -1322322139926390329L; public HeatTemplateParam() {} - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; } - public int getHeatTemplateId() { - return heatTemplateId; - } - public void setHeatTemplateId(int heatTemplateId) { - this.heatTemplateId = heatTemplateId; + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; } + public String getParamName() { return paramName; } @@ -65,7 +62,6 @@ public class HeatTemplateParam { public String getParamType() { return paramType; } - public void setParamType (String paramType) { this.paramType = paramType; } @@ -73,6 +69,28 @@ public class HeatTemplateParam { @Override public String toString () { - return "Param=" + paramName + ",type=" + paramType + ",required=" + required + ",paramAlias=" + paramAlias; + return "Param=" + paramName + ",type=" + paramType + ",required=" + required + ",paramAlias=" + paramAlias + ", heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid; + } + + @Override + public boolean equals (Object o) { + if (!(o instanceof HeatTemplateParam)) { + return false; + } + if (this == o) { + return true; + } + HeatTemplateParam htp = (HeatTemplateParam) o; + if (htp.getHeatTemplateArtifactUuid().equals(this.heatTemplateArtifactUuid) && htp.getParamName().equalsIgnoreCase(this.paramName)) { + return true; + } + return false; + } + + @Override + public int hashCode () { + int result = 0; + result = this.paramName == null ? 0 : this.paramName.hashCode() + this.heatTemplateArtifactUuid == null ? 0 : this.heatTemplateArtifactUuid.hashCode(); + return result; } } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java index 51153c912b..45d812de8b 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Model.java @@ -20,13 +20,16 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import java.util.Map; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; +public class Model extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; -public class Model extends MavenLikeVersioning { private int id; private String modelCustomizationId; private String modelCustomizationName; diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java index 83fb773a8c..4af501a587 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ModelRecipe.java @@ -20,11 +20,15 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class ModelRecipe extends MavenLikeVersioning { +public class ModelRecipe extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + private int id; private Integer modelId; private String action; diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java index 1cd3526946..40612ad841 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java @@ -21,16 +21,19 @@ package org.openecomp.mso.db.catalog.beans; -public class NetworkRecipe extends Recipe { - private String networkType; +import java.io.Serializable; + +public class NetworkRecipe extends Recipe implements Serializable { + private static final long serialVersionUID = 768026109321305392L; + private String modelName; private String networkParamXSD; public NetworkRecipe() {} - public String getNetworkType() { - return networkType; + public String getModelName() { + return modelName; } - public void setNetworkType(String networkType) { - this.networkType = networkType; + public void setModelName(String modelName) { + this.modelName = modelName; } public String getNetworkParamXSD() { @@ -44,7 +47,7 @@ public class NetworkRecipe extends Recipe { public String toString () { StringBuffer sb = new StringBuffer(); sb.append(super.toString()); - sb.append (",networkType=" + networkType); + sb.append (",modelName=" + modelName); sb.append (",networkParamXSD=" + networkParamXSD); return sb.toString(); } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java index be812fa346..9dbdb92b1b 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java @@ -20,44 +20,35 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; +import java.sql.Timestamp; +import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -import java.sql.Timestamp; -import java.text.DateFormat; +public class NetworkResource extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; -public class NetworkResource extends MavenLikeVersioning { - private int id; - private String networkType; private String orchestrationMode = null; private String description = null; - private int templateId; private String neutronNetworkType = null; private String aicVersionMin = null; private String aicVersionMax = null; - + private String modelName; + private String modelInvariantUUID; + private String modelVersion; + private String toscaNodeType; private Timestamp created; + private String modelUUID; + private String heatTemplateArtifactUUID; public NetworkResource() {} - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getNetworkType() { - return networkType; - } - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - public String getOrchestrationMode() { return orchestrationMode; } + public void setOrchestrationMode(String orchestrationMode) { this.orchestrationMode = orchestrationMode; } @@ -69,14 +60,6 @@ public class NetworkResource extends MavenLikeVersioning { this.description = description; } - public int getTemplateId () { - return templateId; - } - - public void setTemplateId (int templateId) { - this.templateId = templateId; - } - public String getNeutronNetworkType() { return neutronNetworkType; } @@ -109,31 +92,84 @@ public class NetworkResource extends MavenLikeVersioning { this.aicVersionMax = aicVersionMax; } + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getHeatTemplateArtifactUUID() { + return heatTemplateArtifactUUID; + } + + public void setHeatTemplateArtifactUUID(String heatTemplateArtifactUUID) { + this.heatTemplateArtifactUUID = heatTemplateArtifactUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + @Override public String toString () { StringBuffer sb = new StringBuffer(); - sb.append("NETWORK="); - sb.append(networkType); - sb.append(",version="); - sb.append(version); + sb.append("NETWORK Resource:"); + sb.append("modelVersion="); + sb.append(modelVersion); sb.append(",mode="); sb.append(orchestrationMode); - sb.append(",template="); - sb.append(templateId); sb.append(",neutronType="); sb.append(neutronNetworkType); sb.append(",aicVersionMin="); sb.append(aicVersionMin); sb.append(",aicVersionMax="); sb.append(aicVersionMax); - - sb.append("id="); - sb.append(id); + sb.append(",modelName="); + sb.append(modelName); + sb.append(",modelInvariantUUID="); + sb.append(modelInvariantUUID); + sb.append(",toscaNodeType="); + sb.append(toscaNodeType); + sb.append(",modelUUID="); + sb.append(modelUUID); + sb.append(",heatTemplateArtifactUUID="); + sb.append(heatTemplateArtifactUUID); if (created != null) { sb.append (",created="); sb.append (DateFormat.getInstance().format(created)); } + return sb.toString(); } } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java index dc8aaadea2..aa84aeb544 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResourceCustomization.java @@ -20,56 +20,28 @@ package org.openecomp.mso.db.catalog.beans; import java.sql.Timestamp; +import java.io.Serializable; -import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; +public class NetworkResourceCustomization implements Serializable{ -public class NetworkResourceCustomization extends MavenLikeVersioning{ - - private String modelCustomizationUuid; - private String modelName; + // modelCustomizationUuid and networkResourceModelUuid form a composite primary key + private String modelCustomizationUuid = null; + private String networkResourceModelUuid = null; + public static final long serialVersionUID = -1322322139926390329L; private String modelInstanceName; - private String modelUuid; - private String modelVersion; - private String modelInvariantUuid; - private int networkResourceId = 0; private Timestamp created; + private String networkTechnology; + private String networkType = null; + private String networkScope; + private String networkRole; // These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with private NetworkResource networkResource = null; - private String networkType = null; public NetworkResourceCustomization() { super(); } - public int getNetworkResourceId() { - return this.networkResourceId; - } - public void setNetworkResourceId(int networkResourceId) { - this.networkResourceId = networkResourceId; - } - - public String getModelUuid() { - return this.modelUuid; - } - public void setModelUuid(String modelUuid) { - this.modelUuid = modelUuid; - } - - public String getModelInvariantUuid() { - return this.modelInvariantUuid; - } - public void setModelInvariantUuid(String modelInvariantUuid) { - this.modelInvariantUuid = modelInvariantUuid; - } - - public String getModelVersion() { - return this.modelVersion; - } - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - public String getModelCustomizationUuid() { return this.modelCustomizationUuid; } @@ -77,6 +49,13 @@ public class NetworkResourceCustomization extends MavenLikeVersioning{ this.modelCustomizationUuid = modelCustomizationUuid; } + public String getNetworkResourceModelUuid() { + return this.networkResourceModelUuid; + } + public void setNetworkResourceModelUuid(String networkResourceModelUuid) { + this.networkResourceModelUuid = networkResourceModelUuid; + } + public String getModelInstanceName() { return this.modelInstanceName; } @@ -84,13 +63,6 @@ public class NetworkResourceCustomization extends MavenLikeVersioning{ this.modelInstanceName = modelInstanceName; } - public String getModelName() { - return this.modelName; - } - public void setModelName(String modelName) { - this.modelName = modelName; - } - public NetworkResource getNetworkResource() { return this.networkResource; } @@ -107,35 +79,73 @@ public class NetworkResourceCustomization extends MavenLikeVersioning{ public Timestamp getCreated() { return this.created; } - public void setCreated(Timestamp timestamp) { + public void setCreated(java.sql.Timestamp timestamp) { this.created = timestamp; } - public String getModelInvariantId() { return "not yet implemented"; } + public String getNetworkTechnology() { + return this.networkTechnology; + } + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + public String getNetworkScope() { + return this.networkScope; + } + public void setNetworkScope(String networkScope) { + this.networkScope = networkScope; + } + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } + public String getNetworkRole() { + return this.networkRole; + } @Override public String toString () { StringBuffer sb = new StringBuffer(); - sb.append("modelName="); - sb.append(this.modelName); - sb.append("modelUuid="); - sb.append(this.modelUuid); - sb.append("modelUuid="); - sb.append(this.modelUuid); - sb.append("modelInvariantUuid="); - sb.append(this.modelInvariantUuid); - sb.append("modelVersion="); - sb.append(this.modelVersion); sb.append("modelCustomizationUuid="); sb.append(this.modelCustomizationUuid); + sb.append("networkResourceModelUuid="); + sb.append(this.networkResourceModelUuid); sb.append("modelInstanceName="); sb.append(this.modelInstanceName); - sb.append("networkResourceId="); - sb.append(this.networkResourceId); sb.append("networkType="); sb.append(this.networkType); + sb.append("networkTechnology="); + sb.append(this.networkTechnology); + sb.append("networkScope="); + sb.append(this.networkScope); + sb.append("networkRole="); + sb.append(this.networkRole); return sb.toString(); } + @Override + public boolean equals (Object o) { + if (!(o instanceof NetworkResourceCustomization)) { + return false; + } + if (this == o) { + return true; + } + NetworkResourceCustomization nrc = (NetworkResourceCustomization) o; + if (nrc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid()) + && nrc.getNetworkResourceModelUuid().equals(this.getNetworkResourceModelUuid())) { + return true; + } + return false; + } + + @Override + public int hashCode () { + // hash code does not have to be a unique result - only that two objects that should be treated as equal + // return the same value. so this should work. + int result = 0; + result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.networkResourceModelUuid != null ? this.networkResourceModelUuid.hashCode() : 0); + return result; + } + }
\ No newline at end of file diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java index b0a34e6c60..365cfb03b4 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java @@ -21,12 +21,15 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class Recipe extends MavenLikeVersioning { +public class Recipe extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private int id; protected String action; diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java index 07fb35596e..1caa34857b 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java @@ -20,40 +20,37 @@ package org.openecomp.mso.db.catalog.beans; - - import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import java.util.Map; +import java.util.Set; -public class Service extends MavenLikeVersioning { - private int id; - private String serviceName; - private String description; - private String httpMethod; - private String serviceNameVersionId; - private String serviceVersion; - private Map<String,ServiceRecipe> recipes; +public class Service extends MavenLikeVersioning implements Serializable { + private static final long serialVersionUID = 768026109321305392L; + + private String modelName; + private String description; + private String modelUUID; private String modelInvariantUUID; private Timestamp created; + private String toscaCsarArtifactUUID; + private String modelVersion; + private String serviceType; + private String serviceRole; + private Map<String,ServiceRecipe> recipes; + private Set<ServiceToResourceCustomization> serviceResourceCustomizations; public Service() {} - public int getId() { - return id; + public String getModelName() { + return modelName; } - public void setId(int id) { - this.id = id; - } - - public String getServiceName() { - return serviceName; - } - public void setServiceName(String serviceName) { - this.serviceName = serviceName; + public void setModelName(String modelName) { + this.modelName = modelName; } public String getDescription() { @@ -78,46 +75,75 @@ public class Service extends MavenLikeVersioning { this.created = created; } - public String getHttpMethod() { - return httpMethod; + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; } - public void setHttpMethod(String httpMethod) { - this.httpMethod = httpMethod; + public String getModelInvariantUUID() { + return modelInvariantUUID; } - public String getServiceNameVersionId() { - return serviceNameVersionId; + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; } - public void setServiceNameVersionId(String serviceNameVersionId) { - this.serviceNameVersionId = serviceNameVersionId; + public String getToscaCsarArtifactUUID() { + return toscaCsarArtifactUUID; } - public String getServiceVersion() { - return serviceVersion; + public void setToscaCsarArtifactUUID(String toscaCsarArtifactUUID) { + this.toscaCsarArtifactUUID = toscaCsarArtifactUUID; } - public void setServiceVersion(String serviceVersion) { - this.serviceVersion = serviceVersion; + public Set<ServiceToResourceCustomization> getServiceResourceCustomizations() { + return serviceResourceCustomizations; + } + + public void setServiceResourceCustomizations(Set<ServiceToResourceCustomization> serviceResourceCustomizations) { + this.serviceResourceCustomizations = serviceResourceCustomizations; } - public String getModelInvariantUUID() { - return modelInvariantUUID; + public String getModelVersion() { + return modelVersion; } - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; + 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; } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("SERVICE: id=" + id + ",name=" + serviceName + ",version=" + version + ",description=" + description+",modelInvariantUUID="+modelInvariantUUID); + sb.append("SERVICE: name=" + modelName + ",modelVersion=" + modelVersion + ",description=" + description+",modelInvariantUUID="+modelInvariantUUID+",toscaCsarArtifactUUID="+toscaCsarArtifactUUID+",serviceType="+serviceType+",serviceRole="+serviceRole); for (String recipeAction : recipes.keySet()) { ServiceRecipe recipe = recipes.get(recipeAction); sb.append ("\n" + recipe.toString()); } + + for(ServiceToResourceCustomization serviceResourceCustomization : serviceResourceCustomizations) { + sb.append("\n" + serviceResourceCustomization.toString()); + } if (created != null) { sb.append (",created="); sb.append (DateFormat.getInstance().format(created)); diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java index 01369c4ecd..81409b112a 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceMacroHolder.java @@ -22,6 +22,7 @@ package org.openecomp.mso.db.catalog.beans; import org.openecomp.mso.db.catalog.beans.Service; import org.openecomp.mso.db.catalog.beans.VnfResource; import org.openecomp.mso.db.catalog.beans.VfModule; +import java.io.Serializable; import java.util.ArrayList; /* @@ -29,12 +30,15 @@ import java.util.ArrayList; * VnfResource, 1-n VfModule, Network TBD */ -public class ServiceMacroHolder { +public class ServiceMacroHolder implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private Service service; private ArrayList<VnfResource> vnfResources; private ArrayList<NetworkResourceCustomization> networkResourceCustomizations; private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations; + private ArrayList<VnfResourceCustomization> vnfResourceCustomizations; public ServiceMacroHolder() { super(); @@ -42,6 +46,7 @@ public class ServiceMacroHolder { this.vnfResources = new ArrayList<VnfResource>(); this.networkResourceCustomizations = new ArrayList<NetworkResourceCustomization>(); this.allottedResourceCustomizations = new ArrayList<AllottedResourceCustomization>(); + this.vnfResourceCustomizations = new ArrayList<VnfResourceCustomization>(); } public ServiceMacroHolder(Service service) { this(); @@ -72,6 +77,23 @@ public class ServiceMacroHolder { } } + public void setVnfResourceCustomizations(ArrayList<VnfResourceCustomization> vnfResourceCustomizations) { + this.vnfResourceCustomizations = vnfResourceCustomizations; + } + public ArrayList<VnfResourceCustomization> getVnfResourceCustomizations() { + return this.vnfResourceCustomizations; + } + public void addVnfResourceCustomizations(VnfResourceCustomization vrc) { + if (vrc != null) { + if (this.vnfResourceCustomizations != null) { + this.vnfResourceCustomizations.add(vrc); + } else { + this.vnfResourceCustomizations = new ArrayList<VnfResourceCustomization>(); + this.vnfResourceCustomizations.add(vrc); + } + } + } + public void setNetworkResourceCustomization(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) { this.networkResourceCustomizations = networkResourceCustomizations; } @@ -110,6 +132,15 @@ public class ServiceMacroHolder { } else { sb.append("service: null"); } + if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) { + int i=0; + sb.append("VnfResources: "); + for (VnfResourceCustomization vrc : this.vnfResourceCustomizations) { + sb.append(", vnfResourceCustomization[" + i++ + "]:" + vrc.toString()); + } + } else { + sb.append("none"); + } if (this.vnfResources != null && this.vnfResources.size() > 0) { int i=0; sb.append("VnfResources: "); diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java index cc203ff98d..763c304a0f 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java @@ -20,48 +20,47 @@ package org.openecomp.mso.db.catalog.beans; - - - +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; -import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; import java.util.Date; + import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; import org.openecomp.mso.logger.MsoLogger; -public class ServiceRecipe extends MavenLikeVersioning { +public class ServiceRecipe extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + private int id; - private int serviceId; + private String serviceModelUUID; private String action; private String description; private String orchestrationUri; private String serviceParamXSD; private int recipeTimeout; private Integer serviceTimeoutInterim; - private Timestamp created; - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); - + // This 'default' CTR is now needed for backward compatibility since a new CTR was added below public ServiceRecipe() { super(); } - + // This CTR is needed by the HQL SELECT JOIN between the SERVICE and SERVICE_RECIPE tables // in CatalogDatabase::getServiceRecipe() - public ServiceRecipe(int id, int serviceId, String action, - String description, String orchestrationUri, - String serviceParamXSD, int recipeTimeout, - int serviceTimeoutInterim, Date created) { + public ServiceRecipe(int id, String serviceModelUUID, String action, + String description, String orchestrationUri, + String serviceParamXSD, int recipeTimeout, + int serviceTimeoutInterim, Date created) { super(); - LOGGER.debug("ServiceRecipe id=" + id + ", serviceId=" + serviceId + ", action=" + action + ", description=" + description + + LOGGER.debug("ServiceRecipe id=" + id + ", serviceModelUUID=" + serviceModelUUID + ", action=" + action + ", description=" + description + ", orchestrationUri=" + orchestrationUri + ", serviceParamXSD=" + serviceParamXSD + ", recipeTimeout=" + recipeTimeout + ", serviceTimeoutInterim=" + serviceTimeoutInterim + ", created=" + created); this.id = id; - this.serviceId = serviceId; + this.serviceModelUUID = serviceModelUUID; this.action = action; this.description = description; this.orchestrationUri = orchestrationUri; @@ -79,11 +78,11 @@ public class ServiceRecipe extends MavenLikeVersioning { this.id = id; } - public int getServiceId() { - return serviceId; + public String getServiceModelUUID() { + return serviceModelUUID; } - public void setServiceId(int serviceId) { - this.serviceId = serviceId; + public void setServiceModelUUID(String serviceModelUUID) { + this.serviceModelUUID = serviceModelUUID; } public String getAction() { @@ -128,7 +127,7 @@ public class ServiceRecipe extends MavenLikeVersioning { public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { this.serviceTimeoutInterim = serviceTimeoutInterim; } - + public Timestamp getCreated() { return created; } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java index 1fc93be6f5..1fb1f31b06 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToAllottedResources.java @@ -54,6 +54,31 @@ public class ServiceToAllottedResources implements Serializable { } @Override + public boolean equals(Object o) { + if (!(o instanceof ServiceToAllottedResources)) { + return false; + } + if (this == o) { + return true; + } + ServiceToAllottedResources star = (ServiceToAllottedResources) o; + if (star.getArModelCustomizationUuid().equals(this.getArModelCustomizationUuid()) + && star.getServiceModelUuid().equals(this.getServiceModelUuid())) { + return true; + } + return false; + } + + @Override + public int hashCode() { + + int code = this.arModelCustomizationUuid == null ? 0 : this.arModelCustomizationUuid.hashCode(); + code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode(); + + return code; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("serviceModelUuid="); diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java index 5ea171e93b..e1b2c7c5e0 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToNetworks.java @@ -57,6 +57,31 @@ public class ServiceToNetworks implements Serializable { } @Override + public boolean equals(Object o) { + if (!(o instanceof ServiceToNetworks)) { + return false; + } + if (this == o) { + return true; + } + ServiceToNetworks stn = (ServiceToNetworks) o; + if (stn.getNetworkModelCustomizationUuid().equals(this.getNetworkModelCustomizationUuid()) + && stn.getServiceModelUuid().equals(this.getServiceModelUuid())) { + return true; + } + return false; + } + + @Override + public int hashCode() { + + int code = this.networkModelCustomizationUuid == null ? 0 : this.networkModelCustomizationUuid.hashCode(); + code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode(); + + return code; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ServiceToNetworks mapping: "); diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java new file mode 100644 index 0000000000..bb3dfd5c43 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceToResourceCustomization.java @@ -0,0 +1,110 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+
+public class ServiceToResourceCustomization implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305392L;
+
+ private String modelType;
+ private String serviceModelUUID;
+ private Timestamp created;
+ private String resourceModelCustomizationUUID;
+
+ public ServiceToResourceCustomization() {}
+
+ public String getServiceModelUUID() {
+ return serviceModelUUID;
+ }
+
+ public void setServiceModelUUID(String serviceModelUUID) {
+ this.serviceModelUUID = serviceModelUUID;
+ }
+
+ public String getModelType() {
+ return modelType;
+ }
+
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ public Timestamp getCreated() {
+ return created;
+ }
+
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ public String getResourceModelCustomizationUUID() {
+ return resourceModelCustomizationUUID;
+ }
+
+ public void setResourceModelCustomizationUUID(String resourceModelCustomizationUUID) {
+ this.resourceModelCustomizationUUID = resourceModelCustomizationUUID;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof ServiceToResourceCustomization)) {
+ return false;
+ }
+ if (this == o) {
+ return true;
+ }
+ ServiceToResourceCustomization strc = (ServiceToResourceCustomization) o;
+ if (strc.getServiceModelUUID().equals(this.getServiceModelUUID())
+ && strc.getResourceModelCustomizationUUID().equals(this.getResourceModelCustomizationUUID())
+ && strc.getModelType().equals(this.getModelType())) {
+ return true;
+ }
+ return false;
+
+ }
+
+ @Override
+ public int hashCode() {
+
+ int code = this.modelType == null ? 0 : this.modelType.hashCode();
+ code += this.serviceModelUUID == null ? 0 : this.serviceModelUUID.hashCode();
+ code += this.resourceModelCustomizationUUID == null ? 0 : this.resourceModelCustomizationUUID.hashCode();
+
+ return code;
+
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("ServiceToResourceCustomization: modelType=" + modelType + ",serviceModelUUID=" + serviceModelUUID+",resourceModelCustomizationUUID="+resourceModelCustomizationUUID);
+ if (created != null) {
+ sb.append (",created=");
+ sb.append (DateFormat.getInstance().format(created));
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java new file mode 100644 index 0000000000..1b534a2979 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/TempNetworkHeatTemplateLookup.java @@ -0,0 +1,99 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+
+public class TempNetworkHeatTemplateLookup implements Serializable {
+
+ private String networkResourceModelName;
+ private String heatTemplateArtifactUuid;
+ private String aicVersionMin;
+ private String aicVersionMax;
+ public static final long serialVersionUID = -1322322139926390329L;
+
+ public TempNetworkHeatTemplateLookup() {
+ super();
+ }
+
+ public String getNetworkResourceModelName() {
+ return this.networkResourceModelName;
+ }
+ public void setNetworkResourceModelName(String networkResourceModelName) {
+ this.networkResourceModelName = networkResourceModelName;
+ }
+
+ public String getHeatTemplateArtifactUuid() {
+ return this.heatTemplateArtifactUuid;
+ }
+ public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
+ this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
+ }
+ public String getAicVersionMin() {
+ return this.aicVersionMin;
+ }
+
+ public void setAicVersionMin(String aicVersionMin) {
+ this.aicVersionMin = aicVersionMin;
+ }
+
+ public String getAicVersionMax() {
+ return this.aicVersionMax;
+ }
+
+ public void setAicVersionMax(String aicVersionMax) {
+ this.aicVersionMax = aicVersionMax;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("NetworkResourceModelName=" + this.networkResourceModelName);
+ sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid);
+ sb.append("aicVersionMin=" + this.aicVersionMin);
+ sb.append("aicVersionMax=" + this.aicVersionMax);
+ return sb.toString();
+ }
+ @Override
+ public boolean equals (Object o) {
+ if (!(o instanceof TempNetworkHeatTemplateLookup)) {
+ return false;
+ }
+ if (this == o) {
+ return true;
+ }
+ TempNetworkHeatTemplateLookup tnhtl = (TempNetworkHeatTemplateLookup) o;
+ if (tnhtl.getHeatTemplateArtifactUuid().equals(this.getHeatTemplateArtifactUuid()) && tnhtl.getNetworkResourceModelName().equals(this.getNetworkResourceModelName())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode () {
+ // hash code does not have to be a unique result - only that two objects that should be treated as equal
+ // return the same value. so this should work.
+ int result = 0;
+ result = (this.networkResourceModelName != null ? this.networkResourceModelName.hashCode() : 0) + (this.heatTemplateArtifactUuid != null ? this.heatTemplateArtifactUuid.hashCode() : 0);
+ return result;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java new file mode 100644 index 0000000000..277025ba81 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ToscaCsar.java @@ -0,0 +1,113 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.util.Set;
+
+import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
+
+public class ToscaCsar extends MavenLikeVersioning implements Serializable {
+
+ private static final long serialVersionUID = 768026109321305392L;
+
+ private String artifactUUID;
+ private String name;
+ private String artifactChecksum;
+ private String url;
+ private String description;
+ private Timestamp created;
+ private Set<Service> services;
+
+ public ToscaCsar() { }
+
+ public String getArtifactUUID() {
+ return artifactUUID;
+ }
+
+ public void setArtifactUUID(String artifactUUID) {
+ this.artifactUUID = artifactUUID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Timestamp getCreated() {
+ return created;
+ }
+
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+
+ public Set<Service> getServices() {
+ return services;
+ }
+
+ public void setServices(Set<Service> services) {
+ this.services = services;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("TOSCACSAR: artifactUUID=" + artifactUUID + ",name=" + name + ",version=" + version + ",description=" + description+",artifactChecksum="+artifactChecksum+",url="+url);
+ for (Service service : services) {
+ sb.append ("\n" + service.toString());
+ }
+ if (created != null) {
+ sb.append (",created=");
+ sb.append (DateFormat.getInstance().format(created));
+ }
+ return sb.toString();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java index 2b13a45531..40e2dac48b 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java @@ -22,73 +22,55 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class VfModule extends MavenLikeVersioning { +public class VfModule extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; - private int id; - private Integer vnfResourceId; - private String type; + private String modelInvariantUUID; private String modelName; - private int isBase; - private Integer templateId; - private Integer environmentId; - private Integer volTemplateId; - private Integer volEnvironmentId; + private String modelVersion; private String description; - private String asdcUuid; + private int isBase; + private String heatTemplateArtifactUUId; + private String volHeatTemplateArtifactUUId; private Timestamp created; - private String modelInvariantUuid; - private String modelVersion; - private String modelCustomizationUuid = null; - private Integer minInstances; - private Integer maxInstances; - private Integer initialCount; - private String label; - private String modelUuid; + private String modelUUID; + private String vnfResourceModelUUId; public VfModule() { super(); } - public int getId(){ - return this.id; - } - public void setId(int id) { - this.id = id; + public String getVnfResourceModelUUId() { + return this.vnfResourceModelUUId; } - public Integer getVnfResourceId() { - return this.vnfResourceId; - } - public void setVnfResourceId(Integer vnfResourceId) { - this.vnfResourceId = vnfResourceId; + public void setVnfResourceModelUUId(String vnfResourceModelUUId) { + this.vnfResourceModelUUId = vnfResourceModelUUId; } public String getModelName() { return this.modelName; } + public void setModelName(String modelName) { this.modelName = modelName; } - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - public int getIsBase() { return this.isBase; } + public void setIsBase(int isBase) { this.isBase = isBase; } + public boolean isBase() { if (this.isBase == 0) { return false; @@ -97,49 +79,22 @@ public class VfModule extends MavenLikeVersioning { } } - public Integer getTemplateId() { - return this.templateId; - } - public void setTemplateId(Integer templateId) { - this.templateId = templateId; + public String getHeatTemplateArtifactUUId() { + return this.heatTemplateArtifactUUId; } - public Integer getEnvironmentId() { - return this.environmentId; - } - public void setEnvironmentId(Integer environmentId) { - this.environmentId = environmentId; - } - - public Integer getVolTemplateId() { - return this.volTemplateId; - } - public void setVolTemplateId(Integer volTemplateId) { - this.volTemplateId = volTemplateId; - } - - public Integer getVolEnvironmentId() { - return this.volEnvironmentId; - } - public void setVolEnvironmentId(Integer volEnvironmentId) { - this.volEnvironmentId = volEnvironmentId; + public void setHeatTemplateArtifactUUId(String heatTemplateArtifactUUId) { + this.heatTemplateArtifactUUId = heatTemplateArtifactUUId; } public String getDescription() { return this.description; } + public void setDescription(String description) { this.description = description; } - public String getAsdcUuid() { - return asdcUuid; - } - - public void setAsdcUuid(String asdcUuidp) { - this.asdcUuid = asdcUuidp; - } - public Timestamp getCreated() { return created; } @@ -147,111 +102,73 @@ public class VfModule extends MavenLikeVersioning { public void setCreated(Timestamp created) { this.created = created; } + public String getModelInvariantUuid() { - return this.modelInvariantUuid; + return this.modelInvariantUUID; } public void setModelInvariantUuid(String modelInvariantUuid) { - this.modelInvariantUuid = modelInvariantUuid; - } - - - public String getModelVersion() { - return this.modelVersion; - } - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - public Integer getMinInstances() { - return this.minInstances; - } - public void setMinInstances(Integer minInstances) { - this.minInstances = minInstances; - } - public Integer getMaxInstances() { - return this.maxInstances; + this.modelInvariantUUID = modelInvariantUuid; } - public void setMaxInstances(Integer maxInstances) { - this.maxInstances = maxInstances; + public String getModelInvariantUUID() { + return this.modelInvariantUUID; } - public Integer getInitialCount() { - return this.initialCount; + public void setModelInvariantUUID(String modelInvariantUuid) { + this.modelInvariantUUID = modelInvariantUuid; } - public void setInitialCount(Integer initialCount) { - this.initialCount = initialCount; + + public String getVolHeatTemplateArtifactUUId() { + return this.volHeatTemplateArtifactUUId; } - public String getLabel() { - return this.label; - } - public void setLabel(String label) { - this.label = label; + + public void setVolHeatTemplateArtifactUUId(String volHeatTemplateArtifactUUId) { + this.volHeatTemplateArtifactUUId = volHeatTemplateArtifactUUId; } - // Will be fixed pending finalizing of 1707 catalog db schema changes - public void setModelUuid(String modelUuid) { - this.modelUuid = modelUuid; - } - public String getModelUuid() { - return this.modelUuid; + public String getModelUUID() { + return modelUUID; } - public String getModelInvariantId() { - return this.modelInvariantUuid; + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; } - public String getVfModuleType() { - return this.type; + + public String getModelVersion() { + return modelVersion; } - public String getVfModuleLabel() { - return this.label; + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; } @Override public String toString () { StringBuffer buf = new StringBuffer(); - buf.append("VF="); - buf.append(this.type); - buf.append(",modelName="); + buf.append("VFModule:"); + buf.append("modelName="); buf.append(modelName); - buf.append(",version="); - buf.append(version); - buf.append(",id="); - buf.append(this.id); - buf.append(",vnfResourceId="); - buf.append(this.vnfResourceId); - buf.append(",templateId="); - buf.append(this.templateId); - buf.append(",envtId="); - buf.append(this.environmentId); - buf.append(",volTemplateId="); - buf.append(this.volTemplateId); - buf.append(",volEnvtId="); - buf.append(this.volEnvironmentId); + buf.append(",modelVersion="); + buf.append(modelVersion); + buf.append(",vnfResourceModelUUId="); + buf.append(this.vnfResourceModelUUId); + buf.append(",heatTemplateArtifactUUId="); + buf.append(this.heatTemplateArtifactUUId); buf.append(", description="); buf.append(this.description); - buf.append(",asdcUuid="); - buf.append(asdcUuid); - buf.append(",modelVersion="); - buf.append(this.modelVersion); - buf.append(",modelCustomizationUuid="); - buf.append(this.modelCustomizationUuid); - buf.append(",minInstances="); - buf.append(this.minInstances); - buf.append(",maxInstances="); - buf.append(this.maxInstances); - buf.append(",initialCount="); - buf.append(this.initialCount); - buf.append(",label="); - buf.append(this.label); + buf.append(",volHeatTemplateArtifactUUId="); + buf.append(this.volHeatTemplateArtifactUUId); + buf.append(",isBase="); + buf.append(this.isBase); + buf.append(",modelInvariantUUID="); + buf.append(this.modelInvariantUUID); + buf.append(",modelUUID="); + buf.append(this.modelUUID); if (this.created != null) { buf.append (",created="); buf.append (DateFormat.getInstance().format(this.created)); } + return buf.toString(); } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java new file mode 100644 index 0000000000..ed8980294a --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleCustomization.java @@ -0,0 +1,151 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class VfModuleCustomization implements Serializable {
+
+ private String modelCustomizationUuid;
+ private String vfModuleModelUuid;
+ private String label;
+ private Integer minInstances;
+ private Integer maxInstances;
+ private Integer initialCount;
+ private Integer availabilityZoneCount;
+ private String heatEnvironmentArtifactUuid;
+ private String volEnvironmentArtifactUuid;
+ private Timestamp created;
+ private VfModule vfModule;
+ public static final long serialVersionUID = -1322322139926390329L;
+
+ public VfModuleCustomization() {
+ super();
+ }
+
+ public String getModelCustomizationUuid() {
+ return this.modelCustomizationUuid;
+ }
+ public void setModelCustomizationUuid(String modelCustomizationUuid) {
+ this.modelCustomizationUuid = modelCustomizationUuid;
+ }
+ public String getVfModuleModelUuid() {
+ return this.vfModuleModelUuid;
+ }
+ public void setVfModuleModelUuid(String vfModuleModelUuid) {
+ this.vfModuleModelUuid = vfModuleModelUuid;
+ }
+ public String getHeatEnvironmentArtifactUuid() {
+ return this.heatEnvironmentArtifactUuid;
+ }
+ public void setHeatEnvironmentArtifactUuid(String heatEnvironmentArtifactUuid) {
+ this.heatEnvironmentArtifactUuid = heatEnvironmentArtifactUuid;
+ }
+ public String getVolEnvironmentArtifactUuid() {
+ return this.volEnvironmentArtifactUuid;
+ }
+ public void setVolEnvironmentArtifactUuid(String volEnvironmentArtifactUuid) {
+ this.volEnvironmentArtifactUuid = volEnvironmentArtifactUuid;
+ }
+
+ public Integer getMinInstances() {
+ return this.minInstances;
+ }
+ public void setMinInstances(Integer minInstances) {
+ this.minInstances = minInstances;
+ }
+ public Integer getMaxInstances() {
+ return this.maxInstances;
+ }
+ public void setMaxInstances(Integer maxInstances) {
+ this.maxInstances = maxInstances;
+ }
+ public Integer getInitialCount() {
+ return this.initialCount;
+ }
+ public void setInitialCount(Integer initialCount) {
+ this.initialCount = initialCount;
+ }
+ public Integer getAvailabilityZoneCount() {
+ return this.availabilityZoneCount;
+ }
+ public void setAvailabilityZoneCount(Integer availabilityZoneCount) {
+ this.availabilityZoneCount = availabilityZoneCount;
+ }
+ public Timestamp getCreated() {
+ return created;
+ }
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+ public String getLabel() {
+ return this.label;
+ }
+ public void setLabel(String label) {
+ this.label = label;
+ }
+ public VfModule getVfModule() {
+ return this.vfModule;
+ }
+ public void setVfModule(VfModule vfModule) {
+ this.vfModule = vfModule;
+ }
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("modelCustomizationUuid=" + this.modelCustomizationUuid);
+ sb.append("vfModuleModelUuid=" + this.vfModuleModelUuid);
+ sb.append("label=" + this.label);
+ sb.append("initalCount=" + this.initialCount);
+ sb.append("minInstances=" + this.minInstances);
+ sb.append("maxInstances=" + this.maxInstances);
+ sb.append("availabilityZoneCount=" + this.availabilityZoneCount);
+ sb.append("heatEnvironmentArtifactUuid=" + this.heatEnvironmentArtifactUuid);
+ sb.append("volEnvironmentArtifactUuid=" + this.volEnvironmentArtifactUuid);
+ sb.append("created=" + this.created);
+ return sb.toString();
+ }
+ @Override
+ public boolean equals (Object o) {
+ if (!(o instanceof VfModuleCustomization)) {
+ return false;
+ }
+ if (this == o) {
+ return true;
+ }
+ VfModuleCustomization vfmc = (VfModuleCustomization) o;
+ if (vfmc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid()) && vfmc.getVfModuleModelUuid().equals(this.getVfModuleModelUuid())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode () {
+ // hash code does not have to be a unique result - only that two objects that should be treated as equal
+ // return the same value. so this should work.
+ int result = 0;
+ result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.vfModuleModelUuid != null ? this.vfModuleModelUuid.hashCode() : 0);
+ return result;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java index b0b00759f0..fa26d78dc0 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java @@ -26,58 +26,33 @@ import java.io.Serializable; public class VfModuleToHeatFiles implements Serializable { - private int vfModuleId; - private int heatFilesId; + private String vfModuleModelUuid; + private String heatFilesArtifactUuid; public static final long serialVersionUID = -1322322139926390329L; public VfModuleToHeatFiles() { super(); } - public int getVfModuleId() { - return this.vfModuleId; + public String getVfModuleModelUuid() { + return this.vfModuleModelUuid; } - public void setVfModuleId(int vfModuleId) { - this.vfModuleId = vfModuleId; + public void setVfModuleModelUuid(String vfModuleModelUuid) { + this.vfModuleModelUuid = vfModuleModelUuid; } - - public int getHeatFilesId() { - return this.heatFilesId; + public String getHeatFilesArtifactUuid() { + return this.heatFilesArtifactUuid; } - public void setHeatFilesId(int heatFilesId) { - this.heatFilesId = heatFilesId; + public void setHeatFilesArtifactUuid(String heatFilesArtifactUuid) { + this.heatFilesArtifactUuid = heatFilesArtifactUuid; } @Override public String toString () { StringBuilder sb = new StringBuilder (); - sb.append ("VF_MODULE_ID=" + this.vfModuleId); - sb.append (", HEAT_FILES_ID=" + this.heatFilesId); + sb.append ("vfModuleModelUuid=" + this.vfModuleModelUuid); + sb.append (", heatFilesArtifactUuid=" + this.heatFilesArtifactUuid); return sb.toString (); } - @Override - public boolean equals (Object o) { - if (!(o instanceof VfModuleToHeatFiles)) { - return false; - } - if (this == o) { - return true; - } - VfModuleToHeatFiles vmthf = (VfModuleToHeatFiles) o; - if (vmthf.getVfModuleId() == this.getVfModuleId() && vmthf.getVfModuleId() == this.getVfModuleId()) { - return true; - } - return false; - } - - @Override - public int hashCode () { - // hash code does not have to be a unique result - only that two objects that should be treated as equal - // return the same value. so this should work. - int result = 0; - result = this.vfModuleId + this.heatFilesId; - return result; - } - } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java index 547b2fc70a..92e63ae84b 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java @@ -20,13 +20,16 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; -public class VnfComponentsRecipe extends Recipe { +public class VnfComponentsRecipe extends Recipe implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private String vnfType; private String vnfComponentParamXSD; private String vnfComponentType; - private String vfModuleId; + private String vfModuleModelUUId; public VnfComponentsRecipe() {} @@ -51,12 +54,12 @@ public class VnfComponentsRecipe extends Recipe { this.vnfComponentType = vnfComponentType; } - public String getVfModuleId() { - return vfModuleId; + public String getVfModuleModelUUId() { + return vfModuleModelUUId; } - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; + public void setVfModuleModelUUId(String vfModuleModelUUId) { + this.vfModuleModelUUId = vfModuleModelUUId; } @Override @@ -66,7 +69,7 @@ public class VnfComponentsRecipe extends Recipe { sb.append (",vnfComponentParamXSD=" + vnfComponentParamXSD); sb.append (",serviceType=" + getServiceType ()); sb.append (",vnfComponentType=" + getVnfComponentType ()); - sb.append (",vfModuleId=" + getVfModuleId ()); + sb.append (",vfModuleId=" + getVfModuleModelUUId()); return sb.toString(); } } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java index 1f0cd0ab1d..075b3abbf0 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java @@ -20,8 +20,11 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; -public class VnfRecipe extends Recipe { +public class VnfRecipe extends Recipe implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; private String vnfType; private String vnfParamXSD; diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java new file mode 100644 index 0000000000..0317653ef8 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResCustomToVfModuleCustom.java @@ -0,0 +1,89 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.db.catalog.beans;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+public class VnfResCustomToVfModuleCustom implements Serializable {
+
+ private String vnfResourceCustModelCustomizationUuid;
+ private String vfModuleCustModelCustomizationUuid;
+ private Timestamp created;
+
+ public static final long serialVersionUID = -1322322139926390329L;
+
+
+ public VnfResCustomToVfModuleCustom() {
+ super();
+ }
+ public String getVnfResourceCustModelCustomizationUuid() {
+ return this.vnfResourceCustModelCustomizationUuid;
+ }
+ public void setVnfResourceCustModelCustomizationUuid(String vnfResourceCustModelCustomizationUuid) {
+ this.vnfResourceCustModelCustomizationUuid = vnfResourceCustModelCustomizationUuid;
+ }
+ public String getVfModuleCustModelCustomizationUuid() {
+ return this.vfModuleCustModelCustomizationUuid;
+ }
+ public void setVfModuleCustModelCustomizationUuid(String vfModuleCustModelCustomizationUuid) {
+ this.vfModuleCustModelCustomizationUuid = vfModuleCustModelCustomizationUuid;
+ }
+ public Timestamp getCreated() {
+ return created;
+ }
+ public void setCreated(Timestamp created) {
+ this.created = created;
+ }
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("vnfResourceCustModelCustomizationUuid=" + this.vnfResourceCustModelCustomizationUuid);
+ sb.append("vfModuleCustModelCustomizationUuid=" + this.vfModuleCustModelCustomizationUuid);
+ sb.append("created=" + this.created);
+ return sb.toString();
+ }
+ @Override
+ public boolean equals (Object o) {
+ if (!(o instanceof VnfResCustomToVfModuleCustom)) {
+ return false;
+ }
+ if (this == o) {
+ return true;
+ }
+ VnfResCustomToVfModuleCustom vrctvmc = (VnfResCustomToVfModuleCustom) o;
+ if (vrctvmc.getVnfResourceCustModelCustomizationUuid().equals(this.getVnfResourceCustModelCustomizationUuid()) && vrctvmc.getVfModuleCustModelCustomizationUuid().equals(this.getVfModuleCustModelCustomizationUuid())) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode () {
+ // hash code does not have to be a unique result - only that two objects that should be treated as equal
+ // return the same value. so this should work.
+ int result = 0;
+ result = (this.vnfResourceCustModelCustomizationUuid != null ? this.vnfResourceCustModelCustomizationUuid.hashCode() : 0) + (this.vfModuleCustModelCustomizationUuid != null ? this.vfModuleCustModelCustomizationUuid.hashCode() : 0);
+ return result;
+ }
+
+
+}
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java index fa54d00ed6..6f8ca964f0 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java @@ -21,66 +21,37 @@ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; import java.text.DateFormat; +import java.util.HashSet; +import java.util.Set; +import java.util.List; import java.util.ArrayList; -import java.util.Map; import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; -public class VnfResource extends MavenLikeVersioning { - - private int id; - private String vnfType; - - private String orchestrationMode = null; - private String description = null; - private Integer templateId; - private Integer environmentId = null; - - private Map <String, HeatFiles> heatFiles; - - private String asdcUuid; - +public class VnfResource extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + + private String modelUuid; + private String modelInvariantUuid; + private String modelName; + private String toscaNodeType; + private String description; + private String orchestrationMode; + private String aicVersionMin; + private String aicVersionMax; + private String heatTemplateArtifactUUId; private Timestamp created; + private String modelVersion; + private Set<VnfResourceCustomization> vnfResourceCustomizations; + private Set<VfModule> vfModules; + private List<VfModule> vfModuleList; + private List<VfModuleCustomization> vfModuleCustomizations; - private String aicVersionMin = null; - private String aicVersionMax = null; - - private String modelInvariantUuid = null; - private String modelVersion = null; - - private String modelCustomizationName = null; - - private String modelName = null; - private String serviceModelInvariantUUID = null; - private String modelCustomizationUuid = null; - - private String modelUuid = null; - private String modelInstanceName = null; - - private ArrayList<VfModule> vfModules; - - public VnfResource () { - super(); - this.vfModules = new ArrayList<VfModule>(); - } - - public int getId () { - return id; - } - - public void setId (int id) { - this.id = id; - } - - public String getVnfType () { - return vnfType; - } - - public void setVnfType (String vnfType) { - this.vnfType = vnfType; - } + public VnfResource () { } public String getOrchestrationMode () { return orchestrationMode; @@ -98,36 +69,19 @@ public class VnfResource extends MavenLikeVersioning { this.description = description; } - public Integer getTemplateId () { - return templateId; - } - - public void setTemplateId (Integer templateId) { - this.templateId = templateId; - } - - public Integer getEnvironmentId () { - return this.environmentId; - } - - public void setEnvironmentId (Integer environmentId) { - this.environmentId = environmentId; + public String getTemplateId () { + return heatTemplateArtifactUUId; } - public Map <String, HeatFiles> getHeatFiles () { - return this.heatFiles; + public void setTemplateId (String heatTemplateArtifactUUId) { + this.heatTemplateArtifactUUId = heatTemplateArtifactUUId; } - - public void setHeatFiles (Map <String, HeatFiles> heatFiles) { - this.heatFiles = heatFiles; + public String getHeatTemplateArtifactUUId () { + return heatTemplateArtifactUUId; } - public String getAsdcUuid() { - return asdcUuid; - } - - public void setAsdcUuid(String asdcUuidp) { - this.asdcUuid = asdcUuidp; + public void setHeatTemplateArtifactUUId (String heatTemplateArtifactUUId) { + this.heatTemplateArtifactUUId = heatTemplateArtifactUUId; } public Timestamp getCreated() { @@ -162,76 +116,94 @@ public class VnfResource extends MavenLikeVersioning { this.modelInvariantUuid = modelInvariantUuid; } - public String getModelVersion() { - return this.modelVersion; - } - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; + public String getModelName() { + return modelName; } - public String getModelCustomizationName() { - return modelCustomizationName; + public void setModelName(String modelName) { + this.modelName = modelName; } - public void setModelCustomizationName(String modelCustomizationName) { - this.modelCustomizationName = modelCustomizationName; + public String getModelUuid() { + return modelUuid; } - public String getModelName() { - return modelName; + public void setModelUuid(String modelUuid) { + this.modelUuid = modelUuid; } - public void setModelName(String modelName) { - this.modelName = modelName; + public String getModelInvariantId() { + return this.modelInvariantUuid; } - public String getServiceModelInvariantUUID() { - return serviceModelInvariantUUID; + public String getToscaNodeType() { + return toscaNodeType; } - public void setServiceModelInvariantUUID(String serviceModelInvariantUUID) { - this.serviceModelInvariantUUID = serviceModelInvariantUUID; + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; + public Set<VnfResourceCustomization> getVnfResourceCustomizations() { + return vnfResourceCustomizations; } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; + + public void setVnfResourceCustomizations(Set<VnfResourceCustomization> vnfResourceCustomizations) { + this.vnfResourceCustomizations = vnfResourceCustomizations; } - public ArrayList<VfModule> getVfModules() { - return this.vfModules; + public Set<VfModule> getVfModules() { + return vfModules; } - public void setVfModules(ArrayList<VfModule> vfModules) { + + public void setVfModules(Set<VfModule> vfModules) { this.vfModules = vfModules; } + + public List<VfModuleCustomization> getVfModuleCustomizations() { + return this.vfModuleCustomizations == null ? new ArrayList<VfModuleCustomization>() : this.vfModuleCustomizations; + } + public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) { + this.vfModuleCustomizations = vfModuleCustomizations; + } + public void addVfModuleCustomization(VfModuleCustomization vfmc) { + if (vfmc != null) { + if (this.vfModuleCustomizations != null) { + this.vfModuleCustomizations.add(vfmc); + } else { + this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>(); + this.vfModuleCustomizations.add(vfmc); + } + } + } + public void addVfModule(VfModule vfm) { if (vfm != null) { if (this.vfModules != null) { this.vfModules.add(vfm); } else { - this.vfModules = new ArrayList<VfModule>(); + this.vfModules = new HashSet<VfModule>(); this.vfModules.add(vfm); } } } - - //Placeholders for now until new design is finalized: - public void setModelUuid(String modelUuid) { - this.modelUuid = modelUuid; + public ArrayList<VfModule> getVfModuleList() { + if (this.vfModules == null || this.vfModules.size() < 1) { + return null; } - public String getModelUuid() { - return this.modelUuid; + ArrayList<VfModule> list = new ArrayList<VfModule>(); + for (VfModule vfm : this.vfModules) { + list.add(vfm); } - public String getModelInvariantId() { - return this.modelInvariantUuid; + return list; } - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; + + public String getModelVersion() { + return modelVersion; } - public String getModelInstanceName() { - return this.modelInstanceName; + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; } @Override @@ -239,17 +211,14 @@ public class VnfResource extends MavenLikeVersioning { StringBuffer buf = new StringBuffer(); buf.append("VNF="); - buf.append(vnfType); - buf.append(",version="); - buf.append(version); + buf.append(",modelVersion="); + buf.append(modelVersion); buf.append(",mode="); buf.append(orchestrationMode); - buf.append(",template="); - buf.append(templateId); + buf.append(",heatTemplateArtifactUUId="); + buf.append(heatTemplateArtifactUUId); buf.append(",envtId="); - buf.append(environmentId); buf.append(",asdcUuid="); - buf.append(asdcUuid); buf.append(",aicVersionMin="); buf.append(this.aicVersionMin); buf.append(",aicVersionMax="); @@ -257,28 +226,25 @@ public class VnfResource extends MavenLikeVersioning { buf.append(",modelInvariantUuid="); buf.append(this.modelInvariantUuid); buf.append(",modelVersion="); - buf.append(this.modelVersion); buf.append(",modelCustomizationName="); - buf.append(this.modelCustomizationName); buf.append(",modelName="); buf.append(this.modelName); buf.append(",serviceModelInvariantUUID="); - buf.append(this.serviceModelInvariantUUID); buf.append(",modelCustomizationUuid="); - buf.append(this.modelCustomizationUuid); + buf.append(",toscaNodeType="); + buf.append(toscaNodeType); if (created != null) { buf.append(",created="); buf.append(DateFormat.getInstance().format(created)); } - if (this.vfModules != null && this.vfModules.size() > 0) { - buf.append("VfModules:"); - int i=0; - for (VfModule vfm : this.vfModules) { - buf.append("vfModule[" + i++ + "]:" + vfm.toString()); + + for(VnfResourceCustomization vrc : vnfResourceCustomizations) { + buf.append("/n" + vrc.toString()); } - } else { - buf.append("VfModules: NONE"); + + for(VfModule vfm : vfModules) { + buf.append("/n" + vfm.toString()); } return buf.toString(); } diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java index 2bc6b3ead3..9b835d439e 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResourceCustomization.java @@ -19,27 +19,42 @@ */ package org.openecomp.mso.db.catalog.beans; +import java.io.Serializable; import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; -public class VnfResourceCustomization { +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; - private String modelCustomizationUuid; +public class VnfResourceCustomization extends MavenLikeVersioning implements Serializable { + + private static final long serialVersionUID = 768026109321305392L; + + private String modelCustomizationUuid = null; private String modelInstanceName; - private Integer ecompHomed; - private String homingPolicy; - private Timestamp creationTimestamp; - private String vnfResourceModelUuid; + private Timestamp created; + private String vnfResourceModelUuid = null; + private String vnfResourceModelUUID; private Integer minInstances; private Integer maxInstances; private Integer availabilityZoneMaxCount; private VnfResource vnfResource; + private String nfFunction; + private String nfType; + private String nfRole; + private String nfNamingCode; + private List<VfModuleCustomization> vfModuleCustomizations; + private Set<ServiceToResourceCustomization> serviceResourceCustomizations; public VnfResourceCustomization() { } + public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; + return modelCustomizationUuid; } + public void setModelCustomizationUuid(String modelCustomizationUuid) { this.modelCustomizationUuid = modelCustomizationUuid; } @@ -51,33 +66,25 @@ public class VnfResourceCustomization { this.modelInstanceName = modelInstanceName; } - public Integer getEcompHomed() { - return this.ecompHomed; - } - public void setEcompHomed(Integer ecompHomed) { - this.ecompHomed = ecompHomed; - } - - public String getHomingPolicy() { - return this.homingPolicy; - } - public void setHomingPolicy(String homingPolicy) { - this.homingPolicy = homingPolicy; - } - public Timestamp getCreationTimestamp() { - return this.creationTimestamp; + return this.created; } - public void setCreationTimestamp(Timestamp creationTimestamp) { - this.creationTimestamp = creationTimestamp; + public void setCreationTimestamp(Timestamp created) { + this.created = created; } public String getVnfResourceModelUuid() { - return this.vnfResourceModelUuid; + return this.vnfResourceModelUuid == null ? this.vnfResourceModelUUID : this.vnfResourceModelUuid; } public void setVnfResourceModelUuid(String vnfResourceModelUuid) { this.vnfResourceModelUuid = vnfResourceModelUuid; } + public String getVnfResourceModelUUID() { + return this.vnfResourceModelUUID; + } + public void setVnfResourceModelUUID(String vnfResourceModelUUID) { + this.vnfResourceModelUUID = vnfResourceModelUUID; + } public Integer getMinInstances() { return this.minInstances; } @@ -106,22 +113,87 @@ public class VnfResourceCustomization { this.vnfResource = vnfResource; } + public String getNfFunction() { + return nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfType() { + return nfType; + } + + public void setNfType(String nfType) { + this.nfType = nfType; + } + + 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 List<VfModuleCustomization> getVfModuleCustomizations() { + return this.vfModuleCustomizations; + } + public void setVfModuleCustomizations(ArrayList<VfModuleCustomization> vfModuleCustomizations) { + this.vfModuleCustomizations = vfModuleCustomizations; + } + public void addVfModuleCustomization(VfModuleCustomization vfmc) { + if (vfmc != null) { + if (this.vfModuleCustomizations != null) { + this.vfModuleCustomizations.add(vfmc); + } else { + this.vfModuleCustomizations = new ArrayList<VfModuleCustomization>(); + this.vfModuleCustomizations.add(vfmc); + } + } + } + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public Set<ServiceToResourceCustomization> getServiceResourceCustomizations() { + return serviceResourceCustomizations; + } + + public void setServiceResourceCustomizations( + Set<ServiceToResourceCustomization> serviceResourceCustomizations) { + this.serviceResourceCustomizations = serviceResourceCustomizations; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("VnfResourceCustomization: "); - sb.append("ModelCustUuid=" + this.modelCustomizationUuid); + sb.append("ModelCustUuid=" + this.modelCustomizationUuid ); sb.append(", ModelInstanceName=" + this.modelInstanceName); - sb.append(", ecompHomed=" + this.ecompHomed); - sb.append(", homingPolicy=" + this.homingPolicy); - sb.append(", vnfResourceModelUuid=" + this.vnfResourceModelUuid); - sb.append(", creationTimestamp=" + this.creationTimestamp); + sb.append(", vnfResourceModelUuid=" + this.vnfResourceModelUUID); + sb.append(", creationTimestamp=" + this.created); sb.append(", minInstances=" + this.minInstances); sb.append(", maxInstances=" + this.maxInstances); sb.append(", availabilityZoneMaxCount=" + this.availabilityZoneMaxCount); - sb.append(", vnfResource:\n" + this.vnfResource.toString()); +// sb.append(", vnfResource:\n" + this.vnfResource == null ? "null" : this.vnfResource.toString()); + sb.append(", nfFunction=" + this.nfFunction); + sb.append(", nfType=" + this.nfType); + sb.append(", nfRole=" + this.nfRole); + sb.append(", nfNamingCode=" + this.nfNamingCode); + return sb.toString(); } - - } |