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 NeutronSFCFlowClassifier extends NeutronBaseAttributes<NeutronSFCFlowClassifier>
22 implements Serializable {
23 private static final long serialVersionUID = 1L;
25 // See OpenStack Networking SFC (networking-sfc) API v1.0 Reference for description of
26 // annotated attributes
27 @XmlElement(defaultValue = "IPv4", name = "ethertype")
30 @XmlElement(name = "protocol")
33 @XmlElement(name = "source_port_range_min")
34 Integer sourcePortRangeMin;
36 @XmlElement(name = "source_port_range_max")
37 Integer sourcePortRangeMax;
39 @XmlElement(name = "destination_port_range_min")
40 Integer destinationPortRangeMin;
42 @XmlElement(name = "destination_port_range_max")
43 Integer destinationPortRangeMax;
45 @XmlElement(name = "source_ip_prefix")
46 String sourceIpPrefix;
48 @XmlElement(name = "destination_ip_prefix")
49 String destinationIpPrefix;
51 @XmlElement(name = "logical_source_port")
52 String logicalSourcePortUUID;
54 @XmlElement(name = "logical_destination_port")
55 String logicalDestinationPortUUID;
57 @XmlElement(name = "l7_parameters")
58 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
59 Map<String, String> l7Parameters;
61 public NeutronSFCFlowClassifier() {
64 public String getEthertype() {
68 public void setEthertype(String ethertype) {
69 this.ethertype = ethertype;
72 public String getProtocol() {
76 public void setProtocol(String protocol) {
77 this.protocol = protocol;
80 public Integer getSourcePortRangeMin() {
81 return sourcePortRangeMin;
84 public void setSourcePortRangeMin(Integer sourcePortRangeMin) {
85 this.sourcePortRangeMin = sourcePortRangeMin;
88 public Integer getSourcePortRangeMax() {
89 return sourcePortRangeMax;
92 public void setSourcePortRangeMax(Integer sourcePortRangeMax) {
93 this.sourcePortRangeMax = sourcePortRangeMax;
96 public Integer getDestinationPortRangeMin() {
97 return destinationPortRangeMin;
100 public void setDestinationPortRangeMin(Integer destinationPortRangeMin) {
101 this.destinationPortRangeMin = destinationPortRangeMin;
104 public Integer getDestinationPortRangeMax() {
105 return destinationPortRangeMax;
108 public void setDestinationPortRangeMax(Integer destinationPortRangeMax) {
109 this.destinationPortRangeMax = destinationPortRangeMax;
112 public String getSourceIpPrefix() {
113 return sourceIpPrefix;
116 public void setSourceIpPrefix(String sourceIpPrefix) {
117 this.sourceIpPrefix = sourceIpPrefix;
120 public String getLogicalSourcePortUUID() {
121 return logicalSourcePortUUID;
124 public void setLogicalSourcePortUUID(String logicalSourcePortUUID) {
125 this.logicalSourcePortUUID = logicalSourcePortUUID;
128 public String getDestinationIpPrefix() {
129 return destinationIpPrefix;
132 public void setDestinationIpPrefix(String destinationIpPrefix) {
133 this.destinationIpPrefix = destinationIpPrefix;
136 public String getLogicalDestinationPortUUID() {
137 return logicalDestinationPortUUID;
140 public void setLogicalDestinationPortUUID(String logicalDestinationPortUUID) {
141 this.logicalDestinationPortUUID = logicalDestinationPortUUID;
144 public Map<String, String> getL7Parameters() {
148 public void setL7Parameters(Map<String, String> l7Parameters) {
149 this.l7Parameters = l7Parameters;
153 protected boolean extractField(String field, NeutronSFCFlowClassifier ans) {
156 ans.setEthertype(this.getEthertype());
158 case "source_port_range_min":
159 ans.setSourcePortRangeMin(this.getSourcePortRangeMin());
161 case "source_port_range_max":
162 ans.setSourcePortRangeMax(this.getSourcePortRangeMax());
164 case "destination_port_range_min":
165 ans.setDestinationPortRangeMin(this.getDestinationPortRangeMin());
167 case "destination_port_range_max":
168 ans.setDestinationPortRangeMax(this.getDestinationPortRangeMax());
170 case "source_ip_prefix":
171 ans.setSourceIpPrefix(this.getSourceIpPrefix());
173 case "destination_ip_prefix":
174 ans.setDestinationIpPrefix(this.getDestinationIpPrefix());
176 case "logical_source_port":
177 ans.setLogicalDestinationPortUUID(this.getLogicalDestinationPortUUID());
179 case "logical_destination_port":
180 ans.setLogicalDestinationPortUUID(this.getLogicalDestinationPortUUID());
182 case "l7_parameters":
183 ans.setL7Parameters(new HashMap<String, String>(this.getL7Parameters()));
186 return super.extractField(field, ans);
192 public String toString() {
193 return "NeutronSFCFlowClassifier[" + "name='" + name + '\'' + ", ethertype='" + ethertype + '\''
194 + ", protocol='" + protocol + '\'' + ", sourcePortRangeMin=" + sourcePortRangeMin
195 + ", sourcePortRangeMax=" + sourcePortRangeMax + ", destinationPortRangeMin=" + destinationPortRangeMin
196 + ", destinationPortRangeMax=" + destinationPortRangeMax + ", sourceIpPrefix='" + sourceIpPrefix + '\''
197 + ", destinationIpPrefix='" + destinationIpPrefix + '\'' + ", logicalSourcePortUUID='"
198 + logicalSourcePortUUID + '\'' + ", logicalDestinationPortUUID='" + logicalDestinationPortUUID + '\''
199 + ", l7Parameters=" + l7Parameters + ']';