import org.opendaylight.groupbasedpolicy.neutron.mapper.util.NeutronUtils;\r
import org.opendaylight.groupbasedpolicy.neutron.mapper.util.Utils;\r
import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf.EtherTypeClassifier;\r
-import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf.IpProtoClassifier;\r
-import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf.L4Classifier;\r
+import org.opendaylight.groupbasedpolicy.sf.classifiers.EtherTypeClassifierDefinition;\r
+import org.opendaylight.groupbasedpolicy.sf.classifiers.IpProtoClassifierDefinition;\r
+import org.opendaylight.groupbasedpolicy.sf.classifiers.L4ClassifierDefinition;\r
import org.opendaylight.neutron.spi.NeutronSecurityRule;\r
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierName;\r
Integer portMin = secRule.getSecurityRulePortMin();\r
Integer portMax = secRule.getSecurityRulePortMax();\r
if (portMin != null && portMax != null) {\r
- classifierBuilder.setClassifierDefinitionId(L4Classifier.DEFINITION.getId());\r
+ classifierBuilder.setClassifierDefinitionId(L4ClassifierDefinition.DEFINITION.getId());\r
if (portMin.equals(portMax)) {\r
- params.add(new ParameterValueBuilder().setName(new ParameterName(L4Classifier.DST_PORT_PARAM))\r
+ params.add(new ParameterValueBuilder().setName(new ParameterName(L4ClassifierDefinition.DST_PORT_PARAM))\r
.setIntValue(portMin.longValue())\r
.build());\r
} else {\r
- params.add(new ParameterValueBuilder().setName(new ParameterName(L4Classifier.DST_PORT_RANGE_PARAM))\r
+ params.add(new ParameterValueBuilder().setName(new ParameterName(L4ClassifierDefinition.DST_PORT_RANGE_PARAM))\r
.setRangeValue(\r
new RangeValueBuilder().setMin(portMin.longValue()).setMax(portMax.longValue()).build())\r
.build());\r
Long protocol = getProtocol(secRule);\r
if (protocol != null) {\r
if (classifierBuilder.getClassifierDefinitionId() == null) {\r
- classifierBuilder.setClassifierDefinitionId(IpProtoClassifier.DEFINITION.getId());\r
+ classifierBuilder.setClassifierDefinitionId(IpProtoClassifierDefinition.DEFINITION.getId());\r
}\r
- params.add(new ParameterValueBuilder().setName(new ParameterName(IpProtoClassifier.PROTO_PARAM))\r
+ params.add(new ParameterValueBuilder().setName(new ParameterName(IpProtoClassifierDefinition.PROTO_PARAM))\r
.setIntValue(protocol)\r
.build());\r
}\r
Long ethertype = getEtherType(secRule);\r
if (ethertype != null) {\r
if (classifierBuilder.getClassifierDefinitionId() == null) {\r
- classifierBuilder.setClassifierDefinitionId(EtherTypeClassifier.DEFINITION.getId());\r
+ classifierBuilder.setClassifierDefinitionId(EtherTypeClassifierDefinition.DEFINITION.getId());\r
}\r
- params.add(new ParameterValueBuilder().setName(new ParameterName(EtherTypeClassifier.ETHERTYPE_PARAM))\r
+ params.add(new ParameterValueBuilder().setName(new ParameterName(EtherTypeClassifierDefinition.ETHERTYPE_PARAM))\r
.setIntValue(ethertype)\r
.build());\r
}\r
/**\r
* @param secRule\r
* @return {@code null} if {@link NeutronSecurityRule#getSecurityRuleEthertype()} is null or\r
- * empty; value of {@link EtherTypeClassifier#IPv4_VALUE} or\r
- * {@link EtherTypeClassifier#IPv6_VALUE}\r
+ * empty; value of {@link EtherTypeClassifierDefinition#IPv4_VALUE} or\r
+ * {@link EtherTypeClassifierDefinition#IPv6_VALUE}\r
* @throws IllegalArgumentException if return value of\r
* {@link NeutronSecurityRule#getSecurityRuleEthertype()} is not empty/null and is other\r
* than "IPv4" or "IPv6"\r
return null;\r
}\r
if (NeutronUtils.IPv4.equals(ethertype)) {\r
- return EtherTypeClassifier.IPv4_VALUE;\r
+ return EtherTypeClassifierDefinition.IPv4_VALUE;\r
}\r
if (NeutronUtils.IPv6.equals(ethertype)) {\r
- return EtherTypeClassifier.IPv6_VALUE;\r
+ return EtherTypeClassifierDefinition.IPv6_VALUE;\r
}\r
throw new IllegalArgumentException("Ethertype " + ethertype + " is not supported.");\r
}\r
return null;\r
}\r
if (NeutronUtils.TCP.equals(protocol)) {\r
- return IpProtoClassifier.TCP_VALUE;\r
+ return IpProtoClassifierDefinition.TCP_VALUE;\r
}\r
if (NeutronUtils.UDP.equals(protocol)) {\r
- return IpProtoClassifier.UDP_VALUE;\r
+ return IpProtoClassifierDefinition.UDP_VALUE;\r
}\r
if (NeutronUtils.ICMP.equals(protocol)) {\r
- return IpProtoClassifier.ICMP_VALUE;\r
+ return IpProtoClassifierDefinition.ICMP_VALUE;\r
}\r
throw new IllegalArgumentException("Protocol " + protocol + " is not supported.");\r
}\r
-\r
}\r