Containerization feature of SO
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / onap / so / openstack / beans / Subnet.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.openstack.beans;
22
23
24
25 import java.io.Serializable;
26 import java.util.List;
27
28 import javax.xml.bind.annotation.XmlTransient;
29
30 public class Subnet implements Serializable {
31
32         /**
33          * 
34          */
35         private static final long serialVersionUID = -530027355187604839L;
36
37         private String subnetName; 
38         
39         private String neutronId;
40
41         private String subnetId; // value from aai
42
43     private String cidr; //Only field required
44
45     private String gatewayIp;
46
47     private String ipVersion="4";
48
49     private Boolean enableDHCP=false;
50     
51     private Boolean addrFromStart=true;
52
53     private List<HostRoute> hostRoutes;
54
55     private List<Pool> allocationPools;
56
57     private List<String> dnsNameServers;
58
59     public Subnet () {
60     }
61
62         public String getSubnetName() {
63                 return subnetName;
64         }
65
66         public void setSubnetName(String subnetName) {
67                 this.subnetName = subnetName;
68         }
69         
70         public List<Pool> getAllocationPools() {
71                 return allocationPools;
72         }
73
74         /**
75      * @return the cidr
76      */
77     public String getCidr() {
78         return cidr;
79     }
80
81     /**
82      * @return the dnsNames
83      */
84     public List<String> getDnsNameServers() {
85         return dnsNameServers;
86     }
87
88
89     public Boolean getEnableDHCP() {
90         return enableDHCP;
91     }
92
93         public Boolean getAddrFromStart() {
94                 return addrFromStart;
95         }
96
97         public void setAddrFromStart(Boolean addrFromStart) {
98                 this.addrFromStart = addrFromStart;
99         }
100
101         /**
102      * @return the gw
103      */
104     public String getGatewayIp() {
105         return gatewayIp;
106     }
107
108     /**
109      * @return the hostRoutes
110      */
111     public List<HostRoute> getHostRoutes() {
112         return hostRoutes;
113     }
114
115     /**
116      * @return the NeutronId
117      */
118     @XmlTransient
119     public String getNeutronId() {
120         return neutronId;
121     }
122
123     /**
124      * @return the ipversion
125      */
126     public String getIpVersion() {
127         return ipVersion;
128     }
129
130     /**
131      * @return the name
132      */
133     public String getSubnetId() {
134         return subnetId;
135     }
136
137     public void setAllocationPools(List<Pool> allocationPools) {
138                 this.allocationPools = allocationPools;
139         }
140
141     /**
142      * @param cidr
143      *            the cidr to set
144      */
145     public void setCidr(String cidr) {
146         this.cidr = cidr;
147     }
148
149     /**
150      * @param dnsNames
151      *            the dnsNames to set
152      */
153     public void setDnsNameServers(List<String> dnsNameServers) {
154         this.dnsNameServers = dnsNameServers;
155     }
156
157     /**
158      * @param enableDHCP
159      *            the enableDHCP to set
160      */
161     public void setEnableDHCP(Boolean enableDHCP) {
162         this.enableDHCP = enableDHCP;
163     }
164
165     /**
166      * @param gw
167      *            the gw to set
168      */
169     public void setGatewayIp(String gatewayIp) {
170         this.gatewayIp = gatewayIp;
171     }
172
173     /**
174      * @param hostRoutes
175      *            the hostRoutes to set
176      */
177     public void setHostRoutes(List<HostRoute> hostRoutes) {
178         this.hostRoutes = hostRoutes;
179     }
180
181     /**
182      * @param neutronId
183      *            the id to set
184      */
185     public void setNeutronId(String neutronId) {
186         this.neutronId = neutronId;
187     }
188
189     /**
190      * @param ipversion
191      *            the ipversion to set
192      */
193     public void setIpVersion(String ipVersion) {
194         this.ipVersion = ipVersion;
195     }
196
197     /**
198      * @param name
199      *            the name to set
200      */
201     public void setSubnetId(String subnetId) {
202         this.subnetId = subnetId;
203     }
204
205         @Override
206         public String toString() {
207                 return "Subnet [subnetName=" + subnetName + ", neutronId=" + neutronId + ", subnetId=" + subnetId + ", cidr="
208                                 + cidr + ", gatewayIp=" + gatewayIp + ", ipVersion=" + ipVersion + ", enableDHCP=" + enableDHCP
209                                 + ", addrFromStart=" + addrFromStart + ", hostRoutes=" + hostRoutes + ", allocationPools="
210                                 + allocationPools + ", dnsNameServers=" + dnsNameServers + "]";
211         }
212
213 }