2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.List;
26 import org.apache.commons.lang3.builder.EqualsBuilder;
27 import org.apache.commons.lang3.builder.HashCodeBuilder;
28 import org.onap.so.db.catalog.beans.OrchestrationStatus;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonRootName;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32 import javax.persistence.Id;
34 @JsonRootName("subnet")
35 public class Subnet implements Serializable, ShallowCopy<Subnet> {
37 private static final long serialVersionUID = -6789344717555598319L;
40 @JsonProperty("subnet-id")
41 private String subnetId;
42 @JsonProperty("subnet-name")
43 private String subnetName;
44 @JsonProperty("neutron-subnet-id")
45 private String neutronSubnetId;
46 @JsonProperty("gateway-address")
47 private String gatewayAddress;
48 @JsonProperty("network-start-address")
49 private String networkStartAddress;
50 @JsonProperty("cidr-mask")
51 private String cidrMask;
52 @JsonProperty("ip-version")
53 private String ipVersion;
54 @JsonProperty("orchestration-status")
55 private OrchestrationStatus orchestrationStatus;
56 @JsonProperty("dhcp-enabled")
57 private Boolean dhcpEnabled;
58 @JsonProperty("dhcp-start")
59 private String dhcpStart;
60 @JsonProperty("dhcp-end")
61 private String dhcpEnd;
62 @JsonProperty("subnet-role")
63 private String subnetRole;
64 @JsonProperty("ip-assignment-direction")
65 private String ipAssignmentDirection;
66 @JsonProperty("subnet-sequence")
67 private Integer subnetSequence;
68 @JsonProperty("host-routes")
69 private List<HostRoute> hostRoutes = new ArrayList<>();
71 public String getSubnetId() {
75 public void setSubnetId(String subnetId) {
76 this.subnetId = subnetId;
79 public String getSubnetName() {
83 public void setSubnetName(String subnetName) {
84 this.subnetName = subnetName;
87 public String getNeutronSubnetId() {
88 return neutronSubnetId;
91 public void setNeutronSubnetId(String neutronSubnetId) {
92 this.neutronSubnetId = neutronSubnetId;
95 public String getGatewayAddress() {
96 return gatewayAddress;
99 public void setGatewayAddress(String gatewayAddress) {
100 this.gatewayAddress = gatewayAddress;
103 public String getNetworkStartAddress() {
104 return networkStartAddress;
107 public void setNetworkStartAddress(String networkStartAddress) {
108 this.networkStartAddress = networkStartAddress;
111 public String getCidrMask() {
115 public void setCidrMask(String cidrMask) {
116 this.cidrMask = cidrMask;
119 public String getIpVersion() {
123 public void setIpVersion(String ipVersion) {
124 this.ipVersion = ipVersion;
127 public OrchestrationStatus getOrchestrationStatus() {
128 return orchestrationStatus;
131 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
132 this.orchestrationStatus = orchestrationStatus;
135 public Boolean isDhcpEnabled() {
139 public void setDhcpEnabled(Boolean dhcpEnabled) {
140 this.dhcpEnabled = dhcpEnabled;
143 public String getDhcpStart() {
147 public void setDhcpStart(String dhcpStart) {
148 this.dhcpStart = dhcpStart;
151 public String getDhcpEnd() {
155 public void setDhcpEnd(String dhcpEnd) {
156 this.dhcpEnd = dhcpEnd;
159 public String getSubnetRole() {
163 public void setSubnetRole(String subnetRole) {
164 this.subnetRole = subnetRole;
167 public String getIpAssignmentDirection() {
168 return ipAssignmentDirection;
171 public void setIpAssignmentDirection(String ipAssignmentDirection) {
172 this.ipAssignmentDirection = ipAssignmentDirection;
175 public Integer getSubnetSequence() {
176 return subnetSequence;
179 public void setSubnetSequence(Integer subnetSequence) {
180 this.subnetSequence = subnetSequence;
183 public List<HostRoute> getHostRoutes() {
188 public boolean equals(final Object other) {
189 if (!(other instanceof Subnet)) {
192 Subnet castOther = (Subnet) other;
193 return new EqualsBuilder().append(subnetId, castOther.subnetId).isEquals();
197 public int hashCode() {
198 return new HashCodeBuilder().append(subnetId).toHashCode();