1710 Rebase - Second Attempt
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / Recipe.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
21 package org.openecomp.mso.db.catalog.beans;
22
23
24 import java.io.Serializable;
25 import java.sql.Timestamp;
26 import java.text.DateFormat;
27
28 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
29
30 public class Recipe extends MavenLikeVersioning implements Serializable {
31         
32         private static final long serialVersionUID = 768026109321305392L;
33
34     private int id;
35     protected String action;
36     private String description;
37     protected String orchestrationUri;
38     private int recipeTimeout;
39     private String serviceType;
40
41         private Timestamp created;
42     
43     public Recipe () {
44         super ();
45     }
46
47     public int getId () {
48         return id;
49     }
50
51     public void setId (int id) {
52         this.id = id;
53     }
54
55     public String getAction () {
56         return action;
57     }
58
59     public void setAction (String action) {
60         this.action = action;
61     }
62
63     public String getDescription () {
64         return description;
65     }
66
67     public void setDescription (String description) {
68         this.description = description;
69     }
70
71     public String getOrchestrationUri () {
72         return orchestrationUri;
73     }
74
75     public void setOrchestrationUri (String orchestrationUri) {
76         this.orchestrationUri = orchestrationUri;
77     }
78
79     public int getRecipeTimeout () {
80         return recipeTimeout;
81     }
82
83     public void setRecipeTimeout (int recipeTimeout) {
84         this.recipeTimeout = recipeTimeout;
85     }
86
87     public String getServiceType () {
88         return serviceType;
89     }
90
91     public void setServiceType (String serviceType) {
92         this.serviceType = serviceType;
93     }
94
95         public Timestamp getCreated() {
96                 return created;
97         }
98
99         public void setCreated(Timestamp created) {
100                 this.created = created;
101         }
102
103         @Override
104     public String toString() {
105         StringBuilder sb = new StringBuilder();
106         sb.append("RECIPE: " + action);
107         sb.append(",uri=" + orchestrationUri);
108         
109         if (created != null) {
110                 sb.append (",created=");
111                 sb.append (DateFormat.getInstance().format(created));
112             }
113         return sb.toString();
114     }
115 }