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.Iterator;
12 import java.util.List;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
18 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
21 @XmlAccessorType(XmlAccessType.NONE)
22 public class NeutronSFCPortChain extends NeutronObject<NeutronSFCPortChain>
23 implements Serializable, INeutronObject<NeutronSFCPortChain> {
25 private static final long serialVersionUID = 1L;
27 // See OpenStack Networking SFC (networking-sfc) Port Chain API v1.0 Reference
28 // for description of annotated attributes
29 @XmlElement(name = "name")
32 @XmlElement(name = "port_pair_groups")
33 List<String> portPairGroupsUUID;
35 @XmlElement(name = "flow_classifiers")
36 List<String> flowClassifiersUUID;
38 @XmlElement(name = "chain_parameters")
39 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
40 Map<String, String> chainParameters;
42 public NeutronSFCPortChain() {
45 public String getName() {
49 public void setName(String name) {
53 public List<String> getPortPairGroupsUUID() {
54 return portPairGroupsUUID;
57 public void setPortPairGroupsUUID(List<String> portPairGroupsUUID) {
58 this.portPairGroupsUUID = portPairGroupsUUID;
61 public List<String> getFlowClassifiersUUID() {
62 return flowClassifiersUUID;
65 public void setFlowClassifiersUUID(List<String> flowClassifiersUUID) {
66 this.flowClassifiersUUID = flowClassifiersUUID;
69 public Map<String, String> getChainParameters() {
70 return chainParameters;
73 public void setChainParameters(Map<String, String> chainParameters) {
74 this.chainParameters = chainParameters;
78 * This method copies selected fields from the object and returns them
79 * as a new object, suitable for marshaling.
81 * @param fields List of attributes to be extracted
82 * @return an OpenStack Neutron SFC Port Chain object with only the selected fields
86 public NeutronSFCPortChain extractFields(List<String> fields) {
87 NeutronSFCPortChain ans = new NeutronSFCPortChain();
88 Iterator<String> i = fields.iterator();
92 ans.setID(this.getID());
94 if (s.equals("tenant_id")) {
95 ans.setTenantID(this.getTenantID());
97 if (s.equals("name")) {
98 ans.setName(this.getName());
100 if (s.equals("port_pair_groups")) {
101 ans.setPortPairGroupsUUID(this.getPortPairGroupsUUID());
103 if (s.equals("flow_classifiers")) {
104 ans.setFlowClassifiersUUID(this.getFlowClassifiersUUID());
106 if (s.equals("chain_parameters")) {
107 ans.setChainParameters(this.getChainParameters());
114 public String toString() {
115 return "NeutronSFCPortChain[" + "tenantID='" + tenantID + '\'' + ", name='" + name + '\''
116 + ", portPairGroupsUUID=" + portPairGroupsUUID + ", flowClassifiersUUID='" + flowClassifiersUUID + '\''
117 + ", chainParameters=" + chainParameters + ']';