L2gateway: Added yang, APIs,Transcriber for L2gateway.
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronFloatingIP.java
index 68c801e5bb74bd613098c97c88a82d531183c2a2..cf03a40e672cc349c109ae4d95ca5d214099755c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright IBM Corporation, 2013.  All rights reserved.
+ * Copyright (c) 2013, 2015 IBM Corporation and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -20,15 +20,12 @@ import javax.xml.bind.annotation.XmlRootElement;
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
 
-public class NeutronFloatingIP implements Serializable {
+public class NeutronFloatingIP extends NeutronObject implements Serializable, INeutronObject {
     private static final long serialVersionUID = 1L;
 
     // See OpenStack Network API v2.0 Reference for description of
     // annotated attributes
 
-    @XmlElement (name = "id")
-    String floatingIPUUID;
-
     @XmlElement (name = "floating_network_id")
     String floatingNetworkUUID;
 
@@ -41,20 +38,23 @@ public class NeutronFloatingIP implements Serializable {
     @XmlElement (name = "floating_ip_address")
     String floatingIPAddress;
 
-    @XmlElement (name = "tenant_id")
-    String tenantUUID;
+    @XmlElement (name="router_id")
+    String routerUUID;
+
+    @XmlElement (name="status")
+    String status;
 
     public NeutronFloatingIP() {
     }
 
-    public String getID() { return floatingIPUUID; }
-
+    // @deprecated use getID()
     public String getFloatingIPUUID() {
-        return floatingIPUUID;
+        return getID();
     }
 
-    public void setFloatingIPUUID(String floatingIPUUID) {
-        this.floatingIPUUID = floatingIPUUID;
+    // @deprecated use setID()
+    public void setFloatingIPUUID(String uuid) {
+        setID(uuid);
     }
 
     public String getFloatingNetworkUUID() {
@@ -69,6 +69,10 @@ public class NeutronFloatingIP implements Serializable {
         return portUUID;
     }
 
+    public String getRouterUUID() {
+        return routerUUID;
+    }
+
     public void setPortUUID(String portUUID) {
         this.portUUID = portUUID;
     }
@@ -89,12 +93,26 @@ public class NeutronFloatingIP implements Serializable {
         this.floatingIPAddress = floatingIPAddress;
     }
 
+    @Deprecated
     public String getTenantUUID() {
-        return tenantUUID;
+        return getTenantID();
+    }
+
+    @Deprecated
+    public void setTenantUUID(String tenantID) {
+        setTenantID(tenantID);
     }
 
-    public void setTenantUUID(String tenantUUID) {
-        this.tenantUUID = tenantUUID;
+    public void setRouterUUID(String routerUUID) {
+        this.routerUUID = routerUUID;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
     }
 
     /**
@@ -113,7 +131,7 @@ public class NeutronFloatingIP implements Serializable {
         while (i.hasNext()) {
             String s = i.next();
             if (s.equals("id")) {
-                ans.setFloatingIPUUID(this.getFloatingIPUUID());
+                ans.setID(this.getID());
             }
             if (s.equals("floating_network_id")) {
                 ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID());
@@ -128,7 +146,13 @@ public class NeutronFloatingIP implements Serializable {
                 ans.setFloatingIPAddress(this.getFloatingIPAddress());
             }
             if (s.equals("tenant_id")) {
-                ans.setTenantUUID(this.getTenantUUID());
+                ans.setTenantID(this.getTenantID());
+            }
+            if (s.equals("router_id")) {
+                ans.setRouterUUID(this.getRouterUUID());
+            }
+            if (s.equals("status")) {
+                ans.setStatus(this.getStatus());
             }
         }
         return ans;
@@ -137,15 +161,14 @@ public class NeutronFloatingIP implements Serializable {
     @Override
     public String toString() {
         return "NeutronFloatingIP{" +
-            "fipUUID='" + floatingIPUUID + '\'' +
+            "fipUUID='" + uuid + '\'' +
             ", fipFloatingNetworkId='" + floatingNetworkUUID + '\'' +
             ", fipPortUUID='" + portUUID + '\'' +
             ", fipFixedIPAddress='" + fixedIPAddress + '\'' +
             ", fipFloatingIPAddress=" + floatingIPAddress +
-            ", fipTenantId='" + tenantUUID + '\'' +
+            ", fipTenantId='" + tenantID + '\'' +
+            ", fipRouterId='" + routerUUID + '\'' +
+            ", fipStatus='" + status + '\'' +
             '}';
     }
-
-    public void initDefaults() {
-    }
 }