Initial OpenECOMP MSO commit
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / NetworkResource.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 org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
25
26 import java.sql.Timestamp;
27 import java.text.DateFormat;
28
29 public class NetworkResource extends MavenLikeVersioning {
30         private int id;
31         private String networkType;
32         private String orchestrationMode = null;
33         private String description = null;
34         private int templateId;
35         private String neutronNetworkType = null;
36         private String aicVersionMin = null;
37         private String aicVersionMax = null;
38         
39         private Timestamp created;
40         
41         public NetworkResource() {}
42         
43         public int getId() {
44                 return id;
45         }
46         
47         public void setId(int id) {
48                 this.id = id;
49         }
50         
51         public String getNetworkType() {
52                 return networkType;
53         }
54         public void setNetworkType(String networkType) {
55                 this.networkType = networkType;
56         }
57         
58         public String getOrchestrationMode() {
59                 return orchestrationMode;
60         }
61         public void setOrchestrationMode(String orchestrationMode) {
62                 this.orchestrationMode = orchestrationMode;
63         }
64         
65         public String getDescription() {
66                 return description;
67         }
68         public void setDescription(String description) {
69                 this.description = description;
70         }
71         
72         public int getTemplateId () {
73                 return templateId;
74         }
75         
76         public void setTemplateId (int templateId) {
77                 this.templateId = templateId;
78         }
79         
80         public String getNeutronNetworkType() {
81                 return neutronNetworkType;
82         }
83
84         public void setNeutronNetworkType(String neutronNetworkType) {
85                 this.neutronNetworkType = neutronNetworkType;
86         }
87         
88         public Timestamp getCreated() {
89                 return created;
90         }
91
92         public void setCreated(Timestamp created) {
93                 this.created = created;
94         }
95                 
96         public String getAicVersionMin() {
97                 return aicVersionMin;
98         }
99
100         public void setAicVersionMin(String aicVersionMin) {
101                 this.aicVersionMin = aicVersionMin;
102         }
103
104         public String getAicVersionMax() {
105                 return aicVersionMax;
106         }
107
108         public void setAicVersionMax(String aicVersionMax) {
109                 this.aicVersionMax = aicVersionMax;
110         }
111
112         @Override
113         public String toString () {
114                 StringBuffer sb = new StringBuffer();
115                 sb.append("NETWORK=");
116                 sb.append(networkType);
117                 sb.append(",version=");
118                 sb.append(version);
119                 sb.append(",mode=");
120                 sb.append(orchestrationMode);
121                 sb.append(",template=");
122                 sb.append(templateId);
123                 sb.append(",neutronType=");
124                 sb.append(neutronNetworkType);
125                 sb.append(",aicVersionMin=");
126                 sb.append(aicVersionMin);
127                 sb.append(",aicVersionMax=");
128                 sb.append(aicVersionMax);
129                 
130                 sb.append("id=");
131                 sb.append(id);
132                 
133                 if (created != null) {
134                 sb.append (",created=");
135                 sb.append (DateFormat.getInstance().format(created));
136             }
137                 return sb.toString();
138         }
139 }