2 * Copyright (c) 2016 Brocade Communications Systems, Inc. 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
8 package org.opendaylight.neutron.spi;
10 import java.util.HashMap;
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;
16 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronSFCPortPair extends NeutronBaseAttributes<NeutronSFCPortPair> {
21 private static final long serialVersionUID = 1L;
23 // See OpenStack Networking SFC (networking-sfc) Port Pair API v1.0 Reference
24 // for description of annotated attributes
25 @XmlElement(name = "ingress")
26 String ingressPortUUID;
28 @XmlElement(name = "egress")
29 String egressPortUUID;
31 @XmlElement(name = "service_function_parameters")
32 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
33 Map<String, String> serviceFunctionParameters;
35 public NeutronSFCPortPair() {
38 public String getIngressPortUUID() {
39 return ingressPortUUID;
42 public void setIngressPortUUID(String ingressPortUUID) {
43 this.ingressPortUUID = ingressPortUUID;
46 public String getEgressPortUUID() {
47 return egressPortUUID;
50 public void setEgressPortUUID(String egressPortUUID) {
51 this.egressPortUUID = egressPortUUID;
54 public Map<String, String> getServiceFunctionParameters() {
55 return serviceFunctionParameters;
58 public void setServiceFunctionParameters(Map<String, String> serviceFunctionParameters) {
59 this.serviceFunctionParameters = serviceFunctionParameters;
63 protected boolean extractField(String field, NeutronSFCPortPair ans) {
66 ans.setIngressPortUUID(this.getIngressPortUUID());
69 ans.setEgressPortUUID(this.getEgressPortUUID());
71 case "service_function_parameters":
72 ans.setServiceFunctionParameters(new HashMap<>(this.getServiceFunctionParameters()));
75 return super.extractField(field, ans);
81 public String toString() {
82 return "NeutronSFCPortPair[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\'' + ", ingressPortUUID='"
83 + ingressPortUUID + '\'' + ", egressPortUUID='" + egressPortUUID + '\'' + ", serviceFunctionParameters="
84 + serviceFunctionParameters + ']';