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.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;
17 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
20 @XmlAccessorType(XmlAccessType.NONE)
21 public final class NeutronSFCPortChain extends NeutronBaseAttributes<NeutronSFCPortChain> implements Serializable {
23 private static final long serialVersionUID = 1L;
25 // See OpenStack Networking SFC (networking-sfc) Port Chain API v1.0 Reference
26 // for description of annotated attributes
28 @XmlElement(name = "port_pair_groups")
29 List<String> portPairGroupsUUID;
31 @XmlElement(name = "flow_classifiers")
32 List<String> flowClassifiersUUID;
34 @XmlElement(name = "chain_parameters")
35 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
36 Map<String, String> chainParameters;
38 public NeutronSFCPortChain() {
41 public List<String> getPortPairGroupsUUID() {
42 return portPairGroupsUUID;
45 public void setPortPairGroupsUUID(List<String> portPairGroupsUUID) {
46 this.portPairGroupsUUID = portPairGroupsUUID;
49 public List<String> getFlowClassifiersUUID() {
50 return flowClassifiersUUID;
53 public void setFlowClassifiersUUID(List<String> flowClassifiersUUID) {
54 this.flowClassifiersUUID = flowClassifiersUUID;
57 public Map<String, String> getChainParameters() {
58 return chainParameters;
61 public void setChainParameters(Map<String, String> chainParameters) {
62 this.chainParameters = chainParameters;
66 * This method copies selected fields from the object and returns them
67 * as a new object, suitable for marshaling.
69 * @param fields List of attributes to be extracted
70 * @return an OpenStack Neutron SFC Port Chain object with only the selected fields
74 public NeutronSFCPortChain extractFields(List<String> fields) {
75 NeutronSFCPortChain ans = new NeutronSFCPortChain();
76 for (String s : fields) {
78 if (s.equals("port_pair_groups")) {
79 ans.setPortPairGroupsUUID(this.getPortPairGroupsUUID());
81 if (s.equals("flow_classifiers")) {
82 ans.setFlowClassifiersUUID(this.getFlowClassifiersUUID());
84 if (s.equals("chain_parameters")) {
85 ans.setChainParameters(this.getChainParameters());
92 public String toString() {
93 return "NeutronSFCPortChain[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\''
94 + ", portPairGroupsUUID=" + portPairGroupsUUID + ", flowClassifiersUUID='" + flowClassifiersUUID + '\''
95 + ", chainParameters=" + chainParameters + ']';