fc674a0416748ed350e22d06d03b5bf06691e75c
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / onap / so / adapters / network / beans / ContrailSubnet.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.onap.so.adapters.network.beans;
22
23 import java.util.ArrayList;
24 import java.util.List;
25
26 import com.fasterxml.jackson.annotation.JsonProperty;
27
28 public class ContrailSubnet {
29
30         @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet")
31         private ContrailSubnetIp subnet = new ContrailSubnetIp();
32         
33         @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway")
34         private String defaultGateway;
35         
36         @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name")
37         private String subnetName;
38         
39         @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp")
40         private Boolean enableDhcp;
41         
42         @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start")
43         private Boolean addrFromStart = true;   
44         /** future - leave this commented
45         private String subnet_uuid;
46         private String dns_server_address;
47         private List<String> dns_nameservers;
48         private String dhcp_option_list;
49         **/
50         
51         @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools")
52         private List<ContrailSubnetPool> allocationPools =  new ArrayList<>();
53
54         @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes")
55         private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes();
56         
57         public ContrailSubnet() {
58                 super();
59         }
60
61         public String getDefaultGateway() {
62                 return defaultGateway;
63         }
64
65         public void setDefaultGateway(String defaultGateway) {
66                 this.defaultGateway = defaultGateway;
67         }
68
69         public ContrailSubnetIp getSubnet() {
70                 return subnet;
71         }
72
73         public void setSubnet(ContrailSubnetIp subnet) {
74                 this.subnet = subnet;
75         }
76
77         public Boolean isEnableDhcp() {
78                 return enableDhcp;
79         }
80
81         public void setEnableDhcp(Boolean enableDhcp) {
82                 this.enableDhcp = enableDhcp;
83         }
84
85         public String getSubnetName() {
86                 return subnetName;
87         }
88
89         public void setSubnetName(String subnetName) {
90                 this.subnetName = subnetName;
91         }
92
93         public List<ContrailSubnetPool> getAllocationPools() {
94                 return allocationPools;
95         }
96
97         public void setAllocationPools(List<ContrailSubnetPool> allocationPools) {
98                 this.allocationPools = allocationPools;
99         }
100
101         public Boolean isAddrFromStart() {
102                 return addrFromStart;
103         }
104
105         public void setAddrFromStart(Boolean addrFromStart) {
106                 this.addrFromStart = addrFromStart;
107         }
108
109         public ContrailSubnetHostRoutes getHostRoutes() {
110                 return hostRoutes;
111         }
112
113         public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) {
114                 this.hostRoutes = hostRoutes;
115         }
116
117         @Override
118         public String toString() {
119                 StringBuilder buf = new StringBuilder ();
120                 for (ContrailSubnetPool pool : allocationPools)
121                 {
122                          buf.append(pool.toString());
123                 }
124                 return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway
125                                 + " enable_dhcp=" + enableDhcp +  " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + buf + " ]";
126         }
127
128 }