2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.db.catalog.beans;
23 import java.io.Serializable;
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
26 import java.util.HashSet;
29 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
31 public class ToscaCsar extends MavenLikeVersioning implements Serializable {
33 private static final long serialVersionUID = 768026109321305392L;
35 private String artifactUUID = null;
36 private String name = null;
37 private String artifactChecksum = null;
38 private String url = null;
39 private String description = null;
40 private Timestamp created = null;
41 private Set<Service> services = new HashSet<>();
43 public ToscaCsar() { }
45 public String getArtifactUUID() {
49 public void setArtifactUUID(String artifactUUID) {
50 this.artifactUUID = artifactUUID;
53 public String getName() {
57 public void setName(String name) {
61 public String getArtifactChecksum() {
62 return artifactChecksum;
65 public void setArtifactChecksum(String artifactChecksum) {
66 this.artifactChecksum = artifactChecksum;
69 public String getUrl() {
73 public void setUrl(String url) {
77 public String getDescription() {
81 public void setDescription(String description) {
82 this.description = description;
85 public Timestamp getCreated() {
89 public void setCreated(Timestamp created) {
90 this.created = created;
93 public Set<Service> getServices() {
97 public void setServices(Set<Service> services) {
98 this.services = services;
102 public String toString() {
103 StringBuilder sb = new StringBuilder();
104 sb.append("TOSCACSAR: artifactUUID=").append(artifactUUID).append(",name=").append(name).append(",version=")
105 .append(version).append(",description=").append(description).append(",artifactChecksum=")
106 .append(artifactChecksum).append(",url=").append(url);
107 for (Service service : services) {
108 sb.append("\n").append(service.toString());
110 if (created != null) {
111 sb.append (",created=");
112 sb.append (DateFormat.getInstance().format(created));
114 return sb.toString();