4af501a5874ba47f89ae45e2b663010f8c62cf1d
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / ModelRecipe.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20 package org.openecomp.mso.db.catalog.beans;
21
22
23 import java.io.Serializable;
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
26 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
27
28 public class ModelRecipe extends MavenLikeVersioning implements Serializable {
29         
30         private static final long serialVersionUID = 768026109321305392L;
31         
32         private int id;
33         private Integer modelId;
34         private String action;
35         private String schemaVersion;
36         private String description;
37         private String orchestrationUri;
38         private String modelParamXSD;
39         private Integer recipeTimeout;
40         private Timestamp created;
41
42         /**
43          * @return the id
44          */
45         public int getId() {
46                 return id;
47         }
48
49         /**
50          * @param id the id to set
51          */
52         public void setId(int id) {
53                 this.id = id;
54         }
55
56         /**
57          * @return the modelId
58          */
59         public Integer getModelId() {
60                 return modelId;
61         }
62
63         /**
64          * @param modelId the modelId to set
65          */
66         public void setModelId(Integer modelId) {
67                 this.modelId = modelId;
68         }
69
70         /**
71          * @return the action
72          */
73         public String getAction() {
74                 return action;
75         }
76
77         /**
78          * @param action the action to set
79          */
80         public void setAction(String action) {
81                 this.action = action;
82         }
83
84         /**
85          * @return the versionStr
86          */
87         public String getSchemaVersion() {
88                 return schemaVersion;
89         }
90
91         /**
92          * @param versionStr the versionStr to set
93          */
94         public void setSchemaVersion(String schemaVersion) {
95                 this.schemaVersion = schemaVersion;
96         }
97
98         /**
99          * @return the description
100          */
101         public String getDescription() {
102                 return description;
103         }
104
105         /**
106          * @param description the description to set
107          */
108         public void setDescription(String description) {
109                 this.description = description;
110         }
111
112         /**
113          * @return the orchestrationUri
114          */
115         public String getOrchestrationUri() {
116                 return orchestrationUri;
117         }
118
119         /**
120          * @param orchestrationUri the orchestrationUri to set
121          */
122         public void setOrchestrationUri(String orchestrationUri) {
123                 this.orchestrationUri = orchestrationUri;
124         }
125
126         /**
127          * @return the modelParamXSD
128          */
129         public String getModelParamXSD() {
130                 return modelParamXSD;
131         }
132
133         /**
134          * @param modelParamXSD the modelParamXSD to set
135          */
136         public void setModelParamXSD(String modelParamXSD) {
137                 this.modelParamXSD = modelParamXSD;
138         }
139
140         /**
141          * @return the recipeTimeout
142          */
143         public Integer getRecipeTimeout() {
144                 return recipeTimeout;
145         }
146
147         /**
148          * @param recipeTimeout the recipeTimeout to set
149          */
150         public void setRecipeTimeout(Integer recipeTimeout) {
151                 this.recipeTimeout = recipeTimeout;
152         }
153
154         /**
155          * @return the created
156          */
157         public Timestamp getCreated() {
158                 return created;
159         }
160
161         /**
162          * @param created the created to set
163          */
164         public void setCreated(Timestamp created) {
165                 this.created = created;
166         }
167
168         @Override
169         public String toString() {
170                 StringBuilder sb = new StringBuilder();
171                 sb.append("ModelRecipe: ");
172                 sb.append("modelId=" + modelId.toString());
173                 sb.append(",action=" + action);
174                 sb.append(",schemaVersion=" + schemaVersion);
175                 sb.append(",orchestrationUri=" + orchestrationUri);
176                 sb.append(",modelParamXSD=" + modelParamXSD);
177                 sb.append(",recipeTimeout=" + recipeTimeout.toString());
178         if (created != null) {
179                 sb.append (",created=");
180                 sb.append (DateFormat.getInstance().format(created));
181             }
182                 return sb.toString();
183         }
184 }