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.io.Serializable;
12 import java.util.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronRouter extends NeutronAdminAttributes<NeutronRouter>
21 implements Serializable {
22 private static final long serialVersionUID = 1L;
24 // See OpenStack Network API v2.0 Reference for description of
25 // annotated attributes
26 @XmlElement(name = "external_gateway_info", nillable = true)
27 NeutronRouterNetworkReference externalGatewayInfo;
29 @XmlElement(name = "distributed")
32 @XmlElement(name = "gw_port_id", nillable = true)
35 @XmlElement(name = "routes")
36 List<NeutronRoute> routes;
38 public NeutronRouter() {
41 public boolean isAdminStateUp() {
42 if (adminStateUp == null) {
48 public NeutronRouterNetworkReference getExternalGatewayInfo() {
49 return externalGatewayInfo;
52 public void setExternalGatewayInfo(NeutronRouterNetworkReference externalGatewayInfo) {
53 this.externalGatewayInfo = externalGatewayInfo;
56 public Boolean getDistributed() {
60 public void setDistributed(Boolean distributed) {
61 this.distributed = distributed;
64 public String getGatewayPortId() {
68 public void setGatewayPortId(String gatewayPortId) {
69 this.gatewayPortId = gatewayPortId;
72 public List<NeutronRoute> getRoutes() {
76 public void setRoutes(List<NeutronRoute> routes) {
81 protected boolean extractField(String field, NeutronRouter ans) {
83 case "external_gateway_info":
84 ans.setExternalGatewayInfo(this.getExternalGatewayInfo());
87 ans.setDistributed(this.getDistributed());
90 ans.setGatewayPortId(this.getGatewayPortId());
93 ans.setRoutes(this.getRoutes());
96 return super.extractField(field, ans);
102 public String toString() {
103 return "NeutronRouter [" + "id=" + uuid + ", name=" + name + ", adminStateUp=" + adminStateUp + ", status="
104 + status + ", tenantID=" + tenantID + ", external_gateway_info=" + externalGatewayInfo
105 + ", distributed=" + distributed + ", gw_port_id=" + gatewayPortId + ", routes=" + routes + "]";