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