diff options
author | 2017-09-08 13:27:46 -0400 | |
---|---|---|
committer | 2017-09-08 13:32:24 -0400 | |
commit | 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 (patch) | |
tree | 68c0c53c9156f5aa3c6b3599ac940770f986633d /mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java | |
parent | fa1a211d28a912892fcd888569df033900eb01ee (diff) |
1710 Rebase - Second Attempt
This commit rebases changes from openecomp-mso/internal-staging-1710 up to and including this codecloud commit:
54483fc6606ddb1591a2e9da61bff8712325f924
Wed Sep 6 18:12:56 2017 -0400
Rebasing was done on a branch on top of this commit in so/master in ONAP:
93fbdfbe46104f8859d4754040f979cb7997c157
Thu Sep 7 16:42:59 2017 +0000
Change-Id: I4ad9abf40da32bf5bdca43e868b8fa2dbcd9dc59
Issue-id: SO-107
Signed-off-by: Arthur Martella <amartell@research.att.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java | 70 |
1 files changed, 11 insertions, 59 deletions
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) { |