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 NeutronSFCFlowClassifier extends NeutronBaseAttributes<NeutronSFCFlowClassifier> {
21 private static final long serialVersionUID = 1L;
23 // See OpenStack Networking SFC (networking-sfc) API v1.0 Reference for description of
24 // annotated attributes
25 @XmlElement(defaultValue = "IPv4", name = "ethertype")
28 @XmlElement(name = "protocol")
31 @XmlElement(name = "source_port_range_min")
32 Integer sourcePortRangeMin;
34 @XmlElement(name = "source_port_range_max")
35 Integer sourcePortRangeMax;
37 @XmlElement(name = "destination_port_range_min")
38 Integer destinationPortRangeMin;
40 @XmlElement(name = "destination_port_range_max")
41 Integer destinationPortRangeMax;
43 @XmlElement(name = "source_ip_prefix")
44 String sourceIpPrefix;
46 @XmlElement(name = "destination_ip_prefix")
47 String destinationIpPrefix;
49 @XmlElement(name = "logical_source_port")
50 String logicalSourcePortUUID;
52 @XmlElement(name = "logical_destination_port")
53 String logicalDestinationPortUUID;
55 @XmlElement(name = "l7_parameters")
56 @XmlJavaTypeAdapter(NeutronResourceMapPropertyAdapter.class)
57 Map<String, String> l7Parameters;
59 public NeutronSFCFlowClassifier() {
62 public String getEthertype() {
66 public void setEthertype(String ethertype) {
67 this.ethertype = ethertype;
70 public String getProtocol() {
74 public void setProtocol(String protocol) {
75 this.protocol = protocol;
78 public Integer getSourcePortRangeMin() {
79 return sourcePortRangeMin;
82 public void setSourcePortRangeMin(Integer sourcePortRangeMin) {
83 this.sourcePortRangeMin = sourcePortRangeMin;
86 public Integer getSourcePortRangeMax() {
87 return sourcePortRangeMax;
90 public void setSourcePortRangeMax(Integer sourcePortRangeMax) {
91 this.sourcePortRangeMax = sourcePortRangeMax;
94 public Integer getDestinationPortRangeMin() {
95 return destinationPortRangeMin;
98 public void setDestinationPortRangeMin(Integer destinationPortRangeMin) {
99 this.destinationPortRangeMin = destinationPortRangeMin;
102 public Integer getDestinationPortRangeMax() {
103 return destinationPortRangeMax;
106 public void setDestinationPortRangeMax(Integer destinationPortRangeMax) {
107 this.destinationPortRangeMax = destinationPortRangeMax;
110 public String getSourceIpPrefix() {
111 return sourceIpPrefix;
114 public void setSourceIpPrefix(String sourceIpPrefix) {
115 this.sourceIpPrefix = sourceIpPrefix;
118 public String getLogicalSourcePortUUID() {
119 return logicalSourcePortUUID;
122 public void setLogicalSourcePortUUID(String logicalSourcePortUUID) {
123 this.logicalSourcePortUUID = logicalSourcePortUUID;
126 public String getDestinationIpPrefix() {
127 return destinationIpPrefix;
130 public void setDestinationIpPrefix(String destinationIpPrefix) {
131 this.destinationIpPrefix = destinationIpPrefix;
134 public String getLogicalDestinationPortUUID() {
135 return logicalDestinationPortUUID;
138 public void setLogicalDestinationPortUUID(String logicalDestinationPortUUID) {
139 this.logicalDestinationPortUUID = logicalDestinationPortUUID;
142 public Map<String, String> getL7Parameters() {
146 public void setL7Parameters(Map<String, String> l7Parameters) {
147 this.l7Parameters = l7Parameters;
151 protected boolean extractField(String field, NeutronSFCFlowClassifier ans) {
154 ans.setEthertype(this.getEthertype());
156 case "source_port_range_min":
157 ans.setSourcePortRangeMin(this.getSourcePortRangeMin());
159 case "source_port_range_max":
160 ans.setSourcePortRangeMax(this.getSourcePortRangeMax());
162 case "destination_port_range_min":
163 ans.setDestinationPortRangeMin(this.getDestinationPortRangeMin());
165 case "destination_port_range_max":
166 ans.setDestinationPortRangeMax(this.getDestinationPortRangeMax());
168 case "source_ip_prefix":
169 ans.setSourceIpPrefix(this.getSourceIpPrefix());
171 case "destination_ip_prefix":
172 ans.setDestinationIpPrefix(this.getDestinationIpPrefix());
174 case "logical_source_port":
175 ans.setLogicalSourcePortUUID(this.getLogicalSourcePortUUID());
177 case "logical_destination_port":
178 ans.setLogicalDestinationPortUUID(this.getLogicalDestinationPortUUID());
180 case "l7_parameters":
181 ans.setL7Parameters(new HashMap<>(this.getL7Parameters()));
184 return super.extractField(field, ans);
190 public String toString() {
191 return "NeutronSFCFlowClassifier[" + "name='" + name + '\'' + ", ethertype='" + ethertype + '\''
192 + ", protocol='" + protocol + '\'' + ", sourcePortRangeMin=" + sourcePortRangeMin
193 + ", sourcePortRangeMax=" + sourcePortRangeMax + ", destinationPortRangeMin=" + destinationPortRangeMin
194 + ", destinationPortRangeMax=" + destinationPortRangeMax + ", sourceIpPrefix='" + sourceIpPrefix + '\''
195 + ", destinationIpPrefix='" + destinationIpPrefix + '\'' + ", logicalSourcePortUUID='"
196 + logicalSourcePortUUID + '\'' + ", logicalDestinationPortUUID='" + logicalDestinationPortUUID + '\''
197 + ", l7Parameters=" + l7Parameters + ']';