diff options
author | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2018-10-26 13:27:54 -0400 |
---|---|---|
committer | Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com> | 2018-10-26 15:28:46 -0400 |
commit | f6a725a0b5b6864c09443e7f328927772a78ea05 (patch) | |
tree | 9a7aec7d4a93059e28ea1b15eee2576f1ad87c5a /src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java | |
parent | b5f75d3996fbfd270e301abbe38766a9f6cf3a40 (diff) |
SDNC context builder API Mapping Configuration
Issue-ID: LOG-421
Add code to use the VNF-API on SDNC where required.
This involves using the api-mapping logic to select the VNF-API over the
GNERIC-RESOURCES-API as well as adding the code to extract the
information required by the VNF-API from AAI and adding the code to
parse the VNF-API resonse into ModelContext.
Change-Id: I4447a14d7fa39b2c5d9b655c2b20e651e56d3d77
Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java')
-rw-r--r-- | src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java new file mode 100644 index 0000000..cb12c26 --- /dev/null +++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/model/VmNetwork.java @@ -0,0 +1,181 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +package org.onap.pomba.contextbuilder.sdnc.model; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class VmNetwork { + + @SerializedName("network-role") + @Expose + private String networkRole; + @SerializedName("network-ips-v6") + @Expose + private List<NetworkIpV6> networkIpsV6 = new ArrayList<NetworkIpV6>(); + @SerializedName("floating-ip") + @Expose + private String floatingIp; + @SerializedName("use-dhcp") + @Expose + private String useDhcp; + @SerializedName("network-ips") + @Expose + private List<NetworkIp> networkIps = new ArrayList<NetworkIp>(); + @SerializedName("floating-ip-v6") + @Expose + private String floatingIpV6; + + /** + * No args constructor for use in serialization + * + */ + public VmNetwork() { + } + + /** + * + * @param useDhcp + * @param networkRole + * @param networkIps + * @param floatingIp + * @param floatingIpV6 + * @param networkIpsV6 + */ + public VmNetwork(String networkRole, List<NetworkIpV6> networkIpsV6, String floatingIp, String useDhcp, List<NetworkIp> networkIps, String floatingIpV6) { + super(); + this.networkRole = networkRole; + this.networkIpsV6 = networkIpsV6; + this.floatingIp = floatingIp; + this.useDhcp = useDhcp; + this.networkIps = networkIps; + this.floatingIpV6 = floatingIpV6; + } + + public String getNetworkRole() { + return networkRole; + } + + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } + + public List<NetworkIpV6> getNetworkIpsV6() { + return networkIpsV6; + } + + public void setNetworkIpsV6(List<NetworkIpV6> networkIpsV6) { + this.networkIpsV6 = networkIpsV6; + } + + public String getFloatingIp() { + return floatingIp; + } + + public void setFloatingIp(String floatingIp) { + this.floatingIp = floatingIp; + } + + public String getUseDhcp() { + return useDhcp; + } + + public void setUseDhcp(String useDhcp) { + this.useDhcp = useDhcp; + } + + public List<NetworkIp> getNetworkIps() { + return networkIps; + } + + public void setNetworkIps(List<NetworkIp> networkIps) { + this.networkIps = networkIps; + } + + public String getFloatingIpV6() { + return floatingIpV6; + } + + public void setFloatingIpV6(String floatingIpV6) { + this.floatingIpV6 = floatingIpV6; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(VmNetwork.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); + sb.append("networkRole"); + sb.append('='); + sb.append(((this.networkRole == null)?"<null>":this.networkRole)); + sb.append(','); + sb.append("networkIpsV6"); + sb.append('='); + sb.append(((this.networkIpsV6 == null)?"<null>":this.networkIpsV6)); + sb.append(','); + sb.append("floatingIp"); + sb.append('='); + sb.append(((this.floatingIp == null)?"<null>":this.floatingIp)); + sb.append(','); + sb.append("useDhcp"); + sb.append('='); + sb.append(((this.useDhcp == null)?"<null>":this.useDhcp)); + sb.append(','); + sb.append("networkIps"); + sb.append('='); + sb.append(((this.networkIps == null)?"<null>":this.networkIps)); + sb.append(','); + sb.append("floatingIpV6"); + sb.append('='); + sb.append(((this.floatingIpV6 == null)?"<null>":this.floatingIpV6)); + sb.append(','); + if (sb.charAt((sb.length()- 1)) == ',') { + sb.setCharAt((sb.length()- 1), ']'); + } else { + sb.append(']'); + } + return sb.toString(); + } + + @Override + public int hashCode() { + int result = 1; + result = ((result* 31)+((this.useDhcp == null)? 0 :this.useDhcp.hashCode())); + result = ((result* 31)+((this.networkRole == null)? 0 :this.networkRole.hashCode())); + result = ((result* 31)+((this.networkIps == null)? 0 :this.networkIps.hashCode())); + result = ((result* 31)+((this.floatingIp == null)? 0 :this.floatingIp.hashCode())); + result = ((result* 31)+((this.floatingIpV6 == null)? 0 :this.floatingIpV6 .hashCode())); + result = ((result* 31)+((this.networkIpsV6 == null)? 0 :this.networkIpsV6 .hashCode())); + return result; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if ((other instanceof VmNetwork) == false) { + return false; + } + VmNetwork rhs = ((VmNetwork) other); + return (((((((this.useDhcp == rhs.useDhcp)||((this.useDhcp!= null)&&this.useDhcp.equals(rhs.useDhcp)))&&((this.networkRole == rhs.networkRole)||((this.networkRole!= null)&&this.networkRole.equals(rhs.networkRole))))&&((this.networkIps == rhs.networkIps)||((this.networkIps!= null)&&this.networkIps.equals(rhs.networkIps))))&&((this.floatingIp == rhs.floatingIp)||((this.floatingIp!= null)&&this.floatingIp.equals(rhs.floatingIp))))&&((this.floatingIpV6 == rhs.floatingIpV6)||((this.floatingIpV6 != null)&&this.floatingIpV6 .equals(rhs.floatingIpV6))))&&((this.networkIpsV6 == rhs.networkIpsV6)||((this.networkIpsV6 != null)&&this.networkIpsV6 .equals(rhs.networkIpsV6)))); + } + +} |