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