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:
29 * vip_address IP address
31 * http://docs.openstack.org/api/openstack-network/2.0/openstack-network.pdf
35 @XmlAccessorType(XmlAccessType.NONE)
36 public final class NeutronLoadBalancer extends NeutronAdminAttributes<NeutronLoadBalancer> implements Serializable {
37 private static final long serialVersionUID = 1L;
39 @XmlElement(name = "vip_address")
40 String loadBalancerVipAddress;
42 @XmlElement(name = "vip_subnet_id")
43 String loadBalancerVipSubnetID;
45 public String getLoadBalancerVipAddress() {
46 return loadBalancerVipAddress;
49 public void setLoadBalancerVipAddress(String loadBalancerVipAddress) {
50 this.loadBalancerVipAddress = loadBalancerVipAddress;
53 public String getLoadBalancerVipSubnetID() {
54 return loadBalancerVipSubnetID;
57 public void setLoadBalancerVipSubnetID(String loadBalancerVipSubnetID) {
58 this.loadBalancerVipSubnetID = loadBalancerVipSubnetID;
61 public NeutronLoadBalancer extractFields(List<String> fields) {
62 NeutronLoadBalancer ans = new NeutronLoadBalancer();
63 for (String s : fields) {
65 if (s.equals("vip_address")) {
66 ans.setLoadBalancerVipAddress(this.getLoadBalancerVipAddress());
68 if (s.equals("vip_subnet_id")) {
69 ans.setLoadBalancerVipSubnetID(this.getLoadBalancerVipSubnetID());
76 public String toString() {
77 return "NeutronLoadBalancer{" + "loadBalancerID='" + uuid + '\'' + ", loadBalancerTenantID='" + tenantID + '\''
78 + ", loadBalancerName='" + name + '\'' + ", loadBalancerStatus='" + status
79 + '\'' + ", loadBalancerAdminStateUp='" + adminStateUp + '\'' + ", loadBalancerVipAddress='"
80 + loadBalancerVipAddress + '\'' + ", loadBalancerVipSubnetID='" + loadBalancerVipSubnetID + '\'' + '}';