summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/entity/VirtualLinkEntity.java
blob: 340a9be996e3cfa9b42a75396d26020c2ce650ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
/*
 * Copyright 2016 Huawei Technologies Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.onap.vfc.nfvo.resmanagement.service.entity;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;
import org.onap.vfc.nfvo.resmanagement.common.util.JsonUtil;

import net.sf.json.JSONObject;

/**
 * @author l00345485
 * @date 2016-10-27
 */
public class VirtualLinkEntity implements Serializable {

    /**  */
    private String id;

    /**  */
    private String name;

    /**  */
    private String backendId;

    /**  */
    private String isPublic;

    /**  */
    private String dcName;

    /**  */
    private String vimId;

    /**  */
    private String vimName;

    /**  */
    private String physicialNet;

    /**  */
    private String nsId;

    /**  */
    private String nsName;

    /**  */
    private String description;

    /**  */
    private String networkType;

    /**  */
    private String segmentation;

    /**  */
    private String mtu;

    /**  */
    private String vlanTransparent;

    /**  */
    private String routerExternal;

    /**  */
    private String resourceProviderType;

    /**  */
    private String resourceProviderId;

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBackendId() {
        return backendId;
    }

    public void setBackendId(String backendId) {
        this.backendId = backendId;
    }

    public String getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(String isPublic) {
        this.isPublic = isPublic;
    }

    public String getDcName() {
        return dcName;
    }

    public void setDcName(String dcName) {
        this.dcName = dcName;
    }

    public String getVimId() {
        return vimId;
    }

    public void setVimId(String vimId) {
        this.vimId = vimId;
    }

    public String getVimName() {
        return vimName;
    }

    public void setVimName(String vimName) {
        this.vimName = vimName;
    }

    public String getPhysicialNet() {
        return physicialNet;
    }

    public void setPhysicialNet(String physicialNet) {
        this.physicialNet = physicialNet;
    }

    public String getNsId() {
        return nsId;
    }

    public void setNsId(String nsId) {
        this.nsId = nsId;
    }

    public String getNsName() {
        return nsName;
    }

    public void setNsName(String nsName) {
        this.nsName = nsName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNetworkType() {
        return networkType;
    }

    public void setNetworkType(String networkType) {
        this.networkType = networkType;
    }

    public String getSegmentation() {
        return segmentation;
    }

    public void setSegmentation(String segmentation) {
        this.segmentation = segmentation;
    }

    public String getMtu() {
        return mtu;
    }

    public void setMtu(String mtu) {
        this.mtu = mtu;
    }

    public String getVlanTransparent() {
        return vlanTransparent;
    }

    public void setVlanTransparent(String vlanTransparent) {
        this.vlanTransparent = vlanTransparent;
    }

    public String getRouterExternal() {
        return routerExternal;
    }

    public void setRouterExternal(String routerExternal) {
        this.routerExternal = routerExternal;
    }

    public String getResourceProviderType() {
        return resourceProviderType;
    }

    public void setResourceProviderType(String resourceProviderType) {
        this.resourceProviderType = resourceProviderType;
    }

    public String getResourceProviderId() {
        return resourceProviderId;
    }

    public void setResourceProviderId(String resourceProviderId) {
        this.resourceProviderId = resourceProviderId;
    }

    /**
     * <br>
     * 
     * @param jsonObject
     * @return
     * @since VFC 1.0
     */
    public static VirtualLinkEntity toEntity(JSONObject jsonObject) {
        VirtualLinkEntity virtualLinkEntity = new VirtualLinkEntity();
        virtualLinkEntity.setId(JsonUtil.getJsonFieldStr(jsonObject, "vlInstanceId"));
        virtualLinkEntity.setName(JsonUtil.getJsonFieldStr(jsonObject, "name"));
        virtualLinkEntity.setBackendId(JsonUtil.getJsonFieldStr(jsonObject, "backendId"));
        virtualLinkEntity.setIsPublic(JsonUtil.getJsonFieldStr(jsonObject, "isPublic"));
        virtualLinkEntity.setDcName(JsonUtil.getJsonFieldStr(jsonObject, "dcName"));
        virtualLinkEntity.setVimId(JsonUtil.getJsonFieldStr(jsonObject, "vimId"));
        virtualLinkEntity.setVimName(JsonUtil.getJsonFieldStr(jsonObject, "vimName"));
        virtualLinkEntity.setPhysicialNet(JsonUtil.getJsonFieldStr(jsonObject, "physicialNet"));
        virtualLinkEntity.setNsId(JsonUtil.getJsonFieldStr(jsonObject, "nsId"));
        virtualLinkEntity.setNsName(JsonUtil.getJsonFieldStr(jsonObject, "nsName"));
        virtualLinkEntity.setDescription(JsonUtil.getJsonFieldStr(jsonObject, "description"));
        virtualLinkEntity.setNetworkType(JsonUtil.getJsonFieldStr(jsonObject, "networkType"));
        virtualLinkEntity.setSegmentation(JsonUtil.getJsonFieldStr(jsonObject, "segmentation"));
        virtualLinkEntity.setMtu(JsonUtil.getJsonFieldStr(jsonObject, "mtu"));
        virtualLinkEntity.setVlanTransparent(JsonUtil.getJsonFieldStr(jsonObject, "vlanTransparent"));
        virtualLinkEntity.setRouterExternal(JsonUtil.getJsonFieldStr(jsonObject, "routerExternal"));
        virtualLinkEntity.setResourceProviderId(JsonUtil.getJsonFieldStr(jsonObject, "resourceProviderId"));
        virtualLinkEntity.setResourceProviderType(JsonUtil.getJsonFieldStr(jsonObject, "resourceProviderType"));
        return virtualLinkEntity;
    }

    @Override
    public String toString() {
        JSONObject virtualLinkResJson = new JSONObject();
        virtualLinkResJson.put("id", StringUtils.trimToEmpty(this.getId()));
        virtualLinkResJson.put("name", StringUtils.trimToEmpty(this.getName()));
        virtualLinkResJson.put("backendId", StringUtils.trimToEmpty(this.getBackendId()));
        virtualLinkResJson.put("isPublic", StringUtils.trimToEmpty(this.getIsPublic()));
        virtualLinkResJson.put("dcName", StringUtils.trimToEmpty(this.getDcName()));
        virtualLinkResJson.put("vimId", StringUtils.trimToEmpty(this.getVimId()));
        virtualLinkResJson.put("vimName", StringUtils.trimToEmpty(this.getVimName()));
        virtualLinkResJson.put("physicialNet", StringUtils.trimToEmpty(this.getPhysicialNet()));
        virtualLinkResJson.put("nsId", StringUtils.trimToEmpty(this.getNsId()));
        virtualLinkResJson.put("nsName", StringUtils.trimToEmpty(this.getNsName()));
        virtualLinkResJson.put("description", StringUtils.trimToEmpty(this.getDescription()));
        virtualLinkResJson.put("networkType", StringUtils.trimToEmpty(this.getNetworkType()));
        virtualLinkResJson.put("segmentation", StringUtils.trimToEmpty(this.getSegmentation()));
        virtualLinkResJson.put("mtu", StringUtils.trimToEmpty(this.getMtu()));
        virtualLinkResJson.put("vlanTransparent", StringUtils.trimToEmpty(this.getVlanTransparent()));
        virtualLinkResJson.put("routerExternal", StringUtils.trimToEmpty(this.getRouterExternal()));
        virtualLinkResJson.put("resourceProviderId", StringUtils.trimToEmpty(this.getResourceProviderId()));
        virtualLinkResJson.put("resourceProviderType", StringUtils.trimToEmpty(this.getResourceProviderType()));
        return virtualLinkResJson.toString();
    }
}