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 java.util.List;
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter> {
20 private static final long serialVersionUID = 1L;
22 // See OpenStack Network API v2.0 Reference for description of
23 // annotated attributes
24 @XmlElement(name = "external_gateway_info", nillable = true)
25 NeutronRouterNetworkReference externalGatewayInfo;
27 @XmlElement(name = "distributed")
30 @XmlElement(name = "gw_port_id", nillable = true)
33 @XmlElement(name = "routes")
34 List<NeutronRoute> routes;
36 public NeutronRouter() {
39 public NeutronRouterNetworkReference getExternalGatewayInfo() {
40 return externalGatewayInfo;
43 public void setExternalGatewayInfo(NeutronRouterNetworkReference externalGatewayInfo) {
44 this.externalGatewayInfo = externalGatewayInfo;
47 public Boolean getDistributed() {
51 public void setDistributed(Boolean distributed) {
52 this.distributed = distributed;
55 public String getGatewayPortId() {
59 public void setGatewayPortId(String gatewayPortId) {
60 this.gatewayPortId = gatewayPortId;
63 public List<NeutronRoute> getRoutes() {
67 public void setRoutes(List<NeutronRoute> routes) {
72 protected boolean extractField(String field, NeutronRouter ans) {
74 case "external_gateway_info":
75 ans.setExternalGatewayInfo(this.getExternalGatewayInfo());
78 ans.setDistributed(this.getDistributed());
81 ans.setGatewayPortId(this.getGatewayPortId());
84 ans.setRoutes(this.getRoutes());
87 return super.extractField(field, ans);
93 public String toString() {
94 return "NeutronRouter [" + "id=" + uuid + ", name=" + name + ", adminStateUp=" + adminStateUp + ", status="
95 + status + ", tenantID=" + tenantID + ", external_gateway_info=" + externalGatewayInfo
96 + ", distributed=" + distributed + ", gw_port_id=" + gatewayPortId + ", routes=" + routes + "]";