Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / LInterface.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 com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonRootName;
29 import org.apache.commons.lang3.builder.EqualsBuilder;
30 import org.apache.commons.lang3.builder.HashCodeBuilder;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32
33 import javax.persistence.Id;
34
35 @JsonRootName("l-interface")
36 public class LInterface implements Serializable, ShallowCopy<LInterface>{
37
38         private static final long serialVersionUID = 5629921809747079453L;
39
40         @Id
41         @JsonProperty("interface-name")
42     private String interfaceName;
43         @JsonProperty("interface-role")
44     private String interfaceRole;
45         @JsonProperty("v6-wan-link-ip")
46     private String v6WanLinkIp;
47         @JsonProperty("self-link")
48     private String selflink;
49         @JsonProperty("interface-id")
50     private String interfaceId;
51         @JsonProperty("macaddr")
52     private String macaddr;
53         @JsonProperty("network-name")
54     private String networkName;
55         @JsonProperty("management-option")
56     private String managementOption;
57         @JsonProperty("interface-description")
58     private String interfaceDescription;
59         @JsonProperty("is-port-mirrored")
60     private boolean isPortMirrored;
61         @JsonProperty("in-maint")
62     private boolean inMaint;
63         @JsonProperty("prov-status")
64     private String provStatus;
65         @JsonProperty("is-ip-unnumbered")
66     private boolean isIpUnnumbered;
67         @JsonProperty("allowed-address-pairs")
68     private String allowedAddressPairs;
69         @JsonProperty("vlans")
70     private List<Vlan> vlans = new ArrayList<Vlan>();
71         @JsonProperty("sriov-vfs")
72     private List<SriovVf> sriovVfs = new ArrayList<SriovVf>();
73         @JsonProperty("l-interfaces")
74     private List<LInterface> lInterfaces = new ArrayList<LInterface>();
75         @JsonProperty("l3-interface-ipv4-address-list")
76     private List<L3InterfaceIpv4AddressList> l3InterfaceIpv4AddressList = new ArrayList<L3InterfaceIpv4AddressList>();
77         @JsonProperty("l3-interface-ipv6-address-list")
78     private List<L3InterfaceIpv6AddressList> l3InterfaceIpv6AddressList = new ArrayList<L3InterfaceIpv6AddressList>();
79
80         public String getInterfaceName() {
81                 return interfaceName;
82         }
83         public void setInterfaceName(String interfaceName) {
84                 this.interfaceName = interfaceName;
85         }
86         public String getInterfaceRole() {
87                 return interfaceRole;
88         }
89         public void setInterfaceRole(String interfaceRole) {
90                 this.interfaceRole = interfaceRole;
91         }
92         public String getV6WanLinkIp() {
93                 return v6WanLinkIp;
94         }
95         public void setV6WanLinkIp(String v6WanLinkIp) {
96                 this.v6WanLinkIp = v6WanLinkIp;
97         }
98         public String getSelflink() {
99                 return selflink;
100         }
101         public void setSelflink(String selflink) {
102                 this.selflink = selflink;
103         }
104         public String getInterfaceId() {
105                 return interfaceId;
106         }
107         public void setInterfaceId(String interfaceId) {
108                 this.interfaceId = interfaceId;
109         }
110         public String getMacaddr() {
111                 return macaddr;
112         }
113         public void setMacaddr(String macaddr) {
114                 this.macaddr = macaddr;
115         }
116         public String getNetworkName() {
117                 return networkName;
118         }
119         public void setNetworkName(String networkName) {
120                 this.networkName = networkName;
121         }
122         public String getManagementOption() {
123                 return managementOption;
124         }
125         public void setManagementOption(String managementOption) {
126                 this.managementOption = managementOption;
127         }
128         public String getInterfaceDescription() {
129                 return interfaceDescription;
130         }
131         public void setInterfaceDescription(String interfaceDescription) {
132                 this.interfaceDescription = interfaceDescription;
133         }
134         public boolean isPortMirrored() {
135                 return isPortMirrored;
136         }
137         public void setPortMirrored(boolean isPortMirrored) {
138                 this.isPortMirrored = isPortMirrored;
139         }
140         public boolean isInMaint() {
141                 return inMaint;
142         }
143         public void setInMaint(boolean inMaint) {
144                 this.inMaint = inMaint;
145         }
146         public String getProvStatus() {
147                 return provStatus;
148         }
149         public void setProvStatus(String provStatus) {
150                 this.provStatus = provStatus;
151         }
152         public boolean isIpUnnumbered() {
153                 return isIpUnnumbered;
154         }
155         public void setIpUnnumbered(boolean isIpUnnumbered) {
156                 this.isIpUnnumbered = isIpUnnumbered;
157         }
158         public String getAllowedAddressPairs() {
159                 return allowedAddressPairs;
160         }
161         public void setAllowedAddressPairs(String allowedAddressPairs) {
162                 this.allowedAddressPairs = allowedAddressPairs;
163         }
164         public List<Vlan> getVlans() {
165                 return vlans;
166         }
167         public List<SriovVf> getSriovVfs() {
168                 return sriovVfs;
169         }
170         public List<LInterface> getlInterfaces() {
171                 return lInterfaces;
172         }
173         public List<L3InterfaceIpv4AddressList> getL3InterfaceIpv4AddressList() {
174                 return l3InterfaceIpv4AddressList;
175         }
176         public List<L3InterfaceIpv6AddressList> getL3InterfaceIpv6AddressList() {
177                 return l3InterfaceIpv6AddressList;
178         }
179         @Override
180         public boolean equals(final Object other) {
181                 if (!(other instanceof LInterface)) {
182                         return false;
183                 }
184                 LInterface castOther = (LInterface) other;
185                 return new EqualsBuilder().append(interfaceName, castOther.interfaceName).isEquals();
186         }
187         @Override
188         public int hashCode() {
189                 return new HashCodeBuilder().append(interfaceName).toHashCode();
190         }
191 }