2 * Copyright (C) 2014 Red Hat, Inc. 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 * OpenStack Neutron v2.0 Load Balancer as a service
20 * (LBaaS) bindings. See OpenStack Network API
21 * v2.0 Reference for description of the fields:
22 * Implemented fields are as follows:
28 * vip_address IP address
30 * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
34 @XmlAccessorType(XmlAccessType.NONE)
35 public final class NeutronLoadBalancer extends NeutronObject<NeutronLoadBalancer>
36 implements Serializable, INeutronObject<NeutronLoadBalancer> {
37 private static final long serialVersionUID = 1L;
39 @XmlElement(name = "name")
40 String loadBalancerName;
42 @XmlElement(name = "status")
43 String loadBalancerStatus;
45 @XmlElement(name = "admin_state_up")
46 Boolean loadBalancerAdminStateUp;
48 @XmlElement(name = "vip_address")
49 String loadBalancerVipAddress;
51 @XmlElement(name = "vip_subnet_id")
52 String loadBalancerVipSubnetID;
54 public String getLoadBalancerName() {
55 return loadBalancerName;
58 public void setLoadBalancerName(String loadBalancerName) {
59 this.loadBalancerName = loadBalancerName;
62 public String getLoadBalancerStatus() {
63 return loadBalancerStatus;
66 public void setLoadBalancerStatus(String loadBalancerStatus) {
67 this.loadBalancerStatus = loadBalancerStatus;
70 public Boolean getLoadBalancerAdminStateUp() {
71 return loadBalancerAdminStateUp;
74 public void setLoadBalancerAdminStateUp(Boolean loadBalancerAdminStateUp) {
75 this.loadBalancerAdminStateUp = loadBalancerAdminStateUp;
78 public String getLoadBalancerVipAddress() {
79 return loadBalancerVipAddress;
82 public void setLoadBalancerVipAddress(String loadBalancerVipAddress) {
83 this.loadBalancerVipAddress = loadBalancerVipAddress;
86 public String getLoadBalancerVipSubnetID() {
87 return loadBalancerVipSubnetID;
90 public void setLoadBalancerVipSubnetID(String loadBalancerVipSubnetID) {
91 this.loadBalancerVipSubnetID = loadBalancerVipSubnetID;
94 public NeutronLoadBalancer extractFields(List<String> fields) {
95 NeutronLoadBalancer ans = new NeutronLoadBalancer();
96 for (String s : fields) {
98 if (s.equals("name")) {
99 ans.setLoadBalancerName(this.getLoadBalancerName());
101 if (s.equals("vip_address")) {
102 ans.setLoadBalancerVipAddress(this.getLoadBalancerVipAddress());
104 if (s.equals("vip_subnet_id")) {
105 ans.setLoadBalancerVipSubnetID(this.getLoadBalancerVipSubnetID());
107 if (s.equals("status")) {
108 ans.setLoadBalancerStatus(this.getLoadBalancerStatus());
110 if (s.equals("admin_state_up")) {
111 ans.setLoadBalancerAdminStateUp(this.getLoadBalancerAdminStateUp());
118 public String toString() {
119 return "NeutronLoadBalancer{" + "loadBalancerID='" + uuid + '\'' + ", loadBalancerTenantID='" + tenantID + '\''
120 + ", loadBalancerName='" + loadBalancerName + '\'' + ", loadBalancerStatus='" + loadBalancerStatus
121 + '\'' + ", loadBalancerAdminStateUp='" + loadBalancerAdminStateUp + '\'' + ", loadBalancerVipAddress='"
122 + loadBalancerVipAddress + '\'' + ", loadBalancerVipSubnetID='" + loadBalancerVipSubnetID + '\'' + '}';