diff options
author | 2017-01-31 11:40:03 +0100 | |
---|---|---|
committer | 2017-01-31 12:59:33 +0100 | |
commit | 025301d08b061482c1f046d562bf017c8cbcfe8d (patch) | |
tree | 68a2a549736c9bf0f7cd4e71c76e40ef7e2606f2 /mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans | |
parent | 2754ad52f833278a5c925bd788a16d1dce16a598 (diff) |
Initial OpenECOMP MSO commit
Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans')
16 files changed, 1971 insertions, 0 deletions
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 new file mode 100644 index 0000000000..69db27e989 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatEnvironment.java @@ -0,0 +1,141 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; + +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +public class HeatEnvironment extends MavenLikeVersioning { + private int id; + private String name = null; + private String description = null; + private String environment = null; + + private String asdcUuid; + private String asdcResourceName; + private String asdcLabel; + + private Timestamp created; + + public HeatEnvironment() {} + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + + + /** + * @return the name + */ + public String getName () { + return name; + } + + + /** + * @param name the name to set + */ + public void setName (String name) { + this.name = name; + } + + public String getDescription() { + return this.description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getEnvironment() { + return this.environment; + } + public void setEnvironment(String environment) { + this.environment = environment; + } + + public String 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; + } + + + /** + * @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; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append ("ID=" + this.id); + 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)); + } + 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 new file mode 100644 index 0000000000..a1b6f228e1 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatFiles.java @@ -0,0 +1,137 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; + +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +public class HeatFiles extends MavenLikeVersioning { + private int id; + 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; + + public HeatFiles() {} + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + + public String getDescription() { + return this.description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getFileName() { + return this.fileName; + } + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileBody() { + return this.fileBody; + } + public void setFileBody(String fileBody) { + this.fileBody = fileBody; + } + + public int getVnfResourceId() { + return this.vnfResourceId; + } + public void setVnfResourceId(int vnfResourceId) { + this.vnfResourceId = vnfResourceId; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public String getAsdcUuid() { + return this.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 getAsdcResourceName() { + return asdcResourceName; + } + + public void setAsdcResourceName(String asdcResourceName) { + this.asdcResourceName = asdcResourceName; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append ("ID=" + this.id); + if (this.description == null) { + sb.append(", description=null"); + } else { + sb.append(", description=" + this.description); + } + if (this.fileName == null) { + sb.append(", fileName=null"); + } else { + sb.append(",fileName=" + this.fileName); + } + if (this.fileBody == null) { + sb.append(", fileBody=null"); + } else { + sb.append(",fileBody=" + this.fileBody); + } + if (this.asdcResourceName == null) { + sb.append(", asdcResourceName=null"); + } else { + sb.append(",asdcResourceName=" + this.asdcResourceName); + } + 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 new file mode 100644 index 0000000000..eabbacf547 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java @@ -0,0 +1,97 @@ +/*- + * ============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 HeatNestedTemplate implements Serializable { + + private int parentTemplateId; + private int childTemplateId; + private String providerResourceFile; + public static final long serialVersionUID = -1322322139926390329L; + + public HeatNestedTemplate () { + super (); + } + + public void setParentTemplateId (int parentTemplateId) { + this.parentTemplateId = parentTemplateId; + } + + public int getParentTemplateId () { + return this.parentTemplateId; + } + + public void setChildTemplateId (int childTemplateId) { + this.childTemplateId = childTemplateId; + } + + public int getChildTemplateId () { + return this.childTemplateId; + } + + public void setProviderResourceFile (String providerResourceFile) { + this.providerResourceFile = providerResourceFile; + } + + public String getProviderResourceFile () { + return this.providerResourceFile; + } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder (); + sb.append ("ParentTemplateId=" + this.parentTemplateId); + sb.append (", ChildTemplateId=" + this.childTemplateId); + if (this.providerResourceFile == null) { + sb.append (", providerResourceFile=null"); + } else { + sb.append (",providerResourceFile=" + this.providerResourceFile); + } + return sb.toString (); + } + + @Override + public boolean equals (Object o) { + if (!(o instanceof HeatNestedTemplate)) { + return false; + } + if (this == o) { + return true; + } + HeatNestedTemplate hnt = (HeatNestedTemplate) o; + if (hnt.getChildTemplateId () == this.childTemplateId && hnt.getParentTemplateId () == this.parentTemplateId) { + 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.parentTemplateId + this.childTemplateId; + 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 new file mode 100644 index 0000000000..a80fa598b9 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplate.java @@ -0,0 +1,217 @@ +/*- + * ============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.BufferedReader; +import java.io.FileReader; +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 { + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL); + + private int id; + 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 Timestamp created; + + public enum TemplateStatus { + PARENT, CHILD, PARENT_COMPLETE + } + + public HeatTemplate () { + } + + public int getId () { + return id; + } + + public void setId (int id) { + this.id = id; + } + + public String getTemplateName () { + return templateName; + } + + public void setTemplateName (String templateName) { + this.templateName = templateName; + } + + public String getTemplatePath () { + return templatePath; + } + + public void setTemplatePath (String templatePath) { + this.templatePath = templatePath; + } + + public String getTemplateBody () { + return templateBody; + } + + public void setTemplateBody (String templateBody) { + this.templateBody = templateBody; + } + + public int getTimeoutMinutes () { + return timeoutMinutes; + } + + public void setTimeoutMinutes (int timeout) { + this.timeoutMinutes = timeout; + } + + public Set <HeatTemplateParam> getParameters () { + return parameters; + } + + public void setParameters (Set <HeatTemplateParam> parameters) { + this.parameters = parameters; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getHeatTemplate () { + 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; + } + + public void setFiles (Set <HeatNestedTemplate> files) { + this.files = files; + } + + public Set <HeatNestedTemplate> getFiles () { + return this.files; + } + + public String getAsdcUuid() { + return asdcUuid; + } + + public void setAsdcUuid(String asdcUuidp) { + 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 Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @Override + public String toString () { + String body = (templateBody != null) ? "(" + templateBody.length () + " chars)" : "(Not defined)"; + StringBuilder sb = new StringBuilder (); + sb.append ("Template=") + .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) { + sb.append (",created="); + sb.append (DateFormat.getInstance().format(created)); + } + + + if (parameters != null && !parameters.isEmpty ()) { + sb.append (",params=["); + for (HeatTemplateParam param : parameters) { + sb.append (param.getParamName ()); + if (param.isRequired ()) { + sb.append ("(reqd)"); + } + sb.append (","); + } + sb.replace (sb.length () - 1, sb.length (), "]"); + } + return sb.toString (); + } + + +} 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 new file mode 100644 index 0000000000..0d77a0a4f8 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatTemplateParam.java @@ -0,0 +1,78 @@ +/*- + * ============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; + + +public class HeatTemplateParam { + private int id; + private int heatTemplateId; + private String paramName; + private boolean required; + private String paramType; + private String paramAlias; + + public HeatTemplateParam() {} + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getHeatTemplateId() { + return heatTemplateId; + } + public void setHeatTemplateId(int heatTemplateId) { + this.heatTemplateId = heatTemplateId; + } + public String getParamName() { + return paramName; + } + public void setParamName(String paramName) { + this.paramName = paramName; + } + public boolean isRequired() { + return required; + } + public void setRequired(boolean required) { + this.required = required; + } + public String getParamAlias() { + return paramAlias; + } + public void setParamAlias(String paramAlias) { + this.paramAlias = paramAlias; + } + + public String getParamType() { + return paramType; + } + + public void setParamType (String paramType) { + this.paramType = paramType; + } + + + @Override + public String toString () { + return "Param=" + paramName + ",type=" + paramType + ",required=" + required + ",paramAlias=" + paramAlias; + } +} 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 new file mode 100644 index 0000000000..1cd3526946 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkRecipe.java @@ -0,0 +1,51 @@ +/*- + * ============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; + + +public class NetworkRecipe extends Recipe { + private String networkType; + private String networkParamXSD; + public NetworkRecipe() {} + + public String getNetworkType() { + return networkType; + } + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getNetworkParamXSD() { + return networkParamXSD; + } + public void setNetworkParamXSD(String networkParamXSD) { + this.networkParamXSD = networkParamXSD; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append(super.toString()); + sb.append (",networkType=" + networkType); + 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 new file mode 100644 index 0000000000..be812fa346 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/NetworkResource.java @@ -0,0 +1,139 @@ +/*- + * ============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 org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +import java.sql.Timestamp; +import java.text.DateFormat; + +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 Timestamp created; + + 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; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public int getTemplateId () { + return templateId; + } + + public void setTemplateId (int templateId) { + this.templateId = templateId; + } + + public String getNeutronNetworkType() { + return neutronNetworkType; + } + + public void setNeutronNetworkType(String neutronNetworkType) { + this.neutronNetworkType = neutronNetworkType; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public String getAicVersionMin() { + return aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append("NETWORK="); + sb.append(networkType); + sb.append(",version="); + sb.append(version); + 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); + + 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/Recipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java new file mode 100644 index 0000000000..b0a34e6c60 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Recipe.java @@ -0,0 +1,112 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; + +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +public class Recipe extends MavenLikeVersioning { + + private int id; + protected String action; + private String description; + protected String orchestrationUri; + private int recipeTimeout; + private String serviceType; + + private Timestamp created; + + public Recipe () { + super (); + } + + public int getId () { + return id; + } + + public void setId (int id) { + this.id = id; + } + + public String getAction () { + return action; + } + + public void setAction (String action) { + this.action = action; + } + + public String getDescription () { + return description; + } + + public void setDescription (String description) { + this.description = description; + } + + public String getOrchestrationUri () { + return orchestrationUri; + } + + public void setOrchestrationUri (String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public int getRecipeTimeout () { + return recipeTimeout; + } + + public void setRecipeTimeout (int recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getServiceType () { + return serviceType; + } + + public void setServiceType (String serviceType) { + this.serviceType = serviceType; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("RECIPE: " + action); + sb.append(",uri=" + orchestrationUri); + + 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/Service.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java new file mode 100644 index 0000000000..07fb35596e --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/Service.java @@ -0,0 +1,127 @@ +/*- + * ============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 org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +import java.sql.Timestamp; +import java.text.DateFormat; +import java.util.Map; + +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; + + private String modelInvariantUUID; + private Timestamp created; + + public Service() {} + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + + public String getServiceName() { + return serviceName; + } + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public Map<String, ServiceRecipe> getRecipes() { + return recipes; + } + public void setRecipes(Map<String, ServiceRecipe> recipes) { + this.recipes = recipes; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public String getHttpMethod() { + return httpMethod; + } + + public void setHttpMethod(String httpMethod) { + this.httpMethod = httpMethod; + } + + public String getServiceNameVersionId() { + return serviceNameVersionId; + } + + public void setServiceNameVersionId(String serviceNameVersionId) { + this.serviceNameVersionId = serviceNameVersionId; + } + + public String getServiceVersion() { + return serviceVersion; + } + + public void setServiceVersion(String serviceVersion) { + this.serviceVersion = serviceVersion; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("SERVICE: id=" + id + ",name=" + serviceName + ",version=" + version + ",description=" + description+",modelInvariantUUID="+modelInvariantUUID); + for (String recipeAction : recipes.keySet()) { + ServiceRecipe recipe = recipes.get(recipeAction); + sb.append ("\n" + recipe.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/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java new file mode 100644 index 0000000000..53ec3ba278 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/ServiceRecipe.java @@ -0,0 +1,119 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +public class ServiceRecipe extends MavenLikeVersioning { + private int id; + private int serviceId; + private String action; + private String description; + private String orchestrationUri; + private String serviceParamXSD; + private int recipeTimeout; + private Integer serviceTimeoutInterim; + + private Timestamp created; + + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + + public int getServiceId() { + return serviceId; + } + public void setServiceId(int serviceId) { + this.serviceId = serviceId; + } + + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public String getServiceParamXSD() { + return serviceParamXSD; + } + public void setServiceParamXSD(String serviceParamXSD) { + this.serviceParamXSD = serviceParamXSD; + } + + public int getRecipeTimeout() { + return recipeTimeout; + } + public void setRecipeTimeout(int recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public Integer getServiceTimeoutInterim() { + return serviceTimeoutInterim; + } + + public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { + this.serviceTimeoutInterim = serviceTimeoutInterim; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("RECIPE: " + action); + sb.append(",uri=" + orchestrationUri); + 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 new file mode 100644 index 0000000000..505b3bba9a --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModule.java @@ -0,0 +1,195 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; + +import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning; + +public class VfModule extends MavenLikeVersioning { + + private int id; + private Integer vnfResourceId; + private String type; + private String modelName; + private int isBase; + private Integer templateId; + private Integer environmentId; + private Integer volTemplateId; + private Integer volEnvironmentId; + private String description; + private String asdcUuid; + private Timestamp created; + private String modelInvariantUuid; + private String modelVersion; + + public VfModule() { + super(); + } + + public int getId(){ + return this.id; + } + public void setId(int id) { + this.id = id; + } + + public Integer getVnfResourceId() { + return this.vnfResourceId; + } + public void setVnfResourceId(Integer vnfResourceId) { + this.vnfResourceId = vnfResourceId; + } + + 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; + } else { + return true; + } + } + + public Integer getTemplateId() { + return this.templateId; + } + public void setTemplateId(Integer templateId) { + this.templateId = templateId; + } + + 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 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; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + 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; + } + + @Override + public String toString () { + StringBuffer buf = new StringBuffer(); + + buf.append("VF="); + buf.append(this.type); + 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(", description="); + buf.append(this.description); + buf.append(",asdcUuid="); + buf.append(asdcUuid); + buf.append(",modelVersion="); + buf.append(this.modelVersion); + + 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/VfModuleToHeatFiles.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java new file mode 100644 index 0000000000..b0b00759f0 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VfModuleToHeatFiles.java @@ -0,0 +1,83 @@ +/*- + * ============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 VfModuleToHeatFiles implements Serializable { + + private int vfModuleId; + private int heatFilesId; + public static final long serialVersionUID = -1322322139926390329L; + + public VfModuleToHeatFiles() { + super(); + } + + public int getVfModuleId() { + return this.vfModuleId; + } + public void setVfModuleId(int vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public int getHeatFilesId() { + return this.heatFilesId; + } + public void setHeatFilesId(int heatFilesId) { + this.heatFilesId = heatFilesId; + } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder (); + sb.append ("VF_MODULE_ID=" + this.vfModuleId); + sb.append (", HEAT_FILES_ID=" + this.heatFilesId); + 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/VnfComponent.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponent.java new file mode 100644 index 0000000000..5a05b957f0 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponent.java @@ -0,0 +1,115 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; + +import java.io.Serializable; + +public class VnfComponent implements Serializable { + private int vnfId; + private String componentType = null; + private Integer heatTemplateId; + private Integer heatEnvironmentId; + public static final long serialVersionUID = -1322322139926390329L; + + private Timestamp created; + + public VnfComponent() {} + + public int getVnfId() { + return vnfId; + } + public void setVnfId(int id) { + this.vnfId = id; + } + + public String getComponentType() { + return componentType; + } + public void setComponentType(String ct) { + this.componentType = ct; + } + + public Integer getHeatTemplateId() { + return heatTemplateId; + } + public void setHeatTemplateId(Integer ht) { + this.heatTemplateId = ht; + } + + public Integer getHeatEnvironmentId() { + return heatEnvironmentId; + } + public void setHeatEnvironmentId(Integer he) { + this.heatEnvironmentId = he; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("VnfComponent: "); + sb.append("vnfId=" + vnfId); + sb.append(",componentType=" + componentType); + sb.append(",heatTemplateId=" + heatTemplateId); + sb.append(",heatEnvironmentId=" + heatEnvironmentId); + + if (created != null) { + sb.append (",created="); + sb.append (DateFormat.getInstance().format(created)); + } + return sb.toString(); + } + + @Override + public boolean equals (Object o) { + if (!(o instanceof VnfComponent)) { + return false; + } + if (this == o) { + return true; + } + VnfComponent vnfComponent = (VnfComponent) o; + if (vnfComponent.getVnfId() == this.vnfId && vnfComponent.componentType.equalsIgnoreCase(this.componentType)) { + return true; + } + return false; + } + + @Override + public int hashCode () { + // return the hashCode of the concat string of type+vnfId - should be okay. + int result = 0; + result = (this.componentType + this.vnfId).toString().hashCode(); + 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 new file mode 100644 index 0000000000..547b2fc70a --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfComponentsRecipe.java @@ -0,0 +1,72 @@ +/*- + * ============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; + + +public class VnfComponentsRecipe extends Recipe { + + private String vnfType; + private String vnfComponentParamXSD; + private String vnfComponentType; + private String vfModuleId; + + public VnfComponentsRecipe() {} + + public String getVnfType() { + return vnfType; + } + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfComponentParamXSD() { + return vnfComponentParamXSD; + } + public void setVnfComponentParamXSD(String vnfComponentParamXSD) { + this.vnfComponentParamXSD = vnfComponentParamXSD; + } + + public String getVnfComponentType() { + return vnfComponentType; + } + public void setVnfComponentType(String vnfComponentType) { + this.vnfComponentType = vnfComponentType; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append(super.toString()); + sb.append (",vnfComponentParamXSD=" + vnfComponentParamXSD); + sb.append (",serviceType=" + getServiceType ()); + sb.append (",vnfComponentType=" + getVnfComponentType ()); + sb.append (",vfModuleId=" + getVfModuleId ()); + 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 new file mode 100644 index 0000000000..1f0cd0ab1d --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfRecipe.java @@ -0,0 +1,63 @@ +/*- + * ============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; + + +public class VnfRecipe extends Recipe { + + private String vnfType; + private String vnfParamXSD; + private String vfModuleId; + + public VnfRecipe() {} + + public String getVnfType() { + return vnfType; + } + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfParamXSD() { + return vnfParamXSD; + } + public void setVnfParamXSD(String vnfParamXSD) { + this.vnfParamXSD = vnfParamXSD; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + @Override + public String toString () { + StringBuffer sb = new StringBuffer(); + sb.append(super.toString()); + sb.append (",vnfParamXSD=" + vnfParamXSD); + sb.append (",serviceType=" + getServiceType ()); + sb.append (",vfModuleId=" + getVfModuleId ()); + return sb.toString(); + } +} 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 new file mode 100644 index 0000000000..60c7ef216e --- /dev/null +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/VnfResource.java @@ -0,0 +1,225 @@ +/*- + * ============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.sql.Timestamp; +import java.text.DateFormat; +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; + + private Timestamp created; + + 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; + + public VnfResource () { + } + + 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 String getOrchestrationMode () { + return orchestrationMode; + } + + public void setOrchestrationMode (String orchestrationMode) { + this.orchestrationMode = orchestrationMode; + } + + public String getDescription () { + return description; + } + + public void setDescription (String description) { + 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 Map <String, HeatFiles> getHeatFiles () { + return this.heatFiles; + } + + public void setHeatFiles (Map <String, HeatFiles> heatFiles) { + this.heatFiles = heatFiles; + } + + public String getAsdcUuid() { + return asdcUuid; + } + + public void setAsdcUuid(String asdcUuidp) { + this.asdcUuid = asdcUuidp; + } + + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + 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; + } + + 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 getModelCustomizationName() { + return modelCustomizationName; + } + + public void setModelCustomizationName(String modelCustomizationName) { + this.modelCustomizationName = modelCustomizationName; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getServiceModelInvariantUUID() { + return serviceModelInvariantUUID; + } + + public void setServiceModelInvariantUUID(String serviceModelInvariantUUID) { + this.serviceModelInvariantUUID = serviceModelInvariantUUID; + } + + @Override + public String toString () { + StringBuffer buf = new StringBuffer(); + + buf.append("VNF="); + buf.append(vnfType); + buf.append(",version="); + buf.append(version); + buf.append(",mode="); + buf.append(orchestrationMode); + buf.append(",template="); + buf.append(templateId); + buf.append(",envtId="); + buf.append(environmentId); + buf.append(",asdcUuid="); + buf.append(asdcUuid); + buf.append(",aicVersionMin="); + buf.append(this.aicVersionMin); + buf.append(",aicVersionMax="); + buf.append(this.aicVersionMax); + 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); + + if (created != null) { + buf.append(",created="); + buf.append(DateFormat.getInstance().format(created)); + } + return buf.toString(); + } + +} |