-/*\r
- * Copyright IBM Corporation, 2013. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.controller.networkconfig.neutron;\r
-\r
-import java.util.HashMap;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-import javax.xml.bind.annotation.XmlAccessType;\r
-import javax.xml.bind.annotation.XmlAccessorType;\r
-import javax.xml.bind.annotation.XmlElement;\r
-import javax.xml.bind.annotation.XmlRootElement;\r
-\r
-@XmlRootElement\r
-@XmlAccessorType(XmlAccessType.NONE)\r
-\r
-public class NeutronRouter {\r
- // See OpenStack Network API v2.0 Reference for description of\r
- // annotated attributes\r
- @XmlElement (name="id")\r
- String routerUUID;\r
-\r
- @XmlElement (name="name")\r
- String name;\r
-\r
- @XmlElement (defaultValue="true", name="admin_state_up")\r
- Boolean adminStateUp;\r
-\r
- @XmlElement (name="status")\r
- String status;\r
-\r
- @XmlElement (name="tenant_id")\r
- String tenantID;\r
-\r
- @XmlElement (name="external_gateway_info")\r
- NeutronRouter_NetworkReference externalGatewayInfo;\r
-\r
- /* Holds a map of OpenStackRouterInterfaces by subnet UUID\r
- * used for internal mapping to DOVE\r
- */\r
- HashMap<String, NeutronRouter_Interface> interfaces;\r
-\r
- public NeutronRouter() {\r
- interfaces = new HashMap<String, NeutronRouter_Interface>();\r
- }\r
-\r
- public String getID() { return routerUUID; }\r
-\r
- public String getRouterUUID() {\r
- return routerUUID;\r
- }\r
-\r
- public void setRouterUUID(String routerUUID) {\r
- this.routerUUID = routerUUID;\r
- }\r
-\r
- public String getName() {\r
- return name;\r
- }\r
-\r
- public void setName(String name) {\r
- this.name = name;\r
- }\r
-\r
- public boolean isAdminStateUp() {\r
- if (adminStateUp == null)\r
- return true;\r
- return adminStateUp;\r
- }\r
-\r
- public Boolean getAdminStateUp() { return adminStateUp; }\r
-\r
- public void setAdminStateUp(Boolean newValue) {\r
- this.adminStateUp = newValue;\r
- }\r
-\r
- public String getStatus() {\r
- return status;\r
- }\r
-\r
- public void setStatus(String status) {\r
- this.status = status;\r
- }\r
-\r
- public String getTenantID() {\r
- return tenantID;\r
- }\r
-\r
- public void setTenantID(String tenantID) {\r
- this.tenantID = tenantID;\r
- }\r
-\r
- public NeutronRouter_NetworkReference getExternalGatewayInfo() {\r
- return externalGatewayInfo;\r
- }\r
-\r
- public void setExternalGatewayInfo(NeutronRouter_NetworkReference externalGatewayInfo) {\r
- this.externalGatewayInfo = externalGatewayInfo;\r
- }\r
-\r
- /**\r
- * This method copies selected fields from the object and returns them\r
- * as a new object, suitable for marshaling.\r
- *\r
- * @param fields\r
- * List of attributes to be extracted\r
- * @return an OpenStackRouters object with only the selected fields\r
- * populated\r
- */\r
-\r
- public NeutronRouter extractFields(List<String> fields) {\r
- NeutronRouter ans = new NeutronRouter();\r
- Iterator<String> i = fields.iterator();\r
- while (i.hasNext()) {\r
- String s = i.next();\r
- if (s.equals("id"))\r
- ans.setRouterUUID(this.getRouterUUID());\r
- if (s.equals("name"))\r
- ans.setName(this.getName());\r
- if (s.equals("admin_state_up"))\r
- ans.setAdminStateUp(this.getAdminStateUp());\r
- if (s.equals("status"))\r
- ans.setStatus(this.getStatus());\r
- if (s.equals("tenant_id"))\r
- ans.setTenantID(this.getTenantID());\r
- if (s.equals("external_gateway_info")) {\r
- ans.setExternalGatewayInfo(this.getExternalGatewayInfo());\r
- }\r
- }\r
- return ans;\r
- }\r
-\r
- public HashMap<String, NeutronRouter_Interface> getInterfaces() {\r
- return interfaces;\r
- }\r
-\r
- public void addInterface(String s, NeutronRouter_Interface i) {\r
- interfaces.put(s, i);\r
- }\r
-\r
- public void removeInterface(String s) {\r
- interfaces.remove(s);\r
- }\r
-\r
- public void initDefaults() {\r
- adminStateUp = true;\r
- }\r
-}\r
+/*
+ * Copyright IBM Corporation, 2013. 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,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.networkconfig.neutron;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
+
+public class NeutronRouter {
+ // See OpenStack Network API v2.0 Reference for description of
+ // annotated attributes
+ @XmlElement (name="id")
+ String routerUUID;
+
+ @XmlElement (name="name")
+ String name;
+
+ @XmlElement (defaultValue="true", name="admin_state_up")
+ Boolean adminStateUp;
+
+ @XmlElement (name="status")
+ String status;
+
+ @XmlElement (name="tenant_id")
+ String tenantID;
+
+ @XmlElement (name="external_gateway_info")
+ NeutronRouter_NetworkReference externalGatewayInfo;
+
+ /* Holds a map of OpenStackRouterInterfaces by subnet UUID
+ * used for internal mapping to DOVE
+ */
+ HashMap<String, NeutronRouter_Interface> interfaces;
+
+ public NeutronRouter() {
+ interfaces = new HashMap<String, NeutronRouter_Interface>();
+ }
+
+ public String getID() { return routerUUID; }
+
+ public String getRouterUUID() {
+ return routerUUID;
+ }
+
+ public void setRouterUUID(String routerUUID) {
+ this.routerUUID = routerUUID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isAdminStateUp() {
+ if (adminStateUp == null) {
+ return true;
+ }
+ return adminStateUp;
+ }
+
+ public Boolean getAdminStateUp() { return adminStateUp; }
+
+ public void setAdminStateUp(Boolean newValue) {
+ adminStateUp = newValue;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public void setTenantID(String tenantID) {
+ this.tenantID = tenantID;
+ }
+
+ public NeutronRouter_NetworkReference getExternalGatewayInfo() {
+ return externalGatewayInfo;
+ }
+
+ public void setExternalGatewayInfo(NeutronRouter_NetworkReference externalGatewayInfo) {
+ this.externalGatewayInfo = externalGatewayInfo;
+ }
+
+ /**
+ * This method copies selected fields from the object and returns them
+ * as a new object, suitable for marshaling.
+ *
+ * @param fields
+ * List of attributes to be extracted
+ * @return an OpenStackRouters object with only the selected fields
+ * populated
+ */
+
+ public NeutronRouter extractFields(List<String> fields) {
+ NeutronRouter ans = new NeutronRouter();
+ Iterator<String> i = fields.iterator();
+ while (i.hasNext()) {
+ String s = i.next();
+ if (s.equals("id")) {
+ ans.setRouterUUID(this.getRouterUUID());
+ }
+ if (s.equals("name")) {
+ ans.setName(this.getName());
+ }
+ if (s.equals("admin_state_up")) {
+ ans.setAdminStateUp(this.getAdminStateUp());
+ }
+ if (s.equals("status")) {
+ ans.setStatus(this.getStatus());
+ }
+ if (s.equals("tenant_id")) {
+ ans.setTenantID(this.getTenantID());
+ }
+ if (s.equals("external_gateway_info")) {
+ ans.setExternalGatewayInfo(this.getExternalGatewayInfo());
+ }
+ }
+ return ans;
+ }
+
+ public HashMap<String, NeutronRouter_Interface> getInterfaces() {
+ return interfaces;
+ }
+
+ public void addInterface(String s, NeutronRouter_Interface i) {
+ interfaces.put(s, i);
+ }
+
+ public void removeInterface(String s) {
+ interfaces.remove(s);
+ }
+
+ public void initDefaults() {
+ adminStateUp = true;
+ }
+}