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.io.Serializable;
11 import java.util.HashMap;
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;
17 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
20 @XmlAccessorType(XmlAccessType.NONE)
21 public final class NeutronSFCPortPair extends NeutronBaseAttributes<NeutronSFCPortPair> implements Serializable {
22 private static final long serialVersionUID = 1L;
24 // See OpenStack Networking SFC (networking-sfc) Port Pair API v1.0 Reference
25 // for description of annotated attributes
26 @XmlElement(name = "ingress")
27 String ingressPortUUID;
29 @XmlElement(name = "egress")
30 String egressPortUUID;
32 @XmlElement(name = "service_function_parameters")
33 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
34 Map<String, String> serviceFunctionParameters;
36 public NeutronSFCPortPair() {
39 public String getIngressPortUUID() {
40 return ingressPortUUID;
43 public void setIngressPortUUID(String ingressPortUUID) {
44 this.ingressPortUUID = ingressPortUUID;
47 public String getEgressPortUUID() {
48 return egressPortUUID;
51 public void setEgressPortUUID(String egressPortUUID) {
52 this.egressPortUUID = egressPortUUID;
55 public Map<String, String> getServiceFunctionParameters() {
56 return serviceFunctionParameters;
59 public void setServiceFunctionParameters(Map<String, String> serviceFunctionParameters) {
60 this.serviceFunctionParameters = serviceFunctionParameters;
64 protected boolean extractField(String field, NeutronSFCPortPair ans) {
67 ans.setIngressPortUUID(this.getIngressPortUUID());
70 ans.setEgressPortUUID(this.getEgressPortUUID());
72 case "service_function_parameters":
73 ans.setServiceFunctionParameters(new HashMap<>(this.getServiceFunctionParameters()));
76 return super.extractField(field, ans);
82 public String toString() {
83 return "NeutronSFCPortPair[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\'' + ", ingressPortUUID='"
84 + ingressPortUUID + '\'' + ", egressPortUUID='" + egressPortUUID + '\'' + ", serviceFunctionParameters="
85 + serviceFunctionParameters + ']';