2 * Copyright (c) 2013, 2015 IBM Corporation and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.neutron.spi;
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
17 @XmlAccessorType(XmlAccessType.NONE)
18 public final class NeutronFloatingIp extends NeutronObject<NeutronFloatingIp> {
19 private static final long serialVersionUID = 1L;
21 // See OpenStack Network API v2.0 Reference for description of
22 // annotated attributes
24 @XmlElement(name = "floating_network_id")
25 String floatingNetworkUUID;
27 @XmlElement(name = "port_id")
30 @XmlElement(name = "fixed_ip_address")
31 String fixedIpAddress;
33 @XmlElement(name = "floating_ip_address")
34 String floatingIpAddress;
36 @XmlElement(name = "router_id")
39 @XmlElement(name = "status")
42 public NeutronFloatingIp() {
45 public String getFloatingNetworkUUID() {
46 return floatingNetworkUUID;
49 public void setFloatingNetworkUUID(String floatingNetworkUUID) {
50 this.floatingNetworkUUID = floatingNetworkUUID;
53 public String getPortUUID() {
57 public String getRouterUUID() {
61 public void setPortUUID(String portUUID) {
62 this.portUUID = portUUID;
65 public String getFixedIpAddress() {
66 return fixedIpAddress;
69 public void setFixedIpAddress(String fixedIpAddress) {
70 this.fixedIpAddress = fixedIpAddress;
73 public String getFloatingIpAddress() {
74 return floatingIpAddress;
77 public void setFloatingIpAddress(String floatingIpAddress) {
78 this.floatingIpAddress = floatingIpAddress;
81 public void setRouterUUID(String routerUUID) {
82 this.routerUUID = routerUUID;
85 public String getStatus() {
89 public void setStatus(String status) {
94 protected boolean extractField(String field, NeutronFloatingIp ans) {
96 case "floating_network_id":
97 ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID());
100 ans.setPortUUID(this.getPortUUID());
102 case "fixed_ip_address":
103 ans.setFixedIpAddress(this.getFixedIpAddress());
105 case "floating_ip_address":
106 ans.setFloatingIpAddress(this.getFloatingIpAddress());
109 ans.setRouterUUID(this.getRouterUUID());
112 ans.setStatus(this.getStatus());
115 return super.extractField(field, ans);
121 public String toString() {
122 return "NeutronFloatingIp{" + "fipUUID='" + uuid + '\'' + ", fipFloatingNetworkId='" + floatingNetworkUUID
123 + '\'' + ", fipPortUUID='" + portUUID + '\'' + ", fipFixedIpAddress='" + fixedIpAddress + '\''
124 + ", fipFloatingIpAddress=" + floatingIpAddress + ", fipTenantId='" + tenantID + '\''
125 + ", fipRouterId='" + routerUUID + '\'' + ", fipStatus='" + status + '\'' + '}';