Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / 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.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.List;
26
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.onap.so.db.catalog.beans.OrchestrationStatus;
30
31 import com.fasterxml.jackson.annotation.JsonProperty;
32 import com.fasterxml.jackson.annotation.JsonRootName;
33 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
34
35 import javax.persistence.Id;
36
37 @JsonRootName("subnet")
38 public class Subnet implements Serializable, ShallowCopy<Subnet>{
39
40         private static final long serialVersionUID = -6789344717555598319L;
41
42         @Id
43         @JsonProperty("subnet-id")
44     private String subnetId;
45         @JsonProperty("subnet-name")
46     private String subnetName;
47         @JsonProperty("neutron-subnet-id")
48     private String neutronSubnetId;
49         @JsonProperty("gateway-address")
50     private String gatewayAddress;
51         @JsonProperty("network-start-address")
52     private String networkStartAddress;
53         @JsonProperty("cidr-mask")
54     private String cidrMask;
55         @JsonProperty("ip-version")
56     private String ipVersion;
57         @JsonProperty("orchestration-status")
58     private OrchestrationStatus orchestrationStatus;
59         @JsonProperty("dhcp-enabled")
60     private boolean dhcpEnabled;
61         @JsonProperty("dhcp-start")
62     private String dhcpStart;
63         @JsonProperty("dhcp-end")
64     private String dhcpEnd;
65         @JsonProperty("subnet-role")
66     private String subnetRole;
67         @JsonProperty("ip-assignment-direction")
68     private String ipAssignmentDirection;
69         @JsonProperty("subnet-sequence")
70     private Integer subnetSequence;
71         @JsonProperty("host-routes")
72     private List<HostRoute> hostRoutes = new ArrayList<>();
73
74         public String getSubnetId() {
75                 return subnetId;
76         }
77         public void setSubnetId(String subnetId) {
78                 this.subnetId = subnetId;
79         }
80         public String getSubnetName() {
81                 return subnetName;
82         }
83         public void setSubnetName(String subnetName) {
84                 this.subnetName = subnetName;
85         }
86         public String getNeutronSubnetId() {
87                 return neutronSubnetId;
88         }
89         public void setNeutronSubnetId(String neutronSubnetId) {
90                 this.neutronSubnetId = neutronSubnetId;
91         }
92         public String getGatewayAddress() {
93                 return gatewayAddress;
94         }
95         public void setGatewayAddress(String gatewayAddress) {
96                 this.gatewayAddress = gatewayAddress;
97         }
98         public String getNetworkStartAddress() {
99                 return networkStartAddress;
100         }
101         public void setNetworkStartAddress(String networkStartAddress) {
102                 this.networkStartAddress = networkStartAddress;
103         }
104         public String getCidrMask() {
105                 return cidrMask;
106         }
107         public void setCidrMask(String cidrMask) {
108                 this.cidrMask = cidrMask;
109         }
110         public String getIpVersion() {
111                 return ipVersion;
112         }
113         public void setIpVersion(String ipVersion) {
114                 this.ipVersion = ipVersion;
115         }
116         public OrchestrationStatus getOrchestrationStatus() {
117                 return orchestrationStatus;
118         }
119         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
120                 this.orchestrationStatus = orchestrationStatus;
121         }
122         public boolean isDhcpEnabled() {
123                 return dhcpEnabled;
124         }
125         public void setDhcpEnabled(boolean dhcpEnabled) {
126                 this.dhcpEnabled = dhcpEnabled;
127         }
128         public String getDhcpStart() {
129                 return dhcpStart;
130         }
131         public void setDhcpStart(String dhcpStart) {
132                 this.dhcpStart = dhcpStart;
133         }
134         public String getDhcpEnd() {
135                 return dhcpEnd;
136         }
137         public void setDhcpEnd(String dhcpEnd) {
138                 this.dhcpEnd = dhcpEnd;
139         }
140         public String getSubnetRole() {
141                 return subnetRole;
142         }
143         public void setSubnetRole(String subnetRole) {
144                 this.subnetRole = subnetRole;
145         }
146         public String getIpAssignmentDirection() {
147                 return ipAssignmentDirection;
148         }
149         public void setIpAssignmentDirection(String ipAssignmentDirection) {
150                 this.ipAssignmentDirection = ipAssignmentDirection;
151         }
152         public Integer getSubnetSequence() {
153                 return subnetSequence;
154         }
155         public void setSubnetSequence(Integer subnetSequence) {
156                 this.subnetSequence = subnetSequence;
157         }
158         public List<HostRoute> getHostRoutes() {
159                 return hostRoutes;
160         }
161         @Override
162         public boolean equals(final Object other) {
163                 if (!(other instanceof Subnet)) {
164                         return false;
165                 }
166                 Subnet castOther = (Subnet) other;
167                 return new EqualsBuilder().append(subnetId, castOther.subnetId).isEquals();
168         }
169         @Override
170         public int hashCode() {
171                 return new HashCodeBuilder().append(subnetId).toHashCode();
172         }
173 }