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;
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;
31 import com.fasterxml.jackson.annotation.JsonProperty;
32 import com.fasterxml.jackson.annotation.JsonRootName;
33 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
35 import javax.persistence.Id;
37 @JsonRootName("subnet")
38 public class Subnet implements Serializable, ShallowCopy<Subnet>{
40 private static final long serialVersionUID = -6789344717555598319L;
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<>();
74 public String getSubnetId() {
77 public void setSubnetId(String subnetId) {
78 this.subnetId = subnetId;
80 public String getSubnetName() {
83 public void setSubnetName(String subnetName) {
84 this.subnetName = subnetName;
86 public String getNeutronSubnetId() {
87 return neutronSubnetId;
89 public void setNeutronSubnetId(String neutronSubnetId) {
90 this.neutronSubnetId = neutronSubnetId;
92 public String getGatewayAddress() {
93 return gatewayAddress;
95 public void setGatewayAddress(String gatewayAddress) {
96 this.gatewayAddress = gatewayAddress;
98 public String getNetworkStartAddress() {
99 return networkStartAddress;
101 public void setNetworkStartAddress(String networkStartAddress) {
102 this.networkStartAddress = networkStartAddress;
104 public String getCidrMask() {
107 public void setCidrMask(String cidrMask) {
108 this.cidrMask = cidrMask;
110 public String getIpVersion() {
113 public void setIpVersion(String ipVersion) {
114 this.ipVersion = ipVersion;
116 public OrchestrationStatus getOrchestrationStatus() {
117 return orchestrationStatus;
119 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
120 this.orchestrationStatus = orchestrationStatus;
122 public boolean isDhcpEnabled() {
125 public void setDhcpEnabled(boolean dhcpEnabled) {
126 this.dhcpEnabled = dhcpEnabled;
128 public String getDhcpStart() {
131 public void setDhcpStart(String dhcpStart) {
132 this.dhcpStart = dhcpStart;
134 public String getDhcpEnd() {
137 public void setDhcpEnd(String dhcpEnd) {
138 this.dhcpEnd = dhcpEnd;
140 public String getSubnetRole() {
143 public void setSubnetRole(String subnetRole) {
144 this.subnetRole = subnetRole;
146 public String getIpAssignmentDirection() {
147 return ipAssignmentDirection;
149 public void setIpAssignmentDirection(String ipAssignmentDirection) {
150 this.ipAssignmentDirection = ipAssignmentDirection;
152 public Integer getSubnetSequence() {
153 return subnetSequence;
155 public void setSubnetSequence(Integer subnetSequence) {
156 this.subnetSequence = subnetSequence;
158 public List<HostRoute> getHostRoutes() {
162 public boolean equals(final Object other) {
163 if (!(other instanceof Subnet)) {
166 Subnet castOther = (Subnet) other;
167 return new EqualsBuilder().append(subnetId, castOther.subnetId).isEquals();
170 public int hashCode() {
171 return new HashCodeBuilder().append(subnetId).toHashCode();