Fix checkstyle violations in openflowplugin extensions 94/67794/5
authorTom Pantelis <tompantelis@gmail.com>
Wed, 31 Jan 2018 18:24:10 +0000 (13:24 -0500)
committerAnil Vishnoi <vishnoianil@gmail.com>
Thu, 15 Feb 2018 10:29:54 +0000 (10:29 +0000)
Change-Id: I6c2404ee9e0e30efab156a621bd7e641a78af972
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
146 files changed:
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/AugmentTuple.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/BundleMessageDataInjector.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConverterExtensionKey.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConverterMessageToOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConvertorActionFromOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConvertorActionToOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConvertorFromOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConvertorMessageFromOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ConvertorToOFJava.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ExtensionAugment.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ExtensionConverterProviderKeeper.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/ExtensionConverterRegistrator.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/GroupingLooseResolver.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/GroupingResolver.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/OpenFlowPluginExtensionRegistratorProvider.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/TypeVersionKey.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/core/extension/ExtensionConverterManager.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/core/extension/ExtensionConverterProvider.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/core/session/ExtensionSessionManager.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/exception/ConversionException.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/exception/ConverterNotFoundException.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/ActionPath.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/AugmentationPath.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/MatchPath.java
extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/MessagePath.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/ConverterExtensionActionKeyTest.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/ConverterExtensionMatchKeyTest.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/GroupingLooseResolverTest.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/GroupingResolverTest.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/SetFieldExtensionTest.java
extension/openflowplugin-extension-api/src/test/java/org/opendaylight/openflowplugin/extension/api/TypeVersionKeyTest.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProvider.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/CodecPreconditionException.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/IpConverter.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ActionUtil.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ConntrackConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/FinTimeoutConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/LearnConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/LearnConvertorUtil.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/MultipathConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/OutputRegConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/PopNshConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/PushNshConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoadConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegMoveConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ResubmitConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpOpConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpShaConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpThaConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpTpaConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/CtMarkConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/CtStateConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/CtZoneConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EncapEthDstConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EncapEthSrcConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EncapEthTypeConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthDstConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthSrcConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthTypeConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/MatchUtil.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NshMdtypeConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NshNpConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc1Convertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc2Convertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc3Convertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc4Convertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NsiConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NxmInPortConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/RegConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TcpDstConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TcpSrcConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunGpeNpConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIPv4DstConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIPv4SrcConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIdConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/UdpDstConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/UdpSrcConvertor.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProviderTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/IpConverterTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/MatchUtilTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ConntrackConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/FinTimeoutConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/MultipathConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/OutputRegConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoadConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegMoveConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/ResubmitConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpOpConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpShaConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpSpaConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpThaConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/ArpTpaConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/CtStateConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/CtZoneConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthDstConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthSrcConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/EthTypeConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc1ConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc2ConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc3ConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/Nshc4ConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NsiConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/NspConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TcpDstConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TcpSrcConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIPv4DstConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIPv4SrcConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/TunIdConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/UdpDstConvertorTest.java
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/match/UdpSrcConvertorTest.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/OnfConstants.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/OnfExtensionProvider.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleAddMessageConverter.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleControlConverter.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/deserializer/BundleControlFactory.java
extension/openflowplugin-extension-onf/src/main/java/org/opendaylight/openflowplugin/extension/onf/serializer/AbstractBundleMessageFactory.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/ByteBufUtils.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleAddMessageConverterTest.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/converter/BundleControlConverterTest.java
extension/openflowplugin-extension-onf/src/test/java/org/opendaylight/openflowplugin/extension/onf/serializer/BundleControlFactoryTest.java
extension/test-extension/src/main/java/org/opendaylight/openflowplugin/extension/test/Test.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/common/MultipartReplyTranslatorUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/action/SetFieldActionDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/FlowMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/GroupMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/messages/PacketInMessageDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyFlowStatsDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyGroupDescDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyTableFeaturesDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/util/InstructionUtil.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/FlowStatisticsToNotificationTransformer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/multilayer/FlowDirectStatisticsService.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/translator/PacketReceivedTranslator.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/ApplyActionsInstructionDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/instruction/WriteActionsInstructionDeserializerTest.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/AbstractMatchEntryDeserializerTest.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/extension/MatchExtensionHelper.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/GroupDescStatsResponseConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flow/FlowInstructionResponseConvertor.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/flow/FlowStatsResponseConvertor.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/extension/ActionExtensionHelperTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/extension/MatchExtensionHelperTest.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionConvertorV10Test.java
openflowplugin/src/test/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/action/ActionConvertorV13Test.java

index b3048827533066656d8434a7d733cb5870884039..9caebf8e9e70e62f3aef71366d26478871427825 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,7 +11,8 @@ import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
- * Wrapper over augmentation and it's type in order to ease handing over and hooking of an augmentation 
+ * Wrapper over augmentation and it's type in order to ease handing over and hooking of an augmentation.
+ *
  * @param <E> augmentable type where wrapped augmentation belongs
  */
 public class AugmentTuple<E extends Augmentable<E>> {
@@ -19,24 +20,20 @@ public class AugmentTuple<E extends Augmentable<E>> {
     private final Augmentation<E> augmentationObject;
     private final Class<? extends Augmentation<E>> augmentationClass;
 
-    /**
-     * @param augmentationClass
-     * @param augmentationObject
-     */
     public AugmentTuple(Class<? extends Augmentation<E>> augmentationClass, Augmentation<E> augmentationObject) {
         this.augmentationClass = augmentationClass;
         this.augmentationObject = augmentationObject;
     }
 
     /**
-     * @return instance of wrapped augmentation
+     * Returns the instance of wrapped augmentation.
      */
     public Augmentation<E> getAugmentationObject() {
         return augmentationObject;
     }
 
     /**
-     * @return type of wrapped augmentation
+     * Returns the type of wrapped augmentation.
      */
     public Class<? extends Augmentation<E>> getAugmentationClass() {
         return augmentationClass;
index 0444b74122ebc51c999b0096525a96c3db8eeda3..99f465e1a4b9033f54ae724171b9953bf1147c21 100644 (file)
@@ -11,19 +11,20 @@ package org.opendaylight.openflowplugin.extension.api;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 
 /**
- * Interface for bundle data injection
+ * Interface for bundle data injection.
  */
 public interface BundleMessageDataInjector {
     /**
-     * Set xid
+     * Set xid.
+     *
      * @param xid request id
      */
     void setXid(long xid);
 
     /**
-     * Set node id
+     * Set node id.
+     *
      * @param node node id
      */
     void setNode(NodeRef node);
-
 }
index 5be272a935ecb364d4158725f6a215fb57a67fa4..b946a8ebd1dba5753fb5908a2d44e78ce9a4e6c5 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.openflowplugin.extension.api;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
 
 /**
- * lookup and register key for extension converters, basic case expects this to
- * correlate with input model type
+ * Lookup and register key for extension converters, basic case expects this to
+ * correlate with input model type.
  *
  * @param <T> type of key
  */
index df237d18db47f4f04967cffd3b5f6c67388b4803..98dfd271a6c3ff7f3bc75844b9387cd0e2be8dd9 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from MD-SAL model into OFJava-API model
+ * Convert message from MD-SAL model into OFJava-API model.
  *
  * @param <F> input message model - MD-SAL model
  * @param <T> output message model - OFJava-API
@@ -21,18 +21,20 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 public interface ConverterMessageToOFJava<F extends ExperimenterMessageOfChoice, T extends DataContainer> {
 
     /**
+     * Converts a message to MD-SAL model.
+     *
      * @param experimenterMessageCase where is vendor's augmentation
      * @return message converted to OFJava-API
      */
     T convert(F experimenterMessageCase) throws ConversionException;
 
     /**
-     * @return corresponding experimenter id (vendor id)
+     * Returns the corresponding experimenter id (vendor id).
      */
     ExperimenterId getExperimenterId();
 
     /**
-     * @return corresponding experimenter message type
+     * Returns the corresponding experimenter message type.
      */
     long getType();
 }
index 063c31cfd333c2f493b2507c0a25ec433cb35c27..711ad3c43ee744fabcf8319a7d5f6f4e80bcfbaf 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -12,15 +12,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from OFJava-API model into MD-SAL model
- * 
+ * Convert action from OFJava-API model into MD-SAL model.
+ *
  * @param <F> input message model - OFJava-API
  * @param <P> represents possible paths in yang schema for augmentations
  */
 public interface ConvertorActionFromOFJava<F extends DataContainer, P extends AugmentationPath> {
 
     /**
-     * @param input
+     * Convert MD-SAL model to OF action.
+     *
+     * @param input the MD-SAL container
      * @param path in yang schema where a converted value has to be augmented
      * @return message converted to MD-SAL and its type
      */
index ffc9d0913ed69ef5fe49db62c32dfa0896b044e6..c182feca4e6973ef8d28e9b8d1505d5987ff32e7 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,13 +11,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from MD-SAL model into OFJava-API model
- * @param <F> input message model - MD-SAL model 
+ * Convert action from MD-SAL model into OFJava-API model.
+ *
+ * @param <F> input message model - MD-SAL model
  * @param <T> output message model - OFJava-API
  */
 public interface ConvertorActionToOFJava<F extends Action, T extends DataContainer> {
 
     /**
+     * Convert OF action MD-SAL model.
+     *
      * @param actionCase where is vendor's augmentation
      * @return message converted to OFJava-API
      */
index 887648a535c1199c9ac54490f85e554a2be0bf82..0e3ba29c124c4cabecaab6950d072b282bdbd952 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -13,15 +13,17 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from OFJava-API model into MD-SAL model
- * 
+ * Convert message from OFJava-API model into MD-SAL model.
+ *
  * @param <F> input message model - OFJava-API
  * @param <P> represents possible paths in yang schema for augmentations
  */
 public interface ConvertorFromOFJava<F extends DataContainer, P extends AugmentationPath> {
 
     /**
-     * @param input
+     * Convert OF model to MD-SAL model.
+     *
+     * @param input OF model
      * @param path in yang schema where a converted value has to be augmented
      * @return message converted to MD-SAL and its type
      */
index 1d1dbddac940c11d170c6aa99c371e76f14436aa..0442cba27fe77595a33c9b00a5f91088640c2050 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from OFJava-API model into MD-SAL model
+ * Convert message from OFJava-API model into MD-SAL model.
  *
  * @param <F> input message model - OFJava-API
  * @param <P> represents possible paths in yang schema for augmentations
@@ -21,7 +21,9 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 public interface ConvertorMessageFromOFJava<F extends DataContainer, P extends AugmentationPath> {
 
     /**
-     * @param input
+     * Convert OF model to MD-SAL model.
+     *
+     * @param input OF model
      * @param path  in yang schema where a converted value has to be augmented
      * @return message converted to MD-SAL and its type
      */
index b114a03085f17138b3051bfa3fcbdb4cba3ea0b0..055b1ca237569a099321bc241e0753bfeabc83f4 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,13 +11,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * convert message from MD-SAL model into OFJava-API model
- * 
+ * Convert message from MD-SAL model into OFJava-API model.
+ *
  * @param <T> output message model - OFJava-API
  */
 public interface ConvertorToOFJava<T extends DataContainer> {
 
     /**
+     * Convert MD-SAL model to OF model.
+     *
      * @param extension where is vendor's augmentation
      * @return message converted to OFJava-API
      */
index e41146f843be5563b4e42549f32b9e41a84a7296..8fc72afc74140c0e10718409a54d7abc69c5a015 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -12,28 +12,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Extension augmentation.
+ *
  * @author msunal
  * @param <T> type of wrapped augmentation
- *
  */
 public class ExtensionAugment<T extends Augmentation<Extension>> extends AugmentTuple<Extension> {
 
     private final Class<? extends ExtensionKey> key;
 
-    /**
-     * @param augmentationClass
-     * @param augmentationObject
-     */
     public ExtensionAugment(Class<T> augmentationClass, T augmentationObject, Class<? extends ExtensionKey> key) {
         super(augmentationClass, augmentationObject);
         this.key = key;
     }
 
     /**
-     * @return key which represents an extension type
+     * Returns the key which represents an extension type.
      */
     public Class<? extends ExtensionKey> getKey() {
         return key;
     }
-
 }
index 37d97aa57093195efe3927707ca0bcba4c040cf5..e18950ffe48fb890bfc29d2332df3f008b5f854e 100644 (file)
@@ -14,13 +14,17 @@ import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionCon
  * Simple {@link ExtensionConverterProvider} place holder.
  */
 public interface ExtensionConverterProviderKeeper {
+
     /**
-     * @param extensionConverterProvider here extension converters will be kept in order to be accessible by inner infrastructure
+     * Sets the ExtensionConverterProvider. Extension converters will be kept in order to be accessible by inner
+     * infrastructure.
+     *
+     * @param extensionConverterProvider the ExtensionConverterProvider
      */
     void setExtensionConverterProvider(ExtensionConverterProvider extensionConverterProvider);
 
     /**
-     * @return extension converters registry access point for by inner infrastructure
+     * Returns the extension converters registry access point for by inner infrastructure.
      */
     ExtensionConverterProvider getExtensionConverterProvider();
 }
index 23fa466d5043e921d214ce0e15a4483237cddb37..928b99e5fd755823f38781c043558dae2887f500 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
- * registration place for message converters provided by vendor extension
+ * Registry for message converters provided by vendor extension.
  */
 public interface ExtensionConverterRegistrator {
 
@@ -37,36 +37,47 @@ public interface ExtensionConverterRegistrator {
             ConvertorFromOFJava<MatchEntry, MatchPath> convertor);
 
     /**
-     * @param key       action case type + ofp-version
-     * @param convertor
+     * Registers an action converter.
+     *
+     * @param key action case type + ofp-version
+     * @param converter the converter
      * @return closable registration
      */
-    ObjectRegistration<ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>>
-    registerActionConvertor(
-            TypeVersionKey<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> key,
-            ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action> convertor);
+    ObjectRegistration<ConvertorActionToOFJava<
+        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>>
+            registerActionConvertor(TypeVersionKey<? extends
+                org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action> key,
+                ConvertorActionToOFJava<
+                    org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+                    Action> converter);
 
     /**
-     * @param key       actionSubType, action type (Experimenter), experimenterId, version
-     * @param convertor
+     * Registers an action converter.
+     *
+     * @param key actionSubType, action type (Experimenter), experimenterId, version
+     * @param converter the converter
      * @return closable registration
      */
     ObjectRegistration<ConvertorActionFromOFJava<Action, ActionPath>> registerActionConvertor(
-            ActionSerializerKey<?> key, ConvertorActionFromOFJava<Action, ActionPath> convertor);
+            ActionSerializerKey<?> key, ConvertorActionFromOFJava<Action, ActionPath> converter);
 
     /**
-     * @param key       consists of: experimenter type, version
-     * @param convertor TO OFJava (suitable for both: symmetric and multipart)
+     * Registers a message converter.
+     *
+     * @param key consists of: experimenter type, version
+     * @param converter TO OFJava (suitable for both: symmetric and multipart)
      * @return closeable registration
      */
-    <I extends ExperimenterMessageOfChoice, O extends DataContainer> ObjectRegistration<ConverterMessageToOFJava<I, O>> registerMessageConvertor(
-            TypeVersionKey<I> key, ConverterMessageToOFJava<I, O> convertor);
+    <I extends ExperimenterMessageOfChoice, O extends DataContainer> ObjectRegistration<ConverterMessageToOFJava<I, O>>
+        registerMessageConvertor(TypeVersionKey<I> key, ConverterMessageToOFJava<I, O> converter);
 
     /**
-     * @param key       consists of: experimenter type, version
-     * @param convertor FROM OFJava (suitable for both: symmetric and multipart)
+     * Registers a message converter.
+     *
+     * @param key consists of: experimenter type, version
+     * @param converter FROM OFJava (suitable for both: symmetric and multipart)
      * @return closeable registration
      */
-    <I extends ExperimenterDataOfChoice> ObjectRegistration<ConvertorMessageFromOFJava<I, MessagePath>> registerMessageConvertor(
-            MessageTypeKey<?> key, ConvertorMessageFromOFJava<I, MessagePath> convertor);
+    <I extends ExperimenterDataOfChoice> ObjectRegistration<ConvertorMessageFromOFJava<I, MessagePath>>
+        registerMessageConvertor(MessageTypeKey<?> key, ConvertorMessageFromOFJava<I, MessagePath> converter);
 }
index 0d12c8f86d25e1febb9b206b600baa12ea5285b8..afa239257d1809d91bf17bb59e9c95bb5fcbb040 100644 (file)
@@ -27,10 +27,12 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
  */
 public class GroupingLooseResolver<G> {
 
-    private Class<G> commonInterface;
-    private Set<Class<? extends Augmentation<?>>> classes;
+    private final Class<G> commonInterface;
+    private final Set<Class<? extends Augmentation<?>>> classes;
 
     /**
+     * Constructor.
+     *
      * @param commonInterface common interface
      */
     public GroupingLooseResolver(Class<G> commonInterface) {
@@ -39,7 +41,8 @@ public class GroupingLooseResolver<G> {
     }
 
     /**
-     * Get augmentation classes
+     * Get augmentation classes.
+     *
      * @return list of augmentation classes
      */
     public Set<Class<? extends Augmentation<?>>> getClasses() {
@@ -47,6 +50,8 @@ public class GroupingLooseResolver<G> {
     }
 
     /**
+     * Adds an augmentation class.
+     *
      * @param cls equivalent augmentation class
      * @return this for chaining
      */
@@ -58,6 +63,8 @@ public class GroupingLooseResolver<G> {
     }
 
     /**
+     * Gets the extension for the give data.
+     *
      * @param data expected to match <tt>&lt;T extends Augmentable&lt;T&gt;&gt;</tt>
      * @return shared grouping
      */
@@ -75,5 +82,4 @@ public class GroupingLooseResolver<G> {
 
         return Optional.empty();
     }
-
 }
index c360637d3ce47c31baf57903c1a31496eaad619f..f4d379d437f71909d1ddcf3b63681320d2441472 100644 (file)
@@ -1,46 +1,43 @@
-/**
+/*
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 package org.opendaylight.openflowplugin.extension.api;
 
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import java.util.HashSet;
 import java.util.Set;
-
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
 /**
  * Provides augmentation resolving upon given {@link Augmentable}.
  * Used {@link #classes} share the same {@link Augmentable}.
  * <br>
  * <b>Usage:</b> in case there is {@link Augmentable} which might contain
- * multiple {@link Augmentation}s depending on origin. And those {@link Augmentation}s 
+ * multiple {@link Augmentation}s depending on origin. And those {@link Augmentation}s
  * are sharing the same grouping so that they could be processed in the same way.
- * 
+ *
  * @param <G> grouping
- * @param <T>
+ * @param <T> Augmentable
  */
 public class GroupingResolver<G, T extends Augmentable<T>> {
 
     Class<G> commonInterface;
     Set<Class<? extends Augmentation<T>>> classes;
 
-    /**
-     * @param commonInterface
-     */
     public GroupingResolver(Class<G> commonInterface) {
         this.commonInterface = commonInterface;
         classes = new HashSet<>();
     }
 
     /**
+     * Adds an augmentation class.
+     *
      * @param cls equivalent augmentation class
      * @return this for chaining
      */
@@ -51,6 +48,8 @@ public class GroupingResolver<G, T extends Augmentable<T>> {
     }
 
     /**
+     * Sets the augmentation classes.
+     *
      * @param clses set of equivalent augmentation classes
      */
     public void setAugmentations(Set<Class<? extends Augmentation<T>>> clses) {
@@ -61,7 +60,9 @@ public class GroupingResolver<G, T extends Augmentable<T>> {
     }
 
     /**
-     * @param data
+     * Gets the extension for the given data.
+     *
+     * @param data data
      * @return shared grouping
      */
     @SuppressWarnings("unchecked")
index 74d5c76380367d3ff536b634a9bc2a215811ec2e..573e95d5f19bebc6c658b8d4d83f10215832ed17 100644 (file)
@@ -12,9 +12,10 @@ package org.opendaylight.openflowplugin.extension.api;
  * Created by mirehak on 4/25/15.
  */
 public interface OpenFlowPluginExtensionRegistratorProvider {
+
     /**
-     * @return the extensionConverterRegistry - here extension converters can be registered in order to support
-     * vendor messages
+     * Returns the extensionConverterRegistry - here extension converters can be registered in order to support
+     * vendor messages.
      */
     ExtensionConverterRegistrator getExtensionConverterRegistrator();
 }
index 5f602b3dab495cb03214e4c1ded7c2596d3f7452..154d982899b59ce8872386b6deeaa77db41f30e1 100644 (file)
@@ -9,8 +9,8 @@ package org.opendaylight.openflowplugin.extension.api;
 
 
 /**
- * lookup and register key for extension converters, basic case expects this to
- * correlate with input model type
+ * Lookup and register key for extension converters, basic case expects this to
+ * correlate with input model type.
  *
  * @param <T> type of key
  */
@@ -25,7 +25,7 @@ public class TypeVersionKey<T> {
     }
 
     /**
-     * @return key type
+     * Returns the key type.
      */
     public Class<? extends T> getType() {
         return type;
@@ -69,5 +69,4 @@ public class TypeVersionKey<T> {
     public String toString() {
         return getClass().getSimpleName() + " [type=" + type + ", ofVersion=" + ofVersion + "]";
     }
-
 }
index b9ec32740934c729a5b2149bd50516e4246b3b2e..c068fe51715fca1f7992bc9330eb533c5ac33519 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.openflowplugin.extension.api.core.extension;
 import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator;
 
 /**
- * unifying interface
+ * Unifying interface.
  */
 public interface ExtensionConverterManager extends ExtensionConverterProvider, ExtensionConverterRegistrator {
     // see parents
index d3d1617b4cdb9c0cc6a2cbe6077b4a378a8d0531..2d6428f9242f33851a9c1a55b3940ac57d55d919 100644 (file)
@@ -9,11 +9,11 @@ package org.opendaylight.openflowplugin.extension.api.core.extension;
 
 import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey;
+import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
-import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava;
 import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
 import org.opendaylight.openflowplugin.extension.api.path.AugmentationPath;
@@ -24,46 +24,54 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 public interface ExtensionConverterProvider {
 
     /**
-     * lookup converter
-     * @param key
+     * Lookup converter.
+     *
+     * @param key the message type key
      * @return found converter
      */
     <F extends DataContainer, P extends AugmentationPath> ConvertorFromOFJava<F, P> getConverter(MessageTypeKey<?> key);
 
     /**
-     * lookup converter
-     * @param key
+     * Lookup converter.
+     *
+     * @param key the converter extension key
      * @return found converter
      */
     <T extends DataContainer> ConvertorToOFJava<T> getConverter(ConverterExtensionKey<?> key);
 
     /**
-     * @param key
+     * Lookup converter.
+     *
+     * @param key the type version key
      * @return found converter
      */
     <F extends Action, T extends DataContainer> ConvertorActionToOFJava<F, T> getConverter(TypeVersionKey<F> key);
 
     /**
-     * lookup converter<br>
-     * TODO: this method should be compatible with {@link #getConverter(MessageTypeKey)} after matches are migrated to similar structure
-     * @param key
+     * Lookup converter.
+     * TODO: this method should be compatible with {@link #getConverter(MessageTypeKey)} after matches are migrated
+     * to similar structure
+     * @param key the message type key
      * @return found converter
      */
-    <F extends DataContainer, P extends AugmentationPath> ConvertorActionFromOFJava<F, P> getActionConverter(MessageTypeKey<?> key);
+    <F extends DataContainer, P extends AugmentationPath> ConvertorActionFromOFJava<F, P> getActionConverter(
+            MessageTypeKey<?> key);
 
     /**
-     * lookup converter for experimenter message
+     * Lookup converter for experimenter message.
      *
-     * @param key
+     * @param key the type version key
      * @return found converter
      */
-    <F extends ExperimenterMessageOfChoice, T extends DataContainer> ConverterMessageToOFJava<F, T> getMessageConverter(TypeVersionKey<F> key);
+    <F extends ExperimenterMessageOfChoice, T extends DataContainer> ConverterMessageToOFJava<F, T> getMessageConverter(
+            TypeVersionKey<F> key);
 
     /**
-     * lookup converter for experimenter message
+     * Lookup converter for experimenter message.
      *
-     * @param key
+     * @param key the message type key
      * @return found converter
      */
-    <F extends DataContainer, P extends AugmentationPath> ConvertorMessageFromOFJava<F, P> getMessageConverter(MessageTypeKey<?> key);
+    <F extends DataContainer, P extends AugmentationPath> ConvertorMessageFromOFJava<F, P> getMessageConverter(
+            MessageTypeKey<?> key);
 }
index ec0261c184e04345178b004a8bda411621363129..3df8dbc5be27d6bc5de67e4ed3095a5e644b84fe 100644 (file)
@@ -13,13 +13,14 @@ import org.opendaylight.openflowplugin.extension.api.core.extension.ExtensionCon
 public interface ExtensionSessionManager {
 
     /**
+     * Sets the ExtensionConverterProvider.
+     *
      * @param extensionConverterProvider extension converter provider
      */
     void setExtensionConverterProvider(ExtensionConverterProvider extensionConverterProvider);
 
     /**
-     * @return extensionConverterProvider
+     * Returns the ExtensionConverterProvider.
      */
     ExtensionConverterProvider getExtensionConverterProvider();
-
 }
index 634cf8f7fe26dfca9171b13c8c7ab99cbe6932ee..a704c3a2291b55f6012055c43776255800d102ed 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.openflowplugin.extension.api.exception;
 
 /**
- * General exception for conversion related operations
+ * General exception for conversion related operations.
  */
 public class ConversionException extends Exception {
     public ConversionException(String message) {
index 320dbd4135d51ca4a18303b752b857aae6fd3a82..fa55f75b40a3ccc8ee4f007dd6a63ddb76fb4881 100644 (file)
@@ -9,7 +9,7 @@
 package org.opendaylight.openflowplugin.extension.api.exception;
 
 /**
- * For case when converter is not available
+ * For case when converter is not available.
  */
 public class ConverterNotFoundException extends ConversionException {
 
index 056592a4890b3b0fb9305251bbba6d87636bb0c4..b2b442040673cbd17d4b67a26dbae3bc1ebf5176 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,8 +11,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * @author msunal
+ * Enumerates the extension action paths.
  *
+ * @author msunal
  */
 public enum ActionPath implements AugmentationPath {
 
@@ -33,7 +34,8 @@ public enum ActionPath implements AugmentationPath {
      *          |  |  |        |        +--rw (action)?
      * </pre>
 Â Â Â Â  */
-    NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION(null),
+    INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
@@ -49,16 +51,17 @@ public enum ActionPath implements AugmentationPath {
      *          |  |  |        |  +--rw flownode:apply-actions
      *          |  |  |        |     +--rw flownode:action* [order]
      *          |  |  |        |        +--rw (action)?
-     * 
+     *
      * </pre>
 Â Â Â Â  */
-    NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION(null),
+    INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
      * module: opendaylight-flow-statistics
      * notifications:
-     *    +---n flows-statistics-update             
+     *    +---n flows-statistics-update
      *    |  +--ro flow-and-statistics-map-list* [flow-id]
      *    |  |  +--ro instructions
      *    |  |  |  +--ro instruction* [order]
@@ -69,13 +72,14 @@ public enum ActionPath implements AugmentationPath {
      *    |  |  |        |        +--ro (action)?
      * </pre>
      */
-    FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION(null),
+    FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
      * module: opendaylight-flow-statistics
      * notifications:
-     *    +---n flows-statistics-update             
+     *    +---n flows-statistics-update
      *    |  +--ro flow-and-statistics-map-list* [flow-id]
      *    |  |  +--ro instructions
      *    |  |  |  +--ro instruction* [order]
@@ -86,13 +90,14 @@ public enum ActionPath implements AugmentationPath {
      *    |  |  |        |        +--ro (action)?
      * </pre>
      */
-    FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION(null),
+    FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
      * module: opendaylight-group-statistics
      * notifications:
-     *    +---n group-desc-stats-updated    
+     *    +---n group-desc-stats-updated
      *    |  +--ro group-desc-stats* [group-id]
      *    |  |  +--ro buckets
      *    |  |     +--ro bucket* [bucket-id]
@@ -100,7 +105,8 @@ public enum ActionPath implements AugmentationPath {
      *    |  |           +--ro (action)?
      * </pre>
      */
-    GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION(null),
+    GROUP_DESC_STATS_UPDATED_BUCKET_ACTION(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
@@ -117,7 +123,8 @@ public enum ActionPath implements AugmentationPath {
      *    |  |  |        |        +--ro (action)?
      * </pre>
      */
-    RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION(null),
+    FLOWS_STATISTICS_RPC_WRITE_ACTIONS(null),
+
     /**
      * openflowplugin-extension-general.yang
      * <pre>
@@ -134,11 +141,11 @@ public enum ActionPath implements AugmentationPath {
      *    |  |  |        |        +--ro (action)?
      * </pre>
      */
-    RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION(null);
+    FLOWS_STATISTICS_RPC_APPLY_ACTIONS(null);
 
     private final InstanceIdentifier<Extension> iid;
 
-    private ActionPath(InstanceIdentifier<Extension> iid) {
+    ActionPath(InstanceIdentifier<Extension> iid) {
         this.iid = iid;
     }
 
@@ -146,5 +153,4 @@ public enum ActionPath implements AugmentationPath {
     public final InstanceIdentifier<Extension> getInstanceIdentifier() {
         return iid;
     }
-
 }
index 1eb60e19ec42ebf6a37d3e66fbffd505729389f9..1c7aae844877b6f447621f2b1f461b9d92a0d488 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,11 +11,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * @author msunal
+ * Interface for an extension augmentation path.
  *
+ * @author msunal
  */
 public interface AugmentationPath {
 
     InstanceIdentifier<Extension> getInstanceIdentifier();
-
 }
index c7662e76d43be859e3ec10bcb62fe53b9b87b7f5..9afc3d17e26d55b7202cbdfdab526a59cd2003d5 100644 (file)
@@ -11,13 +11,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * @author msunal
+ * Enumerates the match paths.
  *
+ * @author msunal
  */
 public enum MatchPath implements AugmentationPath {
 
     /**
-     * openflowplugin-extension-general.yang
+     * openflowplugin-extension-general.yang.
      * <pre>
      * module: sal-flow
      * notifications:
@@ -25,9 +26,10 @@ public enum MatchPath implements AugmentationPath {
      *    |  +--ro match
      * </pre>
      */
-    SWITCHFLOWREMOVED_MATCH(null),
+    SWITCH_FLOW_REMOVED_MATCH(null),
+
     /**
-     * openflowplugin-extension-general.yang
+     * openflowplugin-extension-general.yang.
      * <pre>
      * module: packet-processing
      * notifications:
@@ -35,9 +37,10 @@ public enum MatchPath implements AugmentationPath {
      *       +--ro match
      * </pre>
      */
-    PACKETRECEIVED_MATCH(null),
+    PACKET_RECEIVED_MATCH(null),
+
     /**
-     * openflowplugin-extension-general.yang
+     * openflowplugin-extension-general.yang.
      * <pre>
      * module: packet-processing
      * container:
@@ -45,9 +48,10 @@ public enum MatchPath implements AugmentationPath {
      *       +--ro match
      * </pre>
      */
-    PACKETINMESSAGE_MATCH(null),
+    PACKET_IN_MESSAGE_MATCH(null),
+
     /**
-     * openflowplugin-extension-general.yang
+     * openflowplugin-extension-general.yang.
      * <pre>
      * module: opendaylight-flow-statistics
      * notifications:
@@ -56,9 +60,10 @@ public enum MatchPath implements AugmentationPath {
      *    |  |  +--ro match
      * </pre>
      */
-    FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH(null),
+    FLOWS_STATISTICS_UPDATE_MATCH(null),
+
     /**
-     * openflowplugin-extension-general.yang
+     * openflowplugin-extension-general.yang.
      * <pre>
      * module: opendaylight-direct-statistics
      * rpc:
@@ -67,11 +72,11 @@ public enum MatchPath implements AugmentationPath {
      *    |  |  +--ro match
      * </pre>
      */
-    RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH(null);
+    FLOWS_STATISTICS_RPC_MATCH(null);
 
     private final InstanceIdentifier<Extension> iid;
 
-    private MatchPath(InstanceIdentifier<Extension> iid) {
+    MatchPath(InstanceIdentifier<Extension> iid) {
         this.iid = iid;
     }
 
index e83bf27a432e4a935d8749ab74b8eb6093d31cb8..92f18b58cab3e5f157d0e84e9f4e7014099681eb 100644 (file)
@@ -11,22 +11,23 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * List of augmentation points available for experimenter symmetric message and multipart message
+ * List of augmentation points available for experimenter symmetric message and multipart message.
  */
 public enum MessagePath implements AugmentationPath {
 
     /**
      * <pre>
-     * module: sal-experimenter-message
+     * module: sal-experimenter-message.
      * notifications:
      * +---n experimenter-message-from-dev
      *    +--ro (experimenter-message-of-choice)?module: sal-flow
      * </pre>
      */
     MESSAGE_NOTIFICATION(null),
+
     /**
      * <pre>
-     * module: sal-experimenter-mp-message
+     * module: sal-experimenter-mp-message.
      * rpcs:
      * +---x send-experimenter-mp-request
      *    +--ro output
@@ -37,7 +38,7 @@ public enum MessagePath implements AugmentationPath {
 
     private final InstanceIdentifier<Extension> iid;
 
-    private MessagePath(InstanceIdentifier<Extension> iid) {
+    MessagePath(InstanceIdentifier<Extension> iid) {
         this.iid = iid;
     }
 
@@ -45,5 +46,4 @@ public enum MessagePath implements AugmentationPath {
     public final InstanceIdentifier<Extension> getInstanceIdentifier() {
         return iid;
     }
-
 }
index f2159a80e9c03b9e4fa87b1ec6d6f29181d44589..1b12d6a65b7da6690b79d42e99f6cb8fbdfc603b 100644 (file)
@@ -7,18 +7,8 @@
  */
 package org.opendaylight.openflowplugin.extension.api;
 
-
-/**
- *
- */
 public class ConverterExtensionActionKeyTest {
 
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey#equals(java.lang.Object)}.
-     */
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey#equals(java.lang.Object)}.
-     */
 //    @Test
 //    public void testEqualsObject() {
 //        ConverterExtensionMatchKey key1 = new ConverterExtensionMatchKey(Match.class);
index 45850a5fd6576a4a6c8f0a7a43dcbfbb73648539..63720e56174fafc5908af9ad47a6ee47e4369535 100644 (file)
@@ -7,14 +7,8 @@
  */
 package org.opendaylight.openflowplugin.extension.api;
 
-/**
- *
- */
 public class ConverterExtensionMatchKeyTest {
 
-    /**
-     * Test method for {@link org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey#equals(java.lang.Object)}.
-     */
 //    @Test
 //    public void testEqualsObject() {
 //        ConverterExtensionActionKey key1 = new ConverterExtensionActionKey(OutputActionCase.class);
index 21e1d1a9d90c65eb4338692b3a75244ed4315446..595fb6c481fce2d87539bc2d4e73589719078760 100644 (file)
@@ -22,13 +22,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionListBuilder;
 
 /**
- *  Test of {@link GroupingLooseResolver}
+ *  Test of {@link GroupingLooseResolver}.
  */
 public class GroupingLooseResolverTest {
 
     @Test
     public void testGetExtension() {
-        GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup = new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
+        GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup =
+                new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
         eqGroup.add(GeneralAugMatchNodesNodeTableFlow.class);
         eqGroup.add(GeneralAugMatchNotifPacketIn.class);
 
@@ -38,14 +39,19 @@ public class GroupingLooseResolverTest {
             .setExtensionList(Collections.singletonList(extension1)).build();
         Match match1 = mb1.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, odlxxx1).build();
 
-        org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder mb2 = new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder mb2 =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service
+                    .rev130709.packet.received.MatchBuilder();
         ExtensionList extension2 = new ExtensionListBuilder().setExtensionKey(JoachimTheTiny.class).build();
         GeneralAugMatchNotifPacketIn odlxxx2 = new GeneralAugMatchNotifPacketInBuilder()
             .setExtensionList(Collections.singletonList(extension2)).build();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match match2 = mb2.addAugmentation(GeneralAugMatchNotifPacketIn.class, odlxxx2).build();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match match2 =
+                mb2.addAugmentation(GeneralAugMatchNotifPacketIn.class, odlxxx2).build();
 
-        Assert.assertEquals(JoachimTheBig.class, eqGroup.getExtension(match1).get().getExtensionList().get(0).getExtensionKey());
-        Assert.assertEquals(JoachimTheTiny.class, eqGroup.getExtension(match2).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(JoachimTheBig.class,
+                eqGroup.getExtension(match1).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(JoachimTheTiny.class,
+                eqGroup.getExtension(match2).get().getExtensionList().get(0).getExtensionKey());
     }
 
     private static class JoachimTheBig extends ExtensionKey {
index e51c96651498b097a6d2df66dc17b9c9c5ae90fd..5bf034a7154f1fb2c790dc8d0fee1c307cb3d0b3 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.extension.api;
 
 import java.util.Collections;
-
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
@@ -23,37 +22,42 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 
 /**
- *  Test of {@link GroupingResolver}
+ *  Test of {@link GroupingResolver}.
  */
 public class GroupingResolverTest {
 
     /**
-     * test of method {@link GroupingResolver#getExtension(Augmentable)}
+     * test of method {@link GroupingResolver#getExtension(Augmentable)}.
      */
     @Test
     public void testGetExtension() {
-        GroupingResolver<GeneralExtensionListGrouping, Match> eqGroup = new GroupingResolver<>(GeneralExtensionListGrouping.class);
+        GroupingResolver<GeneralExtensionListGrouping, Match> eqGroup =
+                new GroupingResolver<>(GeneralExtensionListGrouping.class);
         eqGroup.add(GeneralAugMatchNodesNodeTableFlow.class);
         eqGroup.add(GeneralAugMatchRpcAddFlow.class);
 
         MatchBuilder mb1 = new MatchBuilder();
         ExtensionList extension1 = new ExtensionListBuilder().setExtensionKey(JoachimTheBig.class).build();
-        GeneralAugMatchNodesNodeTableFlow odlxxx1 = new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(Collections.singletonList(extension1)).build();
+        GeneralAugMatchNodesNodeTableFlow odlxxx1 = new GeneralAugMatchNodesNodeTableFlowBuilder()
+                .setExtensionList(Collections.singletonList(extension1)).build();
         Match match1 = mb1.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, odlxxx1).build();
 
         MatchBuilder mb2 = new MatchBuilder();
         ExtensionList extension2 = new ExtensionListBuilder().setExtensionKey(JoachimTheTiny.class).build();
-        GeneralAugMatchNodesNodeTableFlow odlxxx2 = new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(Collections.singletonList(extension2)).build();
+        GeneralAugMatchNodesNodeTableFlow odlxxx2 = new GeneralAugMatchNodesNodeTableFlowBuilder()
+                .setExtensionList(Collections.singletonList(extension2)).build();
         Match match2 = mb2.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, odlxxx2).build();
 
-        Assert.assertEquals(JoachimTheBig.class, eqGroup.getExtension(match1).get().getExtensionList().get(0).getExtensionKey());
-        Assert.assertEquals(JoachimTheTiny.class, eqGroup.getExtension(match2).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(JoachimTheBig.class,
+                eqGroup.getExtension(match1).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(JoachimTheTiny.class,
+                eqGroup.getExtension(match2).get().getExtensionList().get(0).getExtensionKey());
     }
-    
+
     private static class JoachimTheBig extends ExtensionKey {
         // nobody
     }
-    
+
     private static class JoachimTheTiny extends ExtensionKey {
         // nobody
     }
index e0fbf83af0ade71638568be535e89405934d078c..cc1cffef2b817bbb40237a391cfd22c3caa5dada 100755 (executable)
@@ -24,22 +24,30 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ge
 public class SetFieldExtensionTest {
     @Test
     public void testGetExtension() {
-        GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup = new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
+        GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup =
+                new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
         eqGroup.add(GeneralAugMatchRpcAddFlowWriteActionsSetField.class);
         eqGroup.add(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class);
 
         SetFieldBuilder sb1 = new SetFieldBuilder();
         ExtensionList extension1 = new ExtensionListBuilder().setExtensionKey(ZVendorExt1.class).build();
-        GeneralAugMatchRpcAddFlowWriteActionsSetField odlxxx1 = new GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder().setExtensionList(Collections.singletonList(extension1)).build();
+        GeneralAugMatchRpcAddFlowWriteActionsSetField odlxxx1 =
+                new GeneralAugMatchRpcAddFlowWriteActionsSetFieldBuilder()
+                    .setExtensionList(Collections.singletonList(extension1)).build();
         SetField setField1 = sb1.addAugmentation(GeneralAugMatchRpcAddFlowWriteActionsSetField.class, odlxxx1).build();
 
         SetFieldBuilder sb2 = new SetFieldBuilder();
         ExtensionList extension2 = new ExtensionListBuilder().setExtensionKey(ZVendorExt2.class).build();
-        GeneralAugMatchNodesNodeTableFlowWriteActionsSetField odlxxx2 = new GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder().setExtensionList(Collections.singletonList(extension2)).build();
-        SetField setField2 = sb2.addAugmentation(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class, odlxxx2).build();
+        GeneralAugMatchNodesNodeTableFlowWriteActionsSetField odlxxx2 =
+                new GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder()
+                    .setExtensionList(Collections.singletonList(extension2)).build();
+        SetField setField2 = sb2.addAugmentation(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class,
+                odlxxx2).build();
 
-        Assert.assertEquals(ZVendorExt1.class, eqGroup.getExtension(setField1).get().getExtensionList().get(0).getExtensionKey());
-        Assert.assertEquals(ZVendorExt2.class, eqGroup.getExtension(setField2).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(ZVendorExt1.class,
+                eqGroup.getExtension(setField1).get().getExtensionList().get(0).getExtensionKey());
+        Assert.assertEquals(ZVendorExt2.class,
+                eqGroup.getExtension(setField2).get().getExtensionList().get(0).getExtensionKey());
     }
 
     private static class ZVendorExt1 extends ExtensionKey {
index 88bcab2d7ffdd6e630063a1475f40b14acb71087..2b78cab4d33f930bf5276610ca76f4a8a898fbea 100644 (file)
@@ -1,44 +1,45 @@
-/*\r
- * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowplugin.extension.api;\r
-\r
-import org.junit.Assert;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierReply;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class TypeVersionKeyTest {\r
-\r
-    /**\r
-     * Tests {@link TypeVersionKey#equals(Object)} and {@link TypeVersionKey#hashCode()}\r
-     */\r
-    @Test\r
-    public void test() {\r
-        TypeVersionKey<? extends DataObject> key1 =\r
-                new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF13_VERSION_ID);\r
-        TypeVersionKey<? extends DataObject> key2 =\r
-                new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF13_VERSION_ID);\r
-        Assert.assertTrue("Wrong equals()", key1.equals(key2));\r
-        Assert.assertEquals("Wrong hashCode()", key1.hashCode(), key2.hashCode());\r
-\r
-        key2 = new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF10_VERSION_ID);\r
-        Assert.assertFalse("Wrong equals()", key1.equals(key2));\r
-        Assert.assertFalse("Wrong hashCode()", key1.hashCode() == key2.hashCode());\r
-\r
-        key2 = new TypeVersionKey<>(BarrierReply.class, EncodeConstants.OF13_VERSION_ID);\r
-        Assert.assertFalse("Wrong equals()", key1.equals(key2));\r
-        Assert.assertFalse("Wrong hashCode()", key1.hashCode() == key2.hashCode());\r
-    }\r
-}
\ No newline at end of file
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.extension.api;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierReply;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessage;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+
+/**
+ * Unit tests for TypeVersionKey.
+ *
+ * @author michal.polkorab
+ */
+public class TypeVersionKeyTest {
+
+    /**
+     * Tests {@link TypeVersionKey#equals(Object)} and {@link TypeVersionKey#hashCode()}.
+     */
+    @Test
+    public void test() {
+        TypeVersionKey<? extends DataObject> key1 =
+                new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF13_VERSION_ID);
+        TypeVersionKey<? extends DataObject> key2 =
+                new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF13_VERSION_ID);
+        Assert.assertTrue("Wrong equals()", key1.equals(key2));
+        Assert.assertEquals("Wrong hashCode()", key1.hashCode(), key2.hashCode());
+
+        key2 = new TypeVersionKey<>(HelloMessage.class, EncodeConstants.OF10_VERSION_ID);
+        Assert.assertFalse("Wrong equals()", key1.equals(key2));
+        Assert.assertFalse("Wrong hashCode()", key1.hashCode() == key2.hashCode());
+
+        key2 = new TypeVersionKey<>(BarrierReply.class, EncodeConstants.OF13_VERSION_ID);
+        Assert.assertFalse("Wrong equals()", key1.equals(key2));
+        Assert.assertFalse("Wrong hashCode()", key1.hashCode() == key2.hashCode());
+    }
+}
index 110d4fa9a56dac0c377dc655770f28114f660c63..37f9291a2584dd463e6fc968587efd80e4e088dd 100644 (file)
@@ -7,39 +7,36 @@
  */
 package org.opendaylight.openflowplugin.extension.vendor.nicira;
 
-import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
-import org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4DstKey;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIPv4DstConvertor;
-
 import com.google.common.base.Preconditions;
-
 import java.util.HashSet;
 import java.util.Set;
-
 import org.opendaylight.openflowjava.nx.api.NiciraUtil;
 import org.opendaylight.openflowjava.nx.codec.action.ConntrackCodec;
 import org.opendaylight.openflowjava.nx.codec.action.FinTimeoutCodec;
 import org.opendaylight.openflowjava.nx.codec.action.LearnCodec;
 import org.opendaylight.openflowjava.nx.codec.action.MultipathCodec;
 import org.opendaylight.openflowjava.nx.codec.action.OutputRegCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
+import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec;
 import org.opendaylight.openflowjava.nx.codec.action.RegMoveCodec;
 import org.opendaylight.openflowjava.nx.codec.action.ResubmitCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PushNshCodec;
-import org.opendaylight.openflowjava.nx.codec.action.PopNshCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpOpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpShaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpSpaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpThaCodec;
 import org.opendaylight.openflowjava.nx.codec.match.ArpTpaCodec;
-import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtMarkCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtStateCodec;
 import org.opendaylight.openflowjava.nx.codec.match.CtZoneCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthDstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.EthTypeCodec;
+import org.opendaylight.openflowjava.nx.codec.match.InPortCodec;
+import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc1Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc2Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Nshc3Codec;
@@ -54,23 +51,21 @@ import org.opendaylight.openflowjava.nx.codec.match.Reg4Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg5Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg6Codec;
 import org.opendaylight.openflowjava.nx.codec.match.Reg7Codec;
-import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TcpDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TcpSrcCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIdCodec;
+import org.opendaylight.openflowjava.nx.codec.match.TunIpv4DstCodec;
 import org.opendaylight.openflowjava.nx.codec.match.TunIpv4SrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthTypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthSrcCodec;
-import org.opendaylight.openflowjava.nx.codec.match.EncapEthDstCodec;
-import org.opendaylight.openflowjava.nx.codec.match.NshMdtypeCodec;
-import org.opendaylight.openflowjava.nx.codec.match.TunGpeNpCodec;
-import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
 import org.opendaylight.openflowjava.nx.codec.match.UdpDstCodec;
+import org.opendaylight.openflowjava.nx.codec.match.UdpSrcCodec;
 import org.opendaylight.openflowjava.protocol.api.keys.ActionSerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowplugin.extension.api.ConverterExtensionKey;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
 import org.opendaylight.openflowplugin.extension.api.ExtensionConverterRegistrator;
+import org.opendaylight.openflowplugin.extension.api.OpenFlowPluginExtensionRegistratorProvider;
 import org.opendaylight.openflowplugin.extension.api.TypeVersionKey;
 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.ConntrackConvertor;
@@ -78,11 +73,11 @@ import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.LearnConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.MultipathConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.OutputRegConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.PopNshConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.PushNshConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.RegLoadConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.RegMoveConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.ResubmitConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.PushNshConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action.PopNshConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpOpConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpShaConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.ArpSpaConvertor;
@@ -91,29 +86,30 @@ import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.A
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.CtMarkConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.CtStateConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.CtZoneConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthDstConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthSrcConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthTypeConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EthDstConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EthSrcConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EthTypeConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NshMdtypeConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NshNpConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.Nshc1Convertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.Nshc2Convertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.Nshc3Convertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.Nshc4Convertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NsiConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NspConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NxmInPortConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.RegConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TcpDstConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TcpSrcConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunGpeNpConvertor;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIPv4DstConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIPv4SrcConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunIdConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthTypeConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthSrcConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.EncapEthDstConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NshMdtypeConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NshNpConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.TunGpeNpConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.UdpDstConvertor;
 import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.UdpSrcConvertor;
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.NxmInPortConvertor;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.ActionChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionConntrack;
@@ -121,71 +117,71 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionMultipath;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegLoad;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPushNsh;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionPopNsh;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionConntrackRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionFinTimeoutRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionLearnRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionMultipathRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionOutputRegRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPopNshRpcAddFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPushNshRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitRpcAddFlowApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPushNshRpcAddFlowApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPopNshRpcAddFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionConntrackRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionFinTimeoutRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionLearnRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionOutputRegRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPopNshRpcAddFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPushNshRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegLoadRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegMoveRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitRpcAddFlowWriteActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPushNshRpcAddFlowWriteActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.flow.input.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPopNshRpcAddFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionConntrackRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionFinTimeoutRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionLearnRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionMultipathRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionOutputRegRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionPopNshRpcAddGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionPushNshRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionRegLoadRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionRegMoveRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionResubmitRpcAddGroupCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionPushNshRpcAddGroupCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.add.group.input.buckets.bucket.action.action.NxActionPopNshRpcAddGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionConntrackNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionFinTimeoutNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionLearnNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionMultipathNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionOutputRegNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionPopNshNodesNodeGroupBucketsBucketActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionPushNshNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegLoadNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionRegMoveNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionResubmitNodesNodeGroupBucketsBucketActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionPushNshNodesNodeGroupBucketsBucketActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.group.buckets.bucket.action.action.NxActionPopNshNodesNodeGroupBucketsBucketActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionConntrackNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionFinTimeoutNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionLearnNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionMultipathNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionOutputRegNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPopNshNodesNodeTableFlowApplyActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPushNshNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitNodesNodeTableFlowApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPushNshNodesNodeTableFlowApplyActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionPopNshNodesNodeTableFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionConntrackNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionFinTimeoutNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionLearnNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionMultipathNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionOutputRegNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPopNshNodesNodeTableFlowWriteActionsCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPushNshNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegLoadNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionRegMoveNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionResubmitNodesNodeTableFlowWriteActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPushNshNodesNodeTableFlowWriteActionsCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionPopNshNodesNodeTableFlowWriteActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadRpcRemoveFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveRpcRemoveFlowApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.flow.input.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionResubmitRpcRemoveFlowApplyActionsCase;
@@ -194,13 +190,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionLearnRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionMultipathRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionOutputRegRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionPopNshRpcRemoveGroupCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionPushNshRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionRegLoadRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionRegMoveRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionResubmitRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.transmit.packet.input.action.action.NxActionRegLoadRpcTransmitPacketCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.transmit.packet.input.action.action.NxActionResubmitRpcTransmitPacketCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionPushNshRpcRemoveGroupCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.remove.group.input.buckets.bucket.action.action.NxActionPopNshRpcRemoveGroupCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.flow.input.original.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadRpcUpdateFlowOriginalApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.flow.input.updated.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadRpcUpdateFlowUpdatedApplyActionsCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.flow.input.updated.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegMoveRpcUpdateFlowUpdatedApplyActionsCase;
@@ -210,26 +206,31 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionLearnRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionMultipathRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionOutputRegRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionPopNshRpcUpdateGroupOriginalCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionPushNshRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionRegLoadRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionRegMoveRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionResubmitRpcUpdateGroupOriginalCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionPushNshRpcUpdateGroupOriginalCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.original.group.buckets.bucket.action.action.NxActionPopNshRpcUpdateGroupOriginalCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionConntrackRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionFinTimeoutRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionLearnRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionMultipathRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionOutputRegRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionPopNshRpcUpdateGroupUpdatedCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionPushNshRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionRegLoadRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionRegMoveRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionResubmitRpcUpdateGroupUpdatedCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionPushNshRpcUpdateGroupUpdatedCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.update.group.input.updated.group.buckets.bucket.action.action.NxActionPopNshRpcUpdateGroupUpdatedCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpShaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxArpThaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtMarkKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtStateKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxCtZoneKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthDstKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthSrcKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthTypeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshMdtypeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshNpKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc1Key;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc2Key;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshc3Key;
@@ -244,32 +245,25 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg5Key;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg6Key;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg7Key;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunGpeNpKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIdKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4DstKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4SrcKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthTypeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthSrcKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthDstKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshMdtypeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNshNpKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunGpeNpKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfArpOpKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfArpSpaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfArpTpaKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthDstKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthSrcKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfEthTypeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfInPortKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfTcpDstKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfTcpSrcKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfUdpDstKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfUdpSrcKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfInPortKey;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- *
- */
 public class NiciraExtensionProvider implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(NiciraExtensionProvider.class);
@@ -321,7 +315,7 @@ public class NiciraExtensionProvider implements AutoCloseable {
     private final Set<ObjectRegistration<?>> registrations;
 
     /**
-     * register appropriate converters
+     * Register appropriate converters.
      */
     public NiciraExtensionProvider(final OpenFlowPluginExtensionRegistratorProvider provider) {
         this.extensionConverterRegistrator = Preconditions.checkNotNull(provider.getExtensionConverterRegistrator());
@@ -634,11 +628,12 @@ public class NiciraExtensionProvider implements AutoCloseable {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void close() {
         registrations.forEach(janitor -> {
             try {
                 janitor.close();
-            } catch (Exception e) {
+            } catch (RuntimeException e) {
                 LOG.warn("closing of extension converter failed", e);
             }
         });
@@ -646,25 +641,18 @@ public class NiciraExtensionProvider implements AutoCloseable {
         registrations.clear();
     }
 
-    /**
-     * @param actionCaseType
-     * @param actionConvertor
-     */
     private void registerAction13(final Class<? extends Action> actionCaseType, final ConvertorActionToOFJava<
             org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actionConvertor) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>
+                actionConvertor) {
         TypeVersionKey<? extends Action> key = new TypeVersionKey<>(actionCaseType, EncodeConstants.OF13_VERSION_ID);
         registrations.add(extensionConverterRegistrator.registerActionConvertor(key, actionConvertor));
     }
 
-    /**
-     * @param actionCaseType
-     * @param actionConvertor
-     */
     private void registerAction13(Class<? extends ActionChoice> actionCaseType,
-            ConvertorActionFromOFJava<
-                    org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action,
-                    ActionPath> actionConvertor) {
+        ConvertorActionFromOFJava<
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action,
+                ActionPath> actionConvertor) {
         ActionSerializerKey<?> key = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, actionCaseType, null);
         registrations.add(extensionConverterRegistrator.registerActionConvertor(key, actionConvertor));
     }
index 314ab640171264a1da078b63fcf866dd3c24a3e0..6840893e3f2e1321023ce40f3ada9b8862b176db 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -11,8 +11,9 @@ import org.opendaylight.openflowplugin.extension.api.path.AugmentationPath;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
 
 /**
- * @author msunal
+ * Codec precondition exception.
  *
+ * @author msunal
  */
 public class CodecPreconditionException extends RuntimeException {
 
index e7518a736336ee98787b4ead024f9d3dab4a9163..2b320dc0076f9ffd3916a09bc31cdd3219b521f0 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- * 
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -9,18 +9,20 @@ package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
 
 import com.google.common.base.Splitter;
 import com.google.common.collect.Lists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
-
 import java.util.List;
 import java.util.ListIterator;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 
 /**
- * @author msunal
+ * IP conversion utilities.
  *
+ * @author msunal
  */
 public final class IpConverter {
+    private IpConverter() {
+    }
 
-    public static long Ipv4AddressToLong(Ipv4Address ipv4Address) {
+    public static long ipv4AddressToLong(Ipv4Address ipv4Address) {
         long result = 0 ;
         Iterable<String> splitted = Splitter.on('.')
                 .trimResults()
@@ -30,10 +32,10 @@ public final class IpConverter {
         List<String> splittedAddress = Lists.newArrayList(splitted.iterator());
         int maxIndex = splittedAddress.size() - 1;
         ListIterator<String> listIter = splittedAddress.listIterator();
-        while(listIter.hasNext()) {
+        while (listIter.hasNext()) {
             String current = listIter.next();
-            int i = splittedAddress.indexOf(current);
-            result |= (Long.parseLong(current) << ((maxIndex-i) * 8));
+            int index = splittedAddress.indexOf(current);
+            result |= Long.parseLong(current) << (maxIndex - index) * 8;
         }
         return result & 0xFFFFFFFF;
     }
index bbb56a43995745f026736aefb6c9ed951e11c688..4aa2797dbafa4f842ecd6f50b26f77965ae33dc0 100644 (file)
@@ -14,13 +14,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev1
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
 
 /**
+ * Action utilities.
+ *
  * @author msunal
  */
-public class ActionUtil {
+public final class ActionUtil {
+    public static final ExperimenterId EXPERIMENTER_ID = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
 
-    public final static ExperimenterId EXPERIMENTER_ID = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
+    private ActionUtil() {
+    }
 
-    public static final Action createAction(ActionChoice actionChoice){
+    public static Action createAction(ActionChoice actionChoice) {
         ActionBuilder actionBuilder = new ActionBuilder();
         actionBuilder.setActionChoice(actionChoice);
         actionBuilder.setExperimenterId(EXPERIMENTER_ID);
index 866d14063dc3c46586d5bc7acab4a2bf05c972d9..a1a705a473f94622c6436db902938e40381a1037 100644 (file)
@@ -9,10 +9,8 @@
 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
 
 import com.google.common.base.Preconditions;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
@@ -36,18 +34,19 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.conntrack.grouping.nx.conntrack.CtActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.OfpactActions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionCtMarkCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionNatCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionCtMarkCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionNatCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMark;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNatBuilder;
 
 /**
+ * Conntrack converter implementation.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class ConntrackConvertor implements
         ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
         .Action, Action>,
@@ -66,74 +65,6 @@ public class ConntrackConvertor implements
         return resolveAction(builder.build(), path);
     }
 
-    private List<CtActions> getCtAction(final NxActionConntrack action) {
-        if (action.getCtActions() == null) {
-            return null;
-        }
-        List<CtActions> ctActions = new ArrayList<>();
-        for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack
-                .grouping.nx.action.conntrack.CtActions ctAction : action.getCtActions()) {
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions
-                .OfpactActions ofpactAction = ctAction.getOfpactActions();
-            if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421
-                    .ofpact.actions.ofpact.actions.NxActionNatCase) {
-                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
-                    .actions.nx.action.nat._case.NxActionNat nxActionNat = ((org.opendaylight.yang.gen.v1.urn
-                            .opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
-                            .NxActionNatCase) ofpactAction).getNxActionNat();
-                NxActionNatBuilder nxActionNatBuilder = new NxActionNatBuilder();
-                nxActionNatBuilder.setFlags(nxActionNat.getFlags());
-                nxActionNatBuilder.setRangePresent(nxActionNat.getRangePresent());
-                nxActionNatBuilder.setIpAddressMin(nxActionNat.getIpAddressMin());
-                nxActionNatBuilder.setIpAddressMax(nxActionNat.getIpAddressMax());
-                nxActionNatBuilder.setPortMin(nxActionNat.getPortMin());
-                nxActionNatBuilder.setPortMax(nxActionNat.getPortMax());
-                NxActionNatCaseBuilder caseBuilder = new NxActionNatCaseBuilder();
-                caseBuilder.setNxActionNat(nxActionNatBuilder.build());
-                CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
-                ctActionsBuilder.setOfpactActions(caseBuilder.build());
-                ctActions.add(ctActionsBuilder.build());
-            } else if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421
-                    .ofpact.actions.ofpact.actions.NxActionCtMarkCase) {
-                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
-                    .actions.nx.action.ct.mark._case.NxActionCtMark nxActionCtMark = ((org.opendaylight.yang.gen.v1.urn
-                            .opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
-                            .NxActionCtMarkCase) ofpactAction).getNxActionCtMark();
-                NxActionCtMarkBuilder nxActionCtMarkBuilder = new NxActionCtMarkBuilder();
-                nxActionCtMarkBuilder.setCtMark(nxActionCtMark.getCtMark());
-                // TODO: ct_mark mask is not supported yet
-                NxActionCtMarkCaseBuilder caseBuilder = new NxActionCtMarkCaseBuilder();
-                caseBuilder.setNxActionCtMark(nxActionCtMarkBuilder.build());
-                CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
-                ctActionsBuilder.setOfpactActions(caseBuilder.build());
-                ctActions.add(ctActionsBuilder.build());
-            }
-        }
-        return ctActions;
-    }
-
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
-                        .Action resolveAction(final NxConntrack value, final ActionPath path) {
-        switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
-                return new NxActionConntrackNodesNodeTableFlowWriteActionsCaseBuilder().setNxConntrack(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionConntrackNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxConntrack(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionConntrackNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxConntrack(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
-                return new NxActionConntrackNotifGroupDescStatsUpdatedCaseBuilder().setNxConntrack(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionConntrackNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxConntrack(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionConntrackNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxConntrack(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
-                return new NxActionConntrackNodesNodeTableFlowApplyActionsCaseBuilder().setNxConntrack(value).build();
-            default:
-                throw new CodecPreconditionException(path);
-        }
-    }
-
     @Override
     public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
             .Action nxActionArg) {
@@ -151,6 +82,32 @@ public class ConntrackConvertor implements
         return ActionUtil.createAction(actionConntrackBuilder.build());
     }
 
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+                        .Action resolveAction(final NxConntrack value, final ActionPath path) {
+        switch (path) {
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
+                return new NxActionConntrackNodesNodeTableFlowWriteActionsCaseBuilder().setNxConntrack(value).build();
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionConntrackNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxConntrack(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionConntrackNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxConntrack(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
+                return new NxActionConntrackNotifGroupDescStatsUpdatedCaseBuilder().setNxConntrack(value).build();
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionConntrackNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxConntrack(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionConntrackNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxConntrack(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
+                return new NxActionConntrackNodesNodeTableFlowApplyActionsCaseBuilder().setNxConntrack(value).build();
+            default:
+                throw new CodecPreconditionException(path);
+        }
+    }
+
     private List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack
                                 .grouping.nx.action.conntrack.CtActions> getCtAction(final NxConntrack action) {
         if (action.getCtActions() == null) {
@@ -185,9 +142,9 @@ public class ConntrackConvertor implements
             } else if (ofpactAction instanceof NxActionCtMarkCase) {
                 NxActionCtMark nxActionCtMark = ((NxActionCtMarkCase) ofpactAction).getNxActionCtMark();
                 org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
-                    .actions.nx.action.ct.mark._case.NxActionCtMarkBuilder nxActionCtMarkBuilder = new org.opendaylight.yang.gen
-                    .v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions.nx.action.ct.mark
-                    ._case.NxActionCtMarkBuilder();
+                    .actions.nx.action.ct.mark._case.NxActionCtMarkBuilder nxActionCtMarkBuilder =
+                        new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact
+                            .actions.ofpact.actions.nx.action.ct.mark._case.NxActionCtMarkBuilder();
                 nxActionCtMarkBuilder.setCtMark(nxActionCtMark.getCtMark());
                 // TODO: ct_mark mask is not supported yet
                 org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
@@ -204,4 +161,50 @@ public class ConntrackConvertor implements
         }
         return ctActions;
     }
+
+    private List<CtActions> getCtAction(final NxActionConntrack action) {
+        if (action.getCtActions() == null) {
+            return null;
+        }
+        List<CtActions> ctActions = new ArrayList<>();
+        for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.conntrack
+                .grouping.nx.action.conntrack.CtActions ctAction : action.getCtActions()) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions
+                .OfpactActions ofpactAction = ctAction.getOfpactActions();
+            if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421
+                    .ofpact.actions.ofpact.actions.NxActionNatCase) {
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
+                    .actions.nx.action.nat._case.NxActionNat nxActionNat = ((org.opendaylight.yang.gen.v1.urn
+                            .opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
+                            .NxActionNatCase) ofpactAction).getNxActionNat();
+                NxActionNatBuilder nxActionNatBuilder = new NxActionNatBuilder();
+                nxActionNatBuilder.setFlags(nxActionNat.getFlags());
+                nxActionNatBuilder.setRangePresent(nxActionNat.getRangePresent());
+                nxActionNatBuilder.setIpAddressMin(nxActionNat.getIpAddressMin());
+                nxActionNatBuilder.setIpAddressMax(nxActionNat.getIpAddressMax());
+                nxActionNatBuilder.setPortMin(nxActionNat.getPortMin());
+                nxActionNatBuilder.setPortMax(nxActionNat.getPortMax());
+                NxActionNatCaseBuilder caseBuilder = new NxActionNatCaseBuilder();
+                caseBuilder.setNxActionNat(nxActionNatBuilder.build());
+                CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
+                ctActionsBuilder.setOfpactActions(caseBuilder.build());
+                ctActions.add(ctActionsBuilder.build());
+            } else if (ofpactAction instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+                    .rev140421.ofpact.actions.ofpact.actions.NxActionCtMarkCase) {
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact
+                    .actions.nx.action.ct.mark._case.NxActionCtMark nxActionCtMark = ((org.opendaylight.yang.gen.v1.urn
+                            .opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
+                            .NxActionCtMarkCase) ofpactAction).getNxActionCtMark();
+                NxActionCtMarkBuilder nxActionCtMarkBuilder = new NxActionCtMarkBuilder();
+                nxActionCtMarkBuilder.setCtMark(nxActionCtMark.getCtMark());
+                // TODO: ct_mark mask is not supported yet
+                NxActionCtMarkCaseBuilder caseBuilder = new NxActionCtMarkCaseBuilder();
+                caseBuilder.setNxActionCtMark(nxActionCtMarkBuilder.build());
+                CtActionsBuilder ctActionsBuilder = new CtActionsBuilder();
+                ctActionsBuilder.setOfpactActions(caseBuilder.build());
+                ctActions.add(ctActionsBuilder.build());
+            }
+        }
+        return ctActions;
+    }
 }
index df627e2261f1e61ec2e094fd05033e1f1f3019e2..8d439bd16615a9d9c5d866bf1e90eeccc866763b 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.write.actions._case.write.actions.action.action.NxActionFinTimeoutNodesNodeTableFlowWriteActionsCaseBuilder;
 
 /**
- * Convert to/from SAL flow model to openflowjava model for FinTimeout action
+ * Convert to/from SAL flow model to openflowjava model for FinTimeout action.
  */
 public class FinTimeoutConvertor
         implements ConvertorActionToOFJava<
@@ -39,54 +39,56 @@ public class FinTimeoutConvertor
     public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
             final Action input, final ActionPath path) {
         NxActionFinTimeout action = ((ActionFinTimeout) input.getActionChoice()).getNxActionFinTimeout();
-        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder builder =
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping.NxActionFinTimeoutBuilder();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin
+            .timeout.grouping.NxActionFinTimeoutBuilder builder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                .openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping
+                    .NxActionFinTimeoutBuilder();
         builder.setFinIdleTimeout(action.getFinIdleTimeout());
         builder.setFinHardTimeout(action.getFinHardTimeout());
         return resolveAction(builder.build(), path);
     }
 
+    @Override
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionFinTimeoutGrouping);
+        NxActionFinTimeoutGrouping nxAction = (NxActionFinTimeoutGrouping) nxActionArg;
+        ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
+        NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
+        nxActionFinTimeoutBuilder.setFinIdleTimeout(nxAction.getNxActionFinTimeout().getFinIdleTimeout());
+        nxActionFinTimeoutBuilder.setFinHardTimeout(nxAction.getNxActionFinTimeout().getFinHardTimeout());
+        builder.setNxActionFinTimeout(nxActionFinTimeoutBuilder.build());
+        return ActionUtil.createAction(builder.build());
+    }
+
     private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping.NxActionFinTimeout nxActionFinTimeout,
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx
+                .action.fin.timeout.grouping.NxActionFinTimeout nxActionFinTimeout,
             final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionFinTimeoutNodesNodeTableFlowWriteActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
                 return new NxActionFinTimeoutNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
                 return new NxActionFinTimeoutNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionFinTimeoutNotifGroupDescStatsUpdatedCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
                 return new NxActionFinTimeoutNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
                 return new NxActionFinTimeoutNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionFinTimeoutNodesNodeTableFlowApplyActionsCaseBuilder()
                         .setNxActionFinTimeout(nxActionFinTimeout).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionFinTimeoutGrouping);
-        NxActionFinTimeoutGrouping nxAction = (NxActionFinTimeoutGrouping) nxActionArg;
-        ActionFinTimeoutBuilder builder = new ActionFinTimeoutBuilder();
-        NxActionFinTimeoutBuilder nxActionFinTimeoutBuilder = new NxActionFinTimeoutBuilder();
-        nxActionFinTimeoutBuilder.setFinIdleTimeout(nxAction.getNxActionFinTimeout().getFinIdleTimeout());
-        nxActionFinTimeoutBuilder.setFinHardTimeout(nxAction.getNxActionFinTimeout().getFinHardTimeout());
-        builder.setNxActionFinTimeout(nxActionFinTimeoutBuilder.build());
-        return ActionUtil.createAction(builder.build());
-    }
-
 }
index dbaf92afa14152d7ce401401e3479b37265cea72..d24fb37382cb1054dafca0ce159184de83bdc61c 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConvertorActionToOFJava;
 import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
@@ -28,55 +29,56 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.NxLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.NxLearnBuilder;
 
-import com.google.common.base.Preconditions;
-
 /**
+ * Convert to/from SAL flow model to openflowjava model for NxLearn action.
+ *
  * @author Slava Radune
  */
-
 public class LearnConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionLearn action = ((ActionLearn) input.getActionChoice()).getNxActionLearn();
         NxLearnBuilder builder = new NxLearnBuilder();
         LearnConvertorUtil.convertUp(action, builder);
         return resolveAction(builder.build(), path);
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxLearn value, final ActionPath path) {
+    @Override
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionLearnGrouping);
+        NxActionLearnGrouping nxAction = (NxActionLearnGrouping) nxActionArg;
+
+        NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
+        LearnConvertorUtil.convertDown(nxAction, nxActionLearnBuilder);
+        ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
+        actionLearnBuilder.setNxActionLearn(nxActionLearnBuilder.build());
+        return ActionUtil.createAction(actionLearnBuilder.build());
+    }
+
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxLearn value, final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionLearnNodesNodeTableFlowWriteActionsCaseBuilder().setNxLearn(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
                 return new NxActionLearnNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxLearn(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
                 return new NxActionLearnNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxLearn(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionLearnNotifGroupDescStatsUpdatedCaseBuilder().setNxLearn(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
                 return new NxActionLearnNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxLearn(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
                 return new NxActionLearnNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxLearn(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionLearnNodesNodeTableFlowApplyActionsCaseBuilder().setNxLearn(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionLearnGrouping);
-        NxActionLearnGrouping nxAction = (NxActionLearnGrouping) nxActionArg;
-
-        NxActionLearnBuilder nxActionLearnBuilder = new NxActionLearnBuilder();
-        LearnConvertorUtil.convertDown(nxAction, nxActionLearnBuilder);
-        ActionLearnBuilder actionLearnBuilder = new ActionLearnBuilder();
-        actionLearnBuilder.setNxActionLearn(nxActionLearnBuilder.build());
-        return ActionUtil.createAction(actionLearnBuilder.build());
-    }
-
 }
index 088c0f8f4a98052778038445f670d0e190ee30e6..aa3d9600898fc1c50b3a5c40e4e22cbbd8fd3a5f 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action
 
 import java.util.ArrayList;
 import java.util.List;
-
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.NxActionLearnBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.NxActionLearnGrouping;
@@ -39,11 +38,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowMods;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder;
 
-public class LearnConvertorUtil {
+public final class LearnConvertorUtil {
+    private LearnConvertorUtil() {
+    }
 
     /*
-     *                         CONVERT UP
-    */
+     *                                  CONVERT UP
+     */
 
     static void convertUp(NxActionLearn action, NxLearnBuilder builder) {
         builder.setFlags(action.getFlags());
@@ -58,25 +59,50 @@ public class LearnConvertorUtil {
     }
 
     private static List<FlowMods> getFlowMods(NxActionLearn action) {
-        if(action.getFlowMods() == null){
+        if (action.getFlowMods() == null) {
             return null;
         }
 
-        List<FlowMods> flowMods = new ArrayList<FlowMods>();
-        for(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods flowMod : action.getFlowMods()){
+        List<FlowMods> flowMods = new ArrayList<>();
+        for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn
+                .grouping.nx.action.learn.FlowMods flowMod : action.getFlowMods()) {
             FlowModsBuilder flowModBuilder = new FlowModsBuilder();
-            FlowModSpec flowModSpec = buildFlowModSpec(flowMod.getFlowModSpec());
+            FlowModSpec flowModSpec = buildExtFlowModSpec(flowMod.getFlowModSpec());
             flowModBuilder.setFlowModSpec(flowModSpec);
             flowMods.add(flowModBuilder.build());
         }
         return flowMods;
     }
 
+    private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action
+            .learn.grouping.nx.action.learn.FlowMods> getFlowMods(NxLearn nxLearn) {
+        if (nxLearn.getFlowMods() == null) {
+            return null;
+        }
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn
+            .grouping.nx.action.learn.FlowMods> flowMods = new ArrayList<>();
+        for (FlowMods flowMod : nxLearn.getFlowMods()) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn
+                .grouping.nx.action.learn.FlowModsBuilder flowModBuilder = new org.opendaylight.yang.gen.v1.urn
+                    .opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn
+                        .FlowModsBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec
+                flowModSpec = buildFlowModSpec(flowMod.getFlowModSpec());
+            flowModBuilder.setFlowModSpec(flowModSpec);
+            flowMods.add(flowModBuilder.build());
+        }
+        return flowMods;
+    }
 
-    private static FlowModSpec buildFlowModSpec(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec flowModSpec) {
-        if(flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromField flowModAdd2 = 
-                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase) flowModSpec).getFlowModAddMatchFromField(); 
+    private static FlowModSpec buildExtFlowModSpec(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+            .rev140421.flow.mod.spec.FlowModSpec flowModSpec) {
+        if (flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow
+                .mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .flow.mod.add.match.from.field._case.FlowModAddMatchFromField flowModAdd2 =
+                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                            .flow.mod.spec.FlowModAddMatchFromFieldCase) flowModSpec).getFlowModAddMatchFromField();
             FlowModAddMatchFromFieldBuilder flowModAdd = new FlowModAddMatchFromFieldBuilder();
             flowModAdd.setDstField(flowModAdd2.getDstField());
             flowModAdd.setSrcField(flowModAdd2.getSrcField());
@@ -86,9 +112,12 @@ public class LearnConvertorUtil {
             FlowModAddMatchFromFieldCaseBuilder caseBuilder = new FlowModAddMatchFromFieldCaseBuilder();
             caseBuilder.setFlowModAddMatchFromField(flowModAdd.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCase){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValue flowModAdd2 = 
-                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCase) flowModSpec).getFlowModAddMatchFromValue(); 
+        } else if (flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+                .rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCase) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod
+                .spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValue flowModAdd2 =
+                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                            .flow.mod.spec.FlowModAddMatchFromValueCase) flowModSpec).getFlowModAddMatchFromValue();
             FlowModAddMatchFromValueBuilder flowModAdd = new FlowModAddMatchFromValueBuilder();
             flowModAdd.setValue(flowModAdd2.getValue());
             flowModAdd.setSrcField(flowModAdd2.getSrcField());
@@ -97,9 +126,12 @@ public class LearnConvertorUtil {
             FlowModAddMatchFromValueCaseBuilder caseBuilder = new FlowModAddMatchFromValueCaseBuilder();
             caseBuilder.setFlowModAddMatchFromValue(flowModAdd.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCase){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoField flowModCopy2 = 
-                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCase) flowModSpec).getFlowModCopyFieldIntoField(); 
+        } else if (flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+                .rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCase) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod
+                .spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoField flowModCopy2 =
+                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                            .flow.mod.spec.FlowModCopyFieldIntoFieldCase) flowModSpec).getFlowModCopyFieldIntoField();
             FlowModCopyFieldIntoFieldBuilder flowModCopy = new FlowModCopyFieldIntoFieldBuilder();
             flowModCopy.setDstField(flowModCopy2.getDstField());
             flowModCopy.setDstOfs(flowModCopy2.getDstOfs());
@@ -109,9 +141,12 @@ public class LearnConvertorUtil {
             FlowModCopyFieldIntoFieldCaseBuilder caseBuilder = new FlowModCopyFieldIntoFieldCaseBuilder();
             caseBuilder.setFlowModCopyFieldIntoField(flowModCopy.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCase){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoField flowModCopy2 = 
-                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCase) flowModSpec).getFlowModCopyValueIntoField(); 
+        } else if (flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+                .rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCase) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod
+                .spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoField flowModCopy2 =
+                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                            .flow.mod.spec.FlowModCopyValueIntoFieldCase) flowModSpec).getFlowModCopyValueIntoField();
             FlowModCopyValueIntoFieldBuilder flowModCopy = new FlowModCopyValueIntoFieldBuilder();
             flowModCopy.setValue(flowModCopy2.getValue());
             flowModCopy.setDstField(flowModCopy2.getDstField());
@@ -120,9 +155,12 @@ public class LearnConvertorUtil {
             FlowModCopyValueIntoFieldCaseBuilder caseBuilder = new FlowModCopyValueIntoFieldCaseBuilder();
             caseBuilder.setFlowModCopyValueIntoField(flowModCopy.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCase){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.output.to.port._case.FlowModOutputToPort flowModOut2 = 
-                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCase) flowModSpec).getFlowModOutputToPort(); 
+        } else if (flowModSpec instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action
+                .rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCase) {
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod
+                .spec.flow.mod.output.to.port._case.FlowModOutputToPort flowModOut2 =
+                    ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                            .flow.mod.spec.FlowModOutputToPortCase) flowModSpec).getFlowModOutputToPort();
             FlowModOutputToPortBuilder flowModOut = new FlowModOutputToPortBuilder();
             flowModOut.setSrcField(flowModOut2.getSrcField());
             flowModOut.setSrcOfs(flowModOut2.getSrcOfs());
@@ -150,86 +188,91 @@ public class LearnConvertorUtil {
         nxActionLearnBuilder.setFlowMods(getFlowMods(nxAction.getNxLearn()));
     }
 
-    private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods> getFlowMods(
-            NxLearn nxLearn) {
-        if(nxLearn.getFlowMods() == null){
-            return null;
-        }
-
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods> flowMods = new ArrayList<>();
-        for(FlowMods flowMod : nxLearn.getFlowMods()){
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder flowModBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec flowModSpec = buildFlowModSpec(flowMod.getFlowModSpec());
-            flowModBuilder.setFlowModSpec(flowModSpec);
-            flowMods.add(flowModBuilder.build());
-        }
-        return flowMods;
-    }
-
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec buildFlowModSpec(FlowModSpec flowModSpec) {
-        if(flowModSpec instanceof FlowModAddMatchFromFieldCase){
-            FlowModAddMatchFromField flowModAdd2 = ((FlowModAddMatchFromFieldCase) flowModSpec).getFlowModAddMatchFromField();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder 
-                flowModAdd = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder();
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+            .FlowModSpec buildFlowModSpec(FlowModSpec flowModSpec) {
+        if (flowModSpec instanceof FlowModAddMatchFromFieldCase) {
+            FlowModAddMatchFromField flowModAdd2 = ((FlowModAddMatchFromFieldCase) flowModSpec)
+                    .getFlowModAddMatchFromField();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod
+                .spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder flowModAdd =
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                        .flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder();
             flowModAdd.setDstField(flowModAdd2.getDstField());
             flowModAdd.setSrcField(flowModAdd2.getSrcField());
             flowModAdd.setDstOfs(flowModAdd2.getDstOfs());
             flowModAdd.setSrcOfs(flowModAdd2.getSrcOfs());
             flowModAdd.setFlowModNumBits(flowModAdd2.getFlowModNumBits());
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder 
-                caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .FlowModAddMatchFromFieldCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                    .openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder();
             caseBuilder.setFlowModAddMatchFromField(flowModAdd.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof FlowModAddMatchFromValueCase){
-            FlowModAddMatchFromValue flowModAdd2 = ((FlowModAddMatchFromValueCase) flowModSpec).getFlowModAddMatchFromValue();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder 
-                flowModAdd = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder();
+        } else if (flowModSpec instanceof FlowModAddMatchFromValueCase) {
+            FlowModAddMatchFromValue flowModAdd2 = ((FlowModAddMatchFromValueCase) flowModSpec)
+                    .getFlowModAddMatchFromValue();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder flowModAdd =
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                        .flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder();
             flowModAdd.setValue(flowModAdd2.getValue());
             flowModAdd.setSrcField(flowModAdd2.getSrcField());
             flowModAdd.setSrcOfs(flowModAdd2.getSrcOfs());
             flowModAdd.setFlowModNumBits(flowModAdd2.getFlowModNumBits());
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder 
-                caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .FlowModAddMatchFromValueCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                    .openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder();
             caseBuilder.setFlowModAddMatchFromValue(flowModAdd.build());
             return caseBuilder.build();
-        } else if(flowModSpec instanceof FlowModCopyFieldIntoFieldCase){
-            FlowModCopyFieldIntoField flowModCopy2 = ((FlowModCopyFieldIntoFieldCase) flowModSpec).getFlowModCopyFieldIntoField();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder 
-                flowModCopy = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder();
+        } else if (flowModSpec instanceof FlowModCopyFieldIntoFieldCase) {
+            FlowModCopyFieldIntoField flowModCopy2 = ((FlowModCopyFieldIntoFieldCase) flowModSpec)
+                    .getFlowModCopyFieldIntoField();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder flowModCopy =
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                        .flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder();
             flowModCopy.setDstField(flowModCopy2.getDstField());
             flowModCopy.setDstOfs(flowModCopy2.getDstOfs());
             flowModCopy.setSrcField(flowModCopy2.getSrcField());
             flowModCopy.setSrcOfs(flowModCopy2.getSrcOfs());
             flowModCopy.setFlowModNumBits(flowModCopy2.getFlowModNumBits());
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder 
-                caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .FlowModCopyFieldIntoFieldCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                    .openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                        .FlowModCopyFieldIntoFieldCaseBuilder();
             caseBuilder.setFlowModCopyFieldIntoField(flowModCopy.build());
             return caseBuilder.build();
         } else if (flowModSpec instanceof FlowModCopyValueIntoFieldCase) {
-            FlowModCopyValueIntoField flowModCopy2 = ((FlowModCopyValueIntoFieldCase) flowModSpec).getFlowModCopyValueIntoField();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder 
-                flowModCopy = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder();
+            FlowModCopyValueIntoField flowModCopy2 = ((FlowModCopyValueIntoFieldCase) flowModSpec)
+                    .getFlowModCopyValueIntoField();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder flowModCopy =
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                        .flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder();
             flowModCopy.setDstField(flowModCopy2.getDstField());
             flowModCopy.setDstOfs(flowModCopy2.getDstOfs());
             flowModCopy.setValue(flowModCopy2.getValue());
             flowModCopy.setFlowModNumBits(flowModCopy2.getFlowModNumBits());
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder 
-                caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .FlowModCopyValueIntoFieldCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                    .openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                        .FlowModCopyValueIntoFieldCaseBuilder();
             caseBuilder.setFlowModCopyValueIntoField(flowModCopy.build());
             return caseBuilder.build();
         } else if (flowModSpec instanceof FlowModOutputToPortCase) {
             FlowModOutputToPort flowModOut2 = ((FlowModOutputToPortCase) flowModSpec).getFlowModOutputToPort();
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.output.to.port._case.FlowModOutputToPortBuilder 
-                flowModOut = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.output.to.port._case.FlowModOutputToPortBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .flow.mod.output.to.port._case.FlowModOutputToPortBuilder flowModOut =
+                    new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec
+                        .flow.mod.spec.flow.mod.output.to.port._case.FlowModOutputToPortBuilder();
             flowModOut.setSrcField(flowModOut2.getSrcField());
             flowModOut.setSrcOfs(flowModOut2.getSrcOfs());
             flowModOut.setFlowModNumBits(flowModOut2.getFlowModNumBits());
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder 
-                caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder();
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec
+                .FlowModOutputToPortCaseBuilder caseBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight
+                    .openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder();
             caseBuilder.setFlowModOutputToPort(flowModOut.build());
             return caseBuilder.build();
         }
         return null;
     }
-
 }
index 71c681f488eec01ae4b9c097cff8ccb319d70142..be77173b5ea289e661fa41f26032d9ea9961be99 100644 (file)
@@ -32,14 +32,35 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.multipath.grouping.nx.multipath.DstBuilder;
 
 public class MultipathConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionMultipathGrouping);
+        NxActionMultipathGrouping nxAction = (NxActionMultipathGrouping) nxActionArg;
+
+        NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
+        nxActionMultipathBuilder.setFields(nxAction.getNxMultipath().getFields());
+        nxActionMultipathBuilder.setBasis(nxAction.getNxMultipath().getBasis());
+        nxActionMultipathBuilder.setAlgorithm(nxAction.getNxMultipath().getAlgorithm());
+        nxActionMultipathBuilder.setMaxLink(nxAction.getNxMultipath().getMaxLink());
+        nxActionMultipathBuilder.setArg(nxAction.getNxMultipath().getArg());
+        Dst dst = nxAction.getNxMultipath().getDst();
+        nxActionMultipathBuilder.setOfsNbits(dst.getStart() << 6 | dst.getEnd() - dst.getStart());
+        nxActionMultipathBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
+        ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
+        actionMultipathBuilder.setNxActionMultipath(nxActionMultipathBuilder.build());
+        return ActionUtil.createAction(actionMultipathBuilder.build());
+    }
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionMultipath action = ((ActionMultipath) input.getActionChoice()).getNxActionMultipath();
         DstBuilder dstBuilder = new DstBuilder();
-        dstBuilder.setDstChoice(RegMoveConvertor.resolveDst(action.getDst()));
+        dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(action.getDst()));
         dstBuilder.setStart(resolveStart(action.getOfsNbits()));
         dstBuilder.setEnd(resolveEnd(action.getOfsNbits()));
         NxMultipathBuilder builder = new NxMultipathBuilder();
@@ -57,54 +78,39 @@ public class MultipathConvertor implements
 
     private static int resolveEnd(final int ofsNBints) {
         int ofs = extractSub(ofsNBints, 10, 6);
-        int nBits = extractSub(ofsNBints, 6, 0);
-        return ofs + nBits;
+        int numBits = extractSub(ofsNBints, 6, 0);
+        return ofs + numBits;
     }
 
-    private static int extractSub(final int l, final int nrBits, final int offset) {
-        final int rightShifted = l >>> offset;
+    private static int extractSub(final int value, final int nrBits, final int offset) {
+        final int rightShifted = value >>> offset;
         final int mask = (1 << nrBits) - 1;
         return rightShifted & mask;
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxMultipath value, final ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxMultipath value, final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionMultipathNodesNodeTableFlowWriteActionsCaseBuilder().setNxMultipath(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxMultipath(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxMultipath(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxMultipath(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxMultipath(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionMultipathNotifGroupDescStatsUpdatedCaseBuilder().setNxMultipath(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxMultipath(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxMultipath(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxMultipath(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxMultipath(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionMultipathNodesNodeTableFlowApplyActionsCaseBuilder().setNxMultipath(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionMultipathGrouping);
-        NxActionMultipathGrouping nxAction = (NxActionMultipathGrouping) nxActionArg;
-
-        NxActionMultipathBuilder nxActionMultipathBuilder = new NxActionMultipathBuilder();
-        nxActionMultipathBuilder.setFields(nxAction.getNxMultipath().getFields());
-        nxActionMultipathBuilder.setBasis(nxAction.getNxMultipath().getBasis());
-        nxActionMultipathBuilder.setAlgorithm(nxAction.getNxMultipath().getAlgorithm());
-        nxActionMultipathBuilder.setMaxLink(nxAction.getNxMultipath().getMaxLink());
-        nxActionMultipathBuilder.setArg(nxAction.getNxMultipath().getArg());
-        Dst dst = nxAction.getNxMultipath().getDst();
-        nxActionMultipathBuilder.setOfsNbits((dst.getStart() << 6) | (dst.getEnd() - dst.getStart()));
-        nxActionMultipathBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
-        ActionMultipathBuilder actionMultipathBuilder = new ActionMultipathBuilder();
-        actionMultipathBuilder.setNxActionMultipath(nxActionMultipathBuilder.build());
-        return ActionUtil.createAction(actionMultipathBuilder.build());
-    }
-
 }
index 98cd4368917014cc79037c0c248d97907ef6c37e..e7d4ed758b96d0a730333b1583f04829d5a2aa80 100644 (file)
@@ -32,20 +32,20 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.output.reg.grouping.nx.output.reg.SrcBuilder;
 
 /**
- * Convert to/from openflowplugin model to openflowjava model for
- * OutputReg action
+ * Convert to/from openflowplugin model to openflowjava model for OutputReg action.
  *
  * @author readams
  */
 public class OutputRegConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionOutputReg action = ((ActionOutputReg) input.getActionChoice()).getNxActionOutputReg();
         SrcBuilder srcBuilder = new SrcBuilder();
-        srcBuilder.setSrcChoice(RegMoveConvertor.resolveSrc(action.getSrc()));
+        srcBuilder.setSrcChoice(RegMoveConvertor.resolveSrcValue(action.getSrc()));
         srcBuilder.setOfsNbits(action.getNBits());
         NxOutputRegBuilder builder = new NxOutputRegBuilder();
         builder.setSrc(srcBuilder.build());
@@ -53,33 +53,13 @@ public class OutputRegConvertor implements
         return resolveAction(builder.build(), path);
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxOutputReg value, final ActionPath path) {
-        switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
-                return new NxActionOutputRegNodesNodeTableFlowWriteActionsCaseBuilder().setNxOutputReg(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxOutputReg(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxOutputReg(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
-                return new NxActionOutputRegNotifGroupDescStatsUpdatedCaseBuilder().setNxOutputReg(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxOutputReg(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxOutputReg(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
-                return new NxActionOutputRegNodesNodeTableFlowApplyActionsCaseBuilder().setNxOutputReg(value).build();
-            default:
-                throw new CodecPreconditionException(path);
-        }
-    }
-
     @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
         Preconditions.checkArgument(nxActionArg instanceof NxActionOutputRegGrouping);
         NxActionOutputRegGrouping nxAction = (NxActionOutputRegGrouping) nxActionArg;
         Src src = nxAction.getNxOutputReg().getSrc();
-        ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
+        final ActionOutputRegBuilder builder = new ActionOutputRegBuilder();
         NxActionOutputRegBuilder nxActionOutputRegBuilder = new NxActionOutputRegBuilder();
         nxActionOutputRegBuilder.setSrc(RegMoveConvertor.resolveSrc(src.getSrcChoice()));
         nxActionOutputRegBuilder.setNBits(src.getOfsNbits());
@@ -88,4 +68,29 @@ public class OutputRegConvertor implements
         return ActionUtil.createAction(builder.build());
     }
 
-}
\ No newline at end of file
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxOutputReg value, final ActionPath path) {
+        switch (path) {
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
+                return new NxActionOutputRegNodesNodeTableFlowWriteActionsCaseBuilder().setNxOutputReg(value).build();
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxOutputReg(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxOutputReg(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
+                return new NxActionOutputRegNotifGroupDescStatsUpdatedCaseBuilder().setNxOutputReg(value).build();
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxOutputReg(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxOutputReg(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
+                return new NxActionOutputRegNodesNodeTableFlowApplyActionsCaseBuilder().setNxOutputReg(value).build();
+            default:
+                throw new CodecPreconditionException(path);
+        }
+    }
+}
index 2e26148d791f486614f7a67b843140cf36194b8d..e3eddf291f2172da114c333ed6a8b8cfa8fda862 100644 (file)
@@ -30,31 +30,27 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.pop.nsh.grouping.NxPopNshBuilder;
 
 public class PopNshConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
-    @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
-        NxActionPopNsh action = ((ActionPopNsh) input.getActionChoice()).getNxActionPopNsh();
-        NxPopNshBuilder builder = new NxPopNshBuilder();
-        return resolveAction(builder.build(), path);
-    }
-
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxPopNsh value, ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            NxPopNsh value, ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionPopNshNodesNodeTableFlowWriteActionsCaseBuilder().setNxPopNsh(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
                 return new NxActionPopNshNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxPopNsh(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
                 return new NxActionPopNshNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxPopNsh(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionPopNshNotifGroupDescStatsUpdatedCaseBuilder().setNxPopNsh(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionPopNshNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxPopNsh(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionPopNshNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxPopNsh(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionPopNshNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxPopNsh(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionPopNshNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxPopNsh(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionPopNshNodesNodeTableFlowApplyActionsCaseBuilder().setNxPopNsh(value).build();
             default:
                 throw new CodecPreconditionException(path);
@@ -62,7 +58,16 @@ public class PopNshConvertor implements
     }
 
     @Override
-    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            Action input, ActionPath path) {
+        NxActionPopNsh action = ((ActionPopNsh) input.getActionChoice()).getNxActionPopNsh();
+        NxPopNshBuilder builder = new NxPopNshBuilder();
+        return resolveAction(builder.build(), path);
+    }
+
+    @Override
+    public Action convert(
+            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
         Preconditions.checkArgument(nxActionArg instanceof NxActionPopNshGrouping);
         NxActionPopNshGrouping nxAction = (NxActionPopNshGrouping) nxActionArg;
         ActionPopNshBuilder builder = new ActionPopNshBuilder();
@@ -70,5 +75,4 @@ public class PopNshConvertor implements
         builder.setNxActionPopNsh(nxActionPopNshBuilder.build());
         return ActionUtil.createAction(builder.build());
     }
-
 }
index 4e87f6d50e5db53541ff9455d867b20da01fe2f5..63dc6f230b764bfa8fcf47336dcee6ecfe499d25 100644 (file)
@@ -30,31 +30,29 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.push.nsh.grouping.NxPushNshBuilder;
 
 public class PushNshConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
-    @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
-        NxActionPushNsh action = ((ActionPushNsh) input.getActionChoice()).getNxActionPushNsh();
-        NxPushNshBuilder builder = new NxPushNshBuilder();
-        return resolveAction(builder.build(), path);
-    }
-
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(NxPushNsh value, ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            NxPushNsh value, ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionPushNshNodesNodeTableFlowWriteActionsCaseBuilder().setNxPushNsh(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionPushNshNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxPushNsh(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionPushNshNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxPushNsh(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionPushNshNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxPushNsh(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionPushNshNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxPushNsh(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionPushNshNotifGroupDescStatsUpdatedCaseBuilder().setNxPushNsh(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionPushNshNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxPushNsh(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionPushNshNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxPushNsh(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionPushNshNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxPushNsh(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionPushNshNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxPushNsh(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionPushNshNodesNodeTableFlowApplyActionsCaseBuilder().setNxPushNsh(value).build();
             default:
                 throw new CodecPreconditionException(path);
@@ -62,7 +60,16 @@ public class PushNshConvertor implements
     }
 
     @Override
-    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            Action input, ActionPath path) {
+        NxActionPushNsh action = ((ActionPushNsh) input.getActionChoice()).getNxActionPushNsh();
+        NxPushNshBuilder builder = new NxPushNshBuilder();
+        return resolveAction(builder.build(), path);
+    }
+
+    @Override
+    public Action convert(
+            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
         Preconditions.checkArgument(nxActionArg instanceof NxActionPushNshGrouping);
         NxActionPushNshGrouping nxAction = (NxActionPushNshGrouping) nxActionArg;
         ActionPushNshBuilder builder = new ActionPushNshBuilder();
index d9341ff3382c7c24ccaaec95759e18b4bc5cc4bb..ee3bc42f9fce6f1db75a11485afe039880e938e4 100644 (file)
@@ -31,17 +31,38 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for NxActionRegLoad action.
+ *
  * @author msunal
  */
 public class RegLoadConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionRegLoadGrouping);
+
+        NxActionRegLoadGrouping nxAction = (NxActionRegLoadGrouping) nxActionArg;
+        Dst dst = nxAction.getNxRegLoad().getDst();
+
+
+        final ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
+        NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
+        nxActionRegLoadBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
+        nxActionRegLoadBuilder.setOfsNbits(dst.getStart() << 6 | dst.getEnd() - dst.getStart());
+        nxActionRegLoadBuilder.setValue(nxAction.getNxRegLoad().getValue());
+        actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
+        return ActionUtil.createAction(actionRegLoadBuilder.build());
+    }
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionRegLoad actionRegLoad = ((ActionRegLoad) input.getActionChoice()).getNxActionRegLoad();
         DstBuilder dstBuilder = new DstBuilder();
-        dstBuilder.setDstChoice(RegMoveConvertor.resolveDst(actionRegLoad.getDst()));
+        dstBuilder.setDstChoice(RegMoveConvertor.resolveDstValue(actionRegLoad.getDst()));
         dstBuilder.setStart(resolveStart(actionRegLoad.getOfsNbits()));
         dstBuilder.setEnd(resolveEnd(actionRegLoad.getOfsNbits()));
         NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
@@ -56,54 +77,39 @@ public class RegLoadConvertor implements
 
     private static int resolveEnd(final int ofsNBints) {
         int ofs = extractSub(ofsNBints, 10, 6);
-        int nBits = extractSub(ofsNBints, 6, 0);
-        return ofs + nBits;
+        int numBits = extractSub(ofsNBints, 6, 0);
+        return ofs + numBits;
     }
 
-    private static int extractSub(final int l, final int nrBits, final int offset) {
-        final int rightShifted = l >>> offset;
+    private static int extractSub(final int value, final int nrBits, final int offset) {
+        final int rightShifted = value >>> offset;
         final int mask = (1 << nrBits) - 1;
         return rightShifted & mask;
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxRegLoad value,
-                                                                                                                    final ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxRegLoad value, final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionRegLoadNodesNodeTableFlowWriteActionsCaseBuilder().setNxRegLoad(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxRegLoad(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxRegLoad(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxRegLoad(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxRegLoad(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionRegLoadNotifGroupDescStatsUpdatedCaseBuilder().setNxRegLoad(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxRegLoad(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxRegLoad(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxRegLoad(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxRegLoad(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegLoad(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionRegLoadGrouping);
-
-        NxActionRegLoadGrouping nxAction = (NxActionRegLoadGrouping) nxActionArg;
-        Dst dst = nxAction.getNxRegLoad().getDst();
-
-
-        ActionRegLoadBuilder actionRegLoadBuilder = new ActionRegLoadBuilder();
-        NxActionRegLoadBuilder nxActionRegLoadBuilder = new NxActionRegLoadBuilder();
-        nxActionRegLoadBuilder.setDst(RegMoveConvertor.resolveDst(dst.getDstChoice()));
-        nxActionRegLoadBuilder.setOfsNbits((dst.getStart() << 6) | (dst.getEnd() - dst.getStart()));
-        nxActionRegLoadBuilder.setValue(nxAction.getNxRegLoad().getValue());
-        actionRegLoadBuilder.setNxActionRegLoad(nxActionRegLoadBuilder.build());
-        return ActionUtil.createAction(actionRegLoadBuilder.build());
-    }
-
-
 }
index 4fdb0f9106f8ec7406e78948bb38e679caa8ca04..a108e67e8c423214fae828cb9e2b7f34305dd908 100644 (file)
@@ -165,22 +165,45 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfIpSrcCaseBuilder;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for NxActionRegMove action.
+ *
  * @author msunal
  * @author Josh Hershberg (jhershbe@redhat.com)
  */
 public class RegMoveConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
+
+    @Override
+    public Action convert(
+            org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionRegMoveGrouping);
+        NxActionRegMoveGrouping nxAction = (NxActionRegMoveGrouping) nxActionArg;
+
+        Dst dst = nxAction.getNxRegMove().getDst();
+        Src src = nxAction.getNxRegMove().getSrc();
+        final ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
+        NxActionRegMoveBuilder nxActionRegMove = new NxActionRegMoveBuilder();
+
+        nxActionRegMove.setDst(resolveDst(dst.getDstChoice()));
+        nxActionRegMove.setDstOfs(dst.getStart());
+        nxActionRegMove.setSrc(resolveSrc(src.getSrcChoice()));
+        nxActionRegMove.setSrcOfs(src.getStart());
+        nxActionRegMove.setNBits(dst.getEnd() - dst.getStart() + 1);
+        actionRegMoveBuilder.setNxActionRegMove(nxActionRegMove.build());
+        return ActionUtil.createAction(actionRegMoveBuilder.build());
+    }
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(Action input, ActionPath path) {
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            Action input, ActionPath path) {
         NxActionRegMove actionRegMove = ((ActionRegMove) input.getActionChoice()).getNxActionRegMove();
         DstBuilder dstBuilder = new DstBuilder();
-        dstBuilder.setDstChoice(resolveDst(actionRegMove.getDst()));
+        dstBuilder.setDstChoice(resolveDstValue(actionRegMove.getDst()));
         dstBuilder.setStart(actionRegMove.getDstOfs());
         dstBuilder.setEnd(actionRegMove.getDstOfs() + actionRegMove.getNBits() - 1);
         SrcBuilder srcBuilder = new SrcBuilder();
-        srcBuilder.setSrcChoice(resolveSrc(actionRegMove.getSrc()));
+        srcBuilder.setSrcChoice(resolveSrcValue(actionRegMove.getSrc()));
         srcBuilder.setStart(actionRegMove.getSrcOfs());
         srcBuilder.setEnd(actionRegMove.getSrcOfs() + actionRegMove.getNBits() - 1);
         NxRegMoveBuilder nxRegMoveBuilder = new NxRegMoveBuilder();
@@ -189,8 +212,8 @@ public class RegMoveConvertor implements
         return resolveAction(nxRegMoveBuilder.build(), path);
     }
 
-    public static DstChoice resolveDst(long dstValue) {
-        Class<? extends NxmNxReg> potentialDst = resolveReg(dstValue);
+    public static DstChoice resolveDstValue(long dstValue) {
+        Class<? extends NxmNxReg> potentialDst = resolveCodec(dstValue);
         if (potentialDst != null) {
             return new DstNxRegCaseBuilder().setNxReg(potentialDst).build();
         }
@@ -285,8 +308,8 @@ public class RegMoveConvertor implements
         throw new CodecPreconditionException("Missing codec for " + new NxmHeader(dstValue));
     }
 
-    static SrcChoice resolveSrc(long srcValue) {
-        Class<? extends NxmNxReg> potentialSrc = resolveReg(srcValue);
+    static SrcChoice resolveSrcValue(long srcValue) {
+        Class<? extends NxmNxReg> potentialSrc = resolveCodec(srcValue);
         if (potentialSrc != null) {
             return new SrcNxRegCaseBuilder().setNxReg(potentialSrc).build();
         }
@@ -378,7 +401,7 @@ public class RegMoveConvertor implements
         throw new CodecPreconditionException("Missing codec for " + new NxmHeader(srcValue));
     }
 
-    private static Class<? extends NxmNxReg> resolveReg(long value) {
+    private static Class<? extends NxmNxReg> resolveCodec(long value) {
         if (value == NiciraMatchCodecs.REG0_CODEC.getHeaderWithoutHasMask().toLong()) {
             return NxmNxReg0.class;
         }
@@ -409,44 +432,29 @@ public class RegMoveConvertor implements
     private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
             NxRegMove value, ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionRegMoveNodesNodeTableFlowWriteActionsCaseBuilder().setNxRegMove(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxRegMove(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxRegMove(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxRegMove(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxRegMove(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionRegMoveNotifGroupDescStatsUpdatedCaseBuilder().setNxRegMove(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxRegMove(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxRegMove(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxRegMove(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxRegMove(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegMove(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
 
-    @Override
-    public Action convert(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionRegMoveGrouping);
-        NxActionRegMoveGrouping nxAction = (NxActionRegMoveGrouping) nxActionArg;
-
-        Dst dst = nxAction.getNxRegMove().getDst();
-        Src src = nxAction.getNxRegMove().getSrc();
-        ActionRegMoveBuilder actionRegMoveBuilder = new ActionRegMoveBuilder();
-        NxActionRegMoveBuilder nxActionRegMove = new NxActionRegMoveBuilder();
-
-        nxActionRegMove.setDst(resolveDst(dst.getDstChoice()));
-        nxActionRegMove.setDstOfs(dst.getStart());
-        nxActionRegMove.setSrc(resolveSrc(src.getSrcChoice()));
-        nxActionRegMove.setSrcOfs(src.getStart());
-        nxActionRegMove.setNBits(dst.getEnd() - dst.getStart() + 1);
-        actionRegMoveBuilder.setNxActionRegMove(nxActionRegMove.build());
-        return ActionUtil.createAction(actionRegMoveBuilder.build());
-    }
-
     public static long resolveDst(DstChoice dstChoice) {
         if (dstChoice instanceof DstNxRegCase) {
             return resolveReg(((DstNxRegCase) dstChoice).getNxReg());
@@ -680,5 +688,4 @@ public class RegMoveConvertor implements
         }
         throw new CodecPreconditionException("Missing codec for nxm_nx_reg?" + reg);
     }
-
 }
index 940538d4e821630bbc3abcef9acf3b609046c61e..6491eaa1016ef1360e73ba38e29ef9123568dccf 100644 (file)
@@ -30,14 +30,28 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.resubmit.grouping.NxResubmitBuilder;
 
 /**
- * Convert to/from SAL flow model to openflowjava model for Resubmit action
+ * Convert to/from SAL flow model to openflowjava model for Resubmit action.
  */
 public class ResubmitConvertor implements
-        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action, Action>,
-        ConvertorActionFromOFJava<Action, ActionPath> {
+        ConvertorActionToOFJava<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action,
+            Action>, ConvertorActionFromOFJava<Action, ActionPath> {
 
     @Override
-    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
+    public Action convert(
+            final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
+        Preconditions.checkArgument(nxActionArg instanceof NxActionResubmitGrouping);
+        NxActionResubmitGrouping nxAction = (NxActionResubmitGrouping) nxActionArg;
+        ActionResubmitBuilder builder = new ActionResubmitBuilder();
+        NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
+        nxActionResubmitBuilder.setInPort(nxAction.getNxResubmit().getInPort());
+        nxActionResubmitBuilder.setTable(nxAction.getNxResubmit().getTable());
+        builder.setNxActionResubmit(nxActionResubmitBuilder.build());
+        return ActionUtil.createAction(builder.build());
+    }
+
+    @Override
+    public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(
+            final Action input, final ActionPath path) {
         NxActionResubmit action = ((ActionResubmit) input.getActionChoice()).getNxActionResubmit();
         NxResubmitBuilder builder = new NxResubmitBuilder();
         builder.setInPort(action.getInPort());
@@ -45,37 +59,29 @@ public class ResubmitConvertor implements
         return resolveAction(builder.build(), path);
     }
 
-    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(final NxResubmit value, final ActionPath path) {
+    private static org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action resolveAction(
+            final NxResubmit value, final ActionPath path) {
         switch (path) {
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS:
                 return new NxActionResubmitNodesNodeTableFlowWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder().setNxResubmit(value).build();
-            case GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION:
+            case FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS:
+                return new NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS:
+                return new NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case GROUP_DESC_STATS_UPDATED_BUCKET_ACTION:
                 return new NxActionResubmitNotifGroupDescStatsUpdatedCaseBuilder().setNxResubmit(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCaseBuilder().setNxResubmit(value).build();
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION:
-                return new NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCaseBuilder().setNxResubmit(value).build();
-            case NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION:
+            case FLOWS_STATISTICS_RPC_WRITE_ACTIONS:
+                return new NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case FLOWS_STATISTICS_RPC_APPLY_ACTIONS:
+                return new NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCaseBuilder()
+                        .setNxResubmit(value).build();
+            case INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS:
                 return new NxActionResubmitNodesNodeTableFlowApplyActionsCaseBuilder().setNxResubmit(value).build();
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public Action convert(final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nxActionArg) {
-        Preconditions.checkArgument(nxActionArg instanceof NxActionResubmitGrouping);
-        NxActionResubmitGrouping nxAction = (NxActionResubmitGrouping) nxActionArg;
-        ActionResubmitBuilder builder = new ActionResubmitBuilder();
-        NxActionResubmitBuilder nxActionResubmitBuilder = new NxActionResubmitBuilder();
-        nxActionResubmitBuilder.setInPort(nxAction.getNxResubmit().getInPort());
-        nxActionResubmitBuilder.setTable(nxAction.getNxResubmit().getTable());
-        builder.setNxActionResubmit(nxActionResubmitBuilder.build());
-        return ActionUtil.createAction(builder.build());
-    }
-
 }
index 6467dd712ad7694e2b368ae82cab069017a9f168..fd569699474a22b54b689ccc217a32c41e0b6243 100644 (file)
@@ -37,70 +37,53 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for ArpOpCase.
+ *
  * @author msunal
  */
 public class ArpOpConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        ArpOpCase arpOpCase = ((ArpOpCase) input.getMatchEntryValue());
+        ArpOpCase arpOpCase = (ArpOpCase) input.getMatchEntryValue();
         return resolveAugmentation(new NxmOfArpOpBuilder().setValue(arpOpCase.getArpOp().getOpCode()).build(), path,
                 NxmOfArpOpKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfArpOpGrouping> matchGrouping = MatchUtil.ARP_OP_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Integer value = matchGrouping.get().getNxmOfArpOp().getValue();
+        ArpOpCaseValueBuilder arpOpCaseValueBuilder = new ArpOpCaseValueBuilder();
+        arpOpCaseValueBuilder.setArpOpValues(new ArpOpValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx
+                .match.rev140421.NxmOfArpOp.class, Nxm0Class.class, arpOpCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfArpOp value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfArpOp(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfArpOp(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfArpOp(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfArpOp(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfArpOp(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfArpOpGrouping> matchGrouping = MatchUtil.arpOpResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Integer value = matchGrouping.get().getNxmOfArpOp().getValue();
-        ArpOpCaseValueBuilder arpOpCaseValueBuilder = new ArpOpCaseValueBuilder();
-        arpOpCaseValueBuilder.setArpOpValues(new ArpOpValuesBuilder()
-                .setValue(value).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpOp.class,
-                Nxm0Class.class,
-                arpOpCaseValueBuilder.build()).build();
-    }
-
 }
index 3a7875d46f9b099349283452a54ca513ccc283b7..f75749ad0e485151145ea1c163e8eaa23b37e01a 100644 (file)
@@ -38,70 +38,53 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for ArpShaCase.
+ *
  * @author msunal
  */
 public class ArpShaConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        ArpShaCaseValue arpShaCaseValue = ((ArpShaCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxArpShaBuilder().setMacAddress(arpShaCaseValue.getArpShaValues().getMacAddress()).build(), path,
-                NxmNxArpShaKey.class);
+        ArpShaCaseValue arpShaCaseValue = (ArpShaCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxArpShaBuilder().setMacAddress(arpShaCaseValue.getArpShaValues()
+                .getMacAddress()).build(), path, NxmNxArpShaKey.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxArpShaGrouping> matchGrouping = MatchUtil.ARP_SHA_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmNxArpSha().getMacAddress();
+        ArpShaCaseValueBuilder arpShaCaseValueBuilder = new ArpShaCaseValueBuilder();
+        arpShaCaseValueBuilder.setArpShaValues(new ArpShaValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx
+                .match.rev140421.NxmNxArpSha.class, Nxm1Class.class, arpShaCaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxArpSha value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxArpSha(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxArpSha(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxArpSha(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxArpSha(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxArpSha(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxArpShaGrouping> matchGrouping = MatchUtil.arpShaResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmNxArpSha().getMacAddress();
-        ArpShaCaseValueBuilder arpShaCaseValueBuilder = new ArpShaCaseValueBuilder();
-        arpShaCaseValueBuilder.setArpShaValues(new ArpShaValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpSha.class,
-                Nxm1Class.class,
-                arpShaCaseValueBuilder.build()).build();
-    }
-
 }
index d7990903b9755102159ee1ec5ea20c0d1af06ffe..9f05096cc95f462553807f43a6bc9427363a3146 100644 (file)
@@ -39,71 +39,54 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for ArpSpaCase.
+ *
  * @author msunal
  */
 public class ArpSpaConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        ArpSpaCaseValue arpSpaCaseValue = ((ArpSpaCaseValue) input.getMatchEntryValue());
+        ArpSpaCaseValue arpSpaCaseValue = (ArpSpaCaseValue) input.getMatchEntryValue();
         Ipv4Address ipv4Address = IpConverter.longToIpv4Address(arpSpaCaseValue.getArpSpaValues().getValue());
         return resolveAugmentation(new NxmOfArpSpaBuilder().setIpv4Address(ipv4Address).build(), path,
                 NxmOfArpSpaKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfArpSpaGrouping> matchGrouping = MatchUtil.ARP_SPA_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = IpConverter.ipv4AddressToLong(matchGrouping.get().getNxmOfArpSpa().getIpv4Address());
+        ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder();
+        arpSpaCaseValueBuilder.setArpSpaValues(new ArpSpaValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx
+                .match.rev140421.NxmOfArpSpa.class, Nxm0Class.class, arpSpaCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfArpSpa value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfArpSpa(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfArpSpa(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfArpSpa(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfArpSpa(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfArpSpa(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfArpSpaGrouping> matchGrouping = MatchUtil.arpSpaResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = IpConverter.Ipv4AddressToLong(matchGrouping.get().getNxmOfArpSpa().getIpv4Address());
-        ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder();
-        arpSpaCaseValueBuilder.setArpSpaValues(new ArpSpaValuesBuilder()
-                .setValue(value).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpSpa.class,
-                Nxm0Class.class,
-                arpSpaCaseValueBuilder.build()).build();
-    }
-
 }
index 266af54d8e82ddd897a2a3aef9092bcde8946f1d..ef161c0b54ad05f197112bed6a6de29819d87001 100644 (file)
@@ -38,71 +38,55 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for ArpThaCase.
+ *
  * @author msunal
  */
 public class ArpThaConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        ArpThaCaseValue arpThaCaseValue = ((ArpThaCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxArpThaBuilder().setMacAddress(arpThaCaseValue.getArpThaValues().getMacAddress()).build(), path,
+        ArpThaCaseValue arpThaCaseValue = (ArpThaCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(
+                new NxmNxArpThaBuilder().setMacAddress(arpThaCaseValue.getArpThaValues().getMacAddress()).build(), path,
                 NxmNxArpThaKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxArpThaGrouping> matchGrouping = MatchUtil.ARP_THA_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmNxArpTha().getMacAddress();
+        ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder();
+        arpThaCaseValueBuilder.setArpThaValues(new ArpThaValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx
+                .match.rev140421.NxmNxArpTha.class, Nxm1Class.class, arpThaCaseValueBuilder.build()).build();
+
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxArpTha value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxArpTha(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxArpTha(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxArpTha(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxArpTha(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxArpTha(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxArpThaGrouping> matchGrouping = MatchUtil.arpThaResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmNxArpTha().getMacAddress();
-        ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder();
-        arpThaCaseValueBuilder.setArpThaValues(new ArpThaValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxArpTha.class,
-                Nxm1Class.class,
-                arpThaCaseValueBuilder.build()).build();
-
-    }
-
 }
index d147ba5b8e8aba5d4ecafbcc1a7221744dc74ae5..66fcd44079966ce083cb2d5429d775f739c4e3e9 100644 (file)
@@ -39,71 +39,55 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for ArpTpaCase.
+ *
  * @author msunal
  */
 public class ArpTpaConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        ArpTpaCaseValue arpTpaCaseValue = ((ArpTpaCaseValue) input.getMatchEntryValue());
+        ArpTpaCaseValue arpTpaCaseValue = (ArpTpaCaseValue) input.getMatchEntryValue();
         Ipv4Address ipv4Address = IpConverter.longToIpv4Address(arpTpaCaseValue.getArpTpaValues().getValue());
         return resolveAugmentation(new NxmOfArpTpaBuilder().setIpv4Address(ipv4Address).build(), path,
                 NxmOfArpTpaKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfArpTpaGrouping> matchGrouping = MatchUtil.ARP_TPA_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = IpConverter.ipv4AddressToLong(matchGrouping.get().getNxmOfArpTpa().getIpv4Address());
+        ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder();
+        arpTpaCaseValueBuilder.setArpTpaValues(new ArpTpaValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpTpa.class,
+                Nxm0Class.class, arpTpaCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfArpTpa value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfArpTpa(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfArpTpa(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfArpTpa(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfArpTpa(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfArpTpa(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfArpTpaGrouping> matchGrouping = MatchUtil.arpTpaResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = IpConverter.Ipv4AddressToLong(matchGrouping.get().getNxmOfArpTpa().getIpv4Address());
-        ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder();
-        arpTpaCaseValueBuilder.setArpTpaValues(new ArpTpaValuesBuilder()
-                .setValue(value).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfArpTpa.class,
-                Nxm0Class.class,
-                arpTpaCaseValueBuilder.build()).build();
-    }
-
 }
index 2e7e566e029df9bdb2d37cee03ffb6be4ccd4b9d..6b39053b2044cac60b192e35a2f0eef8068da379 100755 (executable)
@@ -69,7 +69,7 @@ public class CtMarkConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
      */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmNxCtMarkGrouping> matchGrouping = MatchUtil.ctMarkResolver.getExtension(extension);
+        Optional<NxmNxCtMarkGrouping> matchGrouping = MatchUtil.CT_MARK_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -89,19 +89,19 @@ public class CtMarkConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxCtMark value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxCtMark(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxCtMark(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxCtMark(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxCtMark(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxCtMark(value).build(), key);
             default:
index dc7aa112ad546ee0a74e52f44045c41b37a5aeb9..71d81c567b8c98ff1faf967dc77cbc75ff7f58fe 100644 (file)
@@ -39,22 +39,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for CtStateCase.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class CtStateConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        CtStateCaseValue ctStateCaseValue = ((CtStateCaseValue) input.getMatchEntryValue());
+        CtStateCaseValue ctStateCaseValue = (CtStateCaseValue) input.getMatchEntryValue();
         NxmNxCtStateBuilder ctStateBuilder = new NxmNxCtStateBuilder();
         ctStateBuilder.setCtState(ctStateCaseValue.getCtStateValues().getCtState());
         ctStateBuilder.setMask(ctStateCaseValue.getCtStateValues().getMask());
@@ -62,18 +55,9 @@ public class CtStateConvertor implements ConvertorToOFJava<MatchEntry>, Converto
                 NxmNxCtStateKey.class);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmNxCtStateGrouping> matchGrouping = MatchUtil.ctStateResolver.getExtension(extension);
+        Optional<NxmNxCtStateGrouping> matchGrouping = MatchUtil.CT_STATE_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -93,19 +77,19 @@ public class CtStateConvertor implements ConvertorToOFJava<MatchEntry>, Converto
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxCtState value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxCtState(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxCtState(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxCtState(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxCtState(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxCtState(value).build(), key);
             default:
index c8062296741d79e063ddeb55fa3b4c5767702461..62e064a224eacdde9457b4099edd75220b0b6057 100644 (file)
@@ -39,40 +39,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for CtZoneCase.
+ *
  * @author Aswin Suryanarayanan.
  */
-
 public class CtZoneConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        CtZoneCaseValue ctZoneCaseValue = ((CtZoneCaseValue) input.getMatchEntryValue());
+        CtZoneCaseValue ctZoneCaseValue = (CtZoneCaseValue) input.getMatchEntryValue();
         NxmNxCtZoneBuilder ctZoneBuilder = new NxmNxCtZoneBuilder();
         ctZoneBuilder.setCtZone(ctZoneCaseValue.getCtZoneValues().getCtZone());
         return resolveAugmentation(ctZoneBuilder.build(), path,
                 NxmNxCtZoneKey.class);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmNxCtZoneGrouping> matchGrouping = MatchUtil.ctZoneResolver.getExtension(extension);
+        Optional<NxmNxCtZoneGrouping> matchGrouping = MatchUtil.CT_ZONE_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -90,19 +74,19 @@ public class CtZoneConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxCtZone value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxCtZone(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxCtZone(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxCtZone(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxCtZone(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxCtZone(value).build(), key);
             default:
index e4fbfec8e42261da804293b256e4cd7449a82ad4..40f3169575895f81f686ec6bcabf438fbcd6dd97 100644 (file)
@@ -39,66 +39,49 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 public class EncapEthDstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EncapEthDstCaseValue encapEthDstCaseValue = ((EncapEthDstCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxEncapEthDstBuilder().setMacAddress(encapEthDstCaseValue.getEncapEthDstValues().getMacAddress()).build(), path,
+        EncapEthDstCaseValue encapEthDstCaseValue = (EncapEthDstCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxEncapEthDstBuilder()
+                .setMacAddress(encapEthDstCaseValue.getEncapEthDstValues().getMacAddress()).build(), path,
                 NxmNxEncapEthDstKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxEncapEthDstGrouping> matchGrouping = MatchUtil.ENCAP_ETH_DST_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthDst().getMacAddress();
+        EncapEthDstCaseValueBuilder encapEthDstCaseValueBuilder = new EncapEthDstCaseValueBuilder();
+        encapEthDstCaseValueBuilder.setEncapEthDstValues(new EncapEthDstValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthDst.class,
+                Nxm1Class.class, encapEthDstCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxEncapEthDst value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxEncapEthDst(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxEncapEthDst(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxEncapEthDst(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxEncapEthDst(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxEncapEthDst(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxEncapEthDstGrouping> matchGrouping = MatchUtil.encapEthDstResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthDst().getMacAddress();
-        EncapEthDstCaseValueBuilder encapEthDstCaseValueBuilder = new EncapEthDstCaseValueBuilder();
-        encapEthDstCaseValueBuilder.setEncapEthDstValues(new EncapEthDstValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthDst.class,
-                Nxm1Class.class,
-                encapEthDstCaseValueBuilder.build()).build();
-    }
-
 }
index 989451a5d98be6a873f8e5d4a69ef4e666e186c7..f7dd9d314881759f68dcc0cf735838ce96753545 100644 (file)
@@ -39,66 +39,49 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 public class EncapEthSrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EncapEthSrcCaseValue encapEthSrcCaseValue = ((EncapEthSrcCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxEncapEthSrcBuilder().setMacAddress(encapEthSrcCaseValue.getEncapEthSrcValues().getMacAddress()).build(), path,
+        EncapEthSrcCaseValue encapEthSrcCaseValue = (EncapEthSrcCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxEncapEthSrcBuilder()
+                .setMacAddress(encapEthSrcCaseValue.getEncapEthSrcValues().getMacAddress()).build(), path,
                 NxmNxEncapEthSrcKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxEncapEthSrcGrouping> matchGrouping = MatchUtil.ENCAP_ETH_SRC_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthSrc().getMacAddress();
+        EncapEthSrcCaseValueBuilder encapEthSrcCaseValueBuilder = new EncapEthSrcCaseValueBuilder();
+        encapEthSrcCaseValueBuilder.setEncapEthSrcValues(new EncapEthSrcValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthSrc.class,
+                Nxm1Class.class, encapEthSrcCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxEncapEthSrc value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxEncapEthSrc(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxEncapEthSrc(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxEncapEthSrc(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxEncapEthSrc(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxEncapEthSrc(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxEncapEthSrcGrouping> matchGrouping = MatchUtil.encapEthSrcResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmNxEncapEthSrc().getMacAddress();
-        EncapEthSrcCaseValueBuilder encapEthSrcCaseValueBuilder = new EncapEthSrcCaseValueBuilder();
-        encapEthSrcCaseValueBuilder.setEncapEthSrcValues(new EncapEthSrcValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthSrc.class,
-                Nxm1Class.class,
-                encapEthSrcCaseValueBuilder.build()).build();
-    }
-
 }
index c27f2e0bd52ed081d38add94b8a88d378b787fc8..deb41e048465050d3d5f34dee9ae4db6fdae9b7a 100644 (file)
@@ -37,53 +37,53 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.encap.eth.type.grouping.NxmNxEncapEthTypeBuilder;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
-public class EncapEthTypeConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
+public class EncapEthTypeConvertor
+        implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EncapEthTypeCaseValue encapEthTypeCaseValue = ((EncapEthTypeCaseValue) input.getMatchEntryValue());
+        EncapEthTypeCaseValue encapEthTypeCaseValue = (EncapEthTypeCaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxEncapEthTypeBuilder().setValue(encapEthTypeCaseValue.getEncapEthTypeValues().getEncapEthType()).build(), path,
+        return resolveAugmentation(new NxmNxEncapEthTypeBuilder()
+                .setValue(encapEthTypeCaseValue.getEncapEthTypeValues().getEncapEthType()).build(), path,
                 NxmNxEncapEthTypeKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxEncapEthTypeGrouping> matchGrouping = MatchUtil.ENCAP_ETH_TYPE_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Integer value = matchGrouping.get().getNxmNxEncapEthType().getValue();
+        EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
+        encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder()
+                .setEncapEthType(value).build());
+
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthType.class,
+                Nxm1Class.class, encapEthTypeCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxEncapEthType value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxEncapEthType(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxEncapEthType(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxEncapEthType(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxEncapEthType(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxEncapEthType(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxEncapEthTypeGrouping> matchGrouping = MatchUtil.encapEthTypeResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Integer value = matchGrouping.get().getNxmNxEncapEthType().getValue();
-        EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
-        encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder()
-                .setEncapEthType(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthType.class,
-                Nxm1Class.class,
-                encapEthTypeCaseValueBuilder.build()).build();
-    }
-
 }
index 3b9991bae2f9ab2b3e401374a412831a9edecaf4..30800db56711f8152be795b4f63bc2fbad7848aa 100644 (file)
@@ -38,70 +38,55 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for EthDstCase.
+ *
  * @author msunal
  */
 public class EthDstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EthDstCaseValue ethDstCaseValue = ((EthDstCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmOfEthDstBuilder().setMacAddress(ethDstCaseValue.getEthDstValues().getMacAddress()).build(), path,
+        EthDstCaseValue ethDstCaseValue = (EthDstCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(
+                new NxmOfEthDstBuilder().setMacAddress(ethDstCaseValue.getEthDstValues().getMacAddress()).build(), path,
                 NxmOfEthDstKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfEthDstGrouping> matchGrouping = MatchUtil.ETH_DST_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmOfEthDst().getMacAddress();
+        EthDstCaseValueBuilder ethDstCaseValueBuilder = new EthDstCaseValueBuilder();
+        ethDstCaseValueBuilder.setEthDstValues(new EthDstValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthDst.class,
+                Nxm0Class.class, ethDstCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfEthDst value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfEthDst(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfEthDst(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfEthDst(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfEthDst(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfEthDst(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfEthDstGrouping> matchGrouping = MatchUtil.ethDstResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmOfEthDst().getMacAddress();
-        EthDstCaseValueBuilder ethDstCaseValueBuilder = new EthDstCaseValueBuilder();
-        ethDstCaseValueBuilder.setEthDstValues(new EthDstValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthDst.class,
-                Nxm0Class.class,
-                ethDstCaseValueBuilder.build()).build();
-    }
-
 }
index 4ceebe8033de64bdc0841405ca260f09f309e2cd..b061caa0d9f48841d495615d0957e9dc0360545d 100644 (file)
@@ -38,70 +38,55 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for EthSrcCase.
+ *
  * @author msunal
  */
 public class EthSrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EthSrcCaseValue ethSrcCaseValue = ((EthSrcCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmOfEthSrcBuilder().setMacAddress(ethSrcCaseValue.getEthSrcValues().getMacAddress()).build(), path,
+        EthSrcCaseValue ethSrcCaseValue = (EthSrcCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(
+                new NxmOfEthSrcBuilder().setMacAddress(ethSrcCaseValue.getEthSrcValues().getMacAddress()).build(), path,
                 NxmOfEthSrcKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfEthSrcGrouping> matchGrouping = MatchUtil.ETH_SRC_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        MacAddress macAddress = matchGrouping.get().getNxmOfEthSrc().getMacAddress();
+        EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder();
+        ethSrcCaseValueBuilder.setEthSrcValues(new EthSrcValuesBuilder()
+                .setMacAddress(macAddress).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthSrc.class,
+                Nxm0Class.class, ethSrcCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfEthSrc value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfEthSrc(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfEthSrc(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfEthSrc(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfEthSrc(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfEthSrc(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfEthSrcGrouping> matchGrouping = MatchUtil.ethSrcResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        MacAddress macAddress = matchGrouping.get().getNxmOfEthSrc().getMacAddress();
-        EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder();
-        ethSrcCaseValueBuilder.setEthSrcValues(new EthSrcValuesBuilder()
-                .setMacAddress(macAddress).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthSrc.class,
-                Nxm0Class.class,
-                ethSrcCaseValueBuilder.build()).build();
-    }
-
 }
index 950ec0b5e8ef201d53725c4bddb8cc04bc2ef10f..cc510bd6784d635e3e8ef1b0a04b425247271043 100644 (file)
@@ -37,71 +37,56 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for EthTypeCase.
+ *
  * @author msunal
  */
 public class EthTypeConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        EthTypeCaseValue ethTypeCaseValue = ((EthTypeCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmOfEthTypeBuilder().setValue(ethTypeCaseValue.getEthTypeValues().getValue()).build(), path,
+        EthTypeCaseValue ethTypeCaseValue = (EthTypeCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(
+                new NxmOfEthTypeBuilder().setValue(ethTypeCaseValue.getEthTypeValues().getValue()).build(), path,
                 NxmOfEthTypeKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmOfEthTypeGrouping> matchGrouping = MatchUtil.ETH_TYPE_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Integer value = matchGrouping.get().getNxmOfEthType().getValue();
+        EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder();
+        ethTypeCaseValueBuilder.setEthTypeValues(new EthTypeValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthType.class,
+                Nxm0Class.class, ethTypeCaseValueBuilder.build()).build();
+
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfEthType value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfEthType(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfEthType(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfEthType(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfEthType(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfEthType(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmOfEthTypeGrouping> matchGrouping = MatchUtil.ethTypeResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Integer value = matchGrouping.get().getNxmOfEthType().getValue();
-        EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder();
-        ethTypeCaseValueBuilder.setEthTypeValues(new EthTypeValuesBuilder()
-                .setValue(value).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthType.class,
-                Nxm0Class.class,
-                ethTypeCaseValueBuilder.build()).build();
-
-    }
-
 }
index 9f3723b132e24fcae99267ff3665f055ddfb9ae7..836d2e17f6b601c9f13bb1bd2f242e10f5e089de 100644 (file)
@@ -64,126 +64,130 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
- * @author msunal
+ * Match utilities.
  *
+ * @author msunal
  */
-public class MatchUtil {
+public final class MatchUtil {
     private static final Splitter SPLITTER = Splitter.on('.');
     private static final Joiner JOINER = Joiner.on('.');
 
-    private final static Set<Class<? extends Augmentation<Extension>>> augmentationsOfExtension = new HashSet<>();
-    public final static GroupingResolver<NxmNxRegGrouping, Extension> regResolver = new GroupingResolver<>(
+    private static final Set<Class<? extends Augmentation<Extension>>> AUGMENTATIONS_OF_EXTENSION = new HashSet<>();
+    public static final GroupingResolver<NxmNxRegGrouping, Extension> REG_RESOLVER = new GroupingResolver<>(
             NxmNxRegGrouping.class);
-    public final static GroupingResolver<NxmNxTunIdGrouping, Extension> tunIdResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxTunIdGrouping, Extension> TUN_ID_RESOLVER = new GroupingResolver<>(
             NxmNxTunIdGrouping.class);
-    public final static GroupingResolver<NxmNxArpShaGrouping, Extension> arpShaResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxArpShaGrouping, Extension> ARP_SHA_RESOLVER = new GroupingResolver<>(
             NxmNxArpShaGrouping.class);
-    public final static GroupingResolver<NxmNxArpThaGrouping, Extension> arpThaResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxArpThaGrouping, Extension> ARP_THA_RESOLVER = new GroupingResolver<>(
             NxmNxArpThaGrouping.class);
-    public final static GroupingResolver<NxmOfArpOpGrouping, Extension> arpOpResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfArpOpGrouping, Extension> ARP_OP_RESOLVER = new GroupingResolver<>(
             NxmOfArpOpGrouping.class);
-    public final static GroupingResolver<NxmOfArpSpaGrouping, Extension> arpSpaResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfArpSpaGrouping, Extension> ARP_SPA_RESOLVER = new GroupingResolver<>(
             NxmOfArpSpaGrouping.class);
-    public final static GroupingResolver<NxmOfArpTpaGrouping, Extension> arpTpaResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfArpTpaGrouping, Extension> ARP_TPA_RESOLVER = new GroupingResolver<>(
             NxmOfArpTpaGrouping.class);
-    public final static GroupingResolver<NxmNxTunIpv4DstGrouping, Extension> tunIpv4DstResolver = new GroupingResolver<>(
-            NxmNxTunIpv4DstGrouping.class);
-    public final static GroupingResolver<NxmNxTunIpv4SrcGrouping, Extension> tunIpv4SrcResolver = new GroupingResolver<>(
-            NxmNxTunIpv4SrcGrouping.class);
-    public final static GroupingResolver<NxmOfEthDstGrouping, Extension> ethDstResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxTunIpv4DstGrouping, Extension> TUN_IPV4_DST_RESOLVER =
+            new GroupingResolver<>(NxmNxTunIpv4DstGrouping.class);
+    public static final GroupingResolver<NxmNxTunIpv4SrcGrouping, Extension> TUN_IPV4_SRC_RESOLVER =
+            new GroupingResolver<>(NxmNxTunIpv4SrcGrouping.class);
+    public static final GroupingResolver<NxmOfEthDstGrouping, Extension> ETH_DST_RESOLVER = new GroupingResolver<>(
             NxmOfEthDstGrouping.class);
-    public final static GroupingResolver<NxmOfEthSrcGrouping, Extension> ethSrcResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfEthSrcGrouping, Extension> ETH_SRC_RESOLVER = new GroupingResolver<>(
             NxmOfEthSrcGrouping.class);
-    public final static GroupingResolver<NxmOfEthTypeGrouping, Extension> ethTypeResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfEthTypeGrouping, Extension> ETH_TYPE_RESOLVER = new GroupingResolver<>(
             NxmOfEthTypeGrouping.class);
-    public final static GroupingResolver<NxmNxNsiGrouping, Extension> nsiResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNsiGrouping, Extension> NSI_RESOLVER = new GroupingResolver<>(
             NxmNxNsiGrouping.class);
-    public final static GroupingResolver<NxmNxNspGrouping, Extension> nspResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNspGrouping, Extension> NSP_RESOLVER = new GroupingResolver<>(
             NxmNxNspGrouping.class);
-    public final static GroupingResolver<NxmNxNshc1Grouping, Extension> nsc1Resolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNshc1Grouping, Extension> NSC1_RESOLVER = new GroupingResolver<>(
             NxmNxNshc1Grouping.class);
-    public final static GroupingResolver<NxmNxNshc2Grouping, Extension> nsc2Resolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNshc2Grouping, Extension> NSC2_RESOLVER = new GroupingResolver<>(
             NxmNxNshc2Grouping.class);
-    public final static GroupingResolver<NxmNxNshc3Grouping, Extension> nsc3Resolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNshc3Grouping, Extension> NSC3_RESOLVER = new GroupingResolver<>(
             NxmNxNshc3Grouping.class);
-    public final static GroupingResolver<NxmNxNshc4Grouping, Extension> nsc4Resolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxNshc4Grouping, Extension> NSC4_RESOLVER = new GroupingResolver<>(
             NxmNxNshc4Grouping.class);
-    public final static GroupingResolver<NxmNxEncapEthTypeGrouping, Extension> encapEthTypeResolver = new GroupingResolver<>(
-            NxmNxEncapEthTypeGrouping.class);
-    public final static GroupingResolver<NxmNxEncapEthSrcGrouping, Extension> encapEthSrcResolver = new GroupingResolver<>(
-            NxmNxEncapEthSrcGrouping.class);
-    public final static GroupingResolver<NxmNxEncapEthDstGrouping, Extension> encapEthDstResolver = new GroupingResolver<>(
-            NxmNxEncapEthDstGrouping.class);
-    public final static GroupingResolver<NxmNxNshMdtypeGrouping, Extension> nshMdtypeResolver = new GroupingResolver<>(
-            NxmNxNshMdtypeGrouping.class);
-    public final static GroupingResolver<NxmNxNshNpGrouping, Extension> nshNpResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxEncapEthTypeGrouping, Extension> ENCAP_ETH_TYPE_RESOLVER =
+            new GroupingResolver<>(NxmNxEncapEthTypeGrouping.class);
+    public static final GroupingResolver<NxmNxEncapEthSrcGrouping, Extension> ENCAP_ETH_SRC_RESOLVER =
+            new GroupingResolver<>(NxmNxEncapEthSrcGrouping.class);
+    public static final GroupingResolver<NxmNxEncapEthDstGrouping, Extension> ENCAP_ETH_DST_RESOLVER =
+            new GroupingResolver<>(NxmNxEncapEthDstGrouping.class);
+    public static final GroupingResolver<NxmNxNshMdtypeGrouping, Extension> NSH_MDTYPE_RESOLVER =
+            new GroupingResolver<>(NxmNxNshMdtypeGrouping.class);
+    public static final GroupingResolver<NxmNxNshNpGrouping, Extension> NSH_NP_RESOLVER = new GroupingResolver<>(
             NxmNxNshNpGrouping.class);
-    public final static GroupingResolver<NxmNxTunGpeNpGrouping, Extension> tunGpeNpResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxTunGpeNpGrouping, Extension> TUN_GPE_NP_RESOLVER = new GroupingResolver<>(
             NxmNxTunGpeNpGrouping.class);
-    public final static GroupingResolver<NxmOfTcpSrcGrouping, Extension> tcpSrcResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfTcpSrcGrouping, Extension> TCP_SRC_RESOLVER = new GroupingResolver<>(
             NxmOfTcpSrcGrouping.class);
-    public final static GroupingResolver<NxmOfTcpDstGrouping, Extension> tcpDstResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfTcpDstGrouping, Extension> TCP_DST_RESOLVER = new GroupingResolver<>(
             NxmOfTcpDstGrouping.class);
-    public final static GroupingResolver<NxmOfUdpSrcGrouping, Extension> udpSrcResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfUdpSrcGrouping, Extension> UDP_SRC_RESOLVER = new GroupingResolver<>(
             NxmOfUdpSrcGrouping.class);
-    public final static GroupingResolver<NxmOfUdpDstGrouping, Extension> udpDstResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmOfUdpDstGrouping, Extension> UDP_DST_RESOLVER = new GroupingResolver<>(
             NxmOfUdpDstGrouping.class);
-    public final static GroupingResolver<NxmNxCtMarkGrouping, Extension> ctMarkResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxCtMarkGrouping, Extension> CT_MARK_RESOLVER = new GroupingResolver<>(
             NxmNxCtMarkGrouping.class);
-    public final static GroupingResolver<NxmNxCtStateGrouping, Extension> ctStateResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxCtStateGrouping, Extension> CT_STATE_RESOLVER = new GroupingResolver<>(
             NxmNxCtStateGrouping.class);
-    public final static GroupingResolver<NxmNxCtZoneGrouping, Extension> ctZoneResolver = new GroupingResolver<>(
+    public static final GroupingResolver<NxmNxCtZoneGrouping, Extension> CT_ZONE_RESOLVER = new GroupingResolver<>(
             NxmNxCtZoneGrouping.class);
-    public final static GroupingResolver<NxmOfInPortGrouping, Extension> nxmOfInportResolver = new GroupingResolver<>(
-            NxmOfInPortGrouping.class);
+    public static final GroupingResolver<NxmOfInPortGrouping, Extension> NXM_OF_INPORT_RESOLVER =
+            new GroupingResolver<>(NxmOfInPortGrouping.class);
 
     static {
-        augmentationsOfExtension.add(NxAugMatchRpcAddFlow.class);
-        augmentationsOfExtension.add(NxAugMatchRpcRemoveFlow.class);
-        augmentationsOfExtension.add(NxAugMatchRpcUpdateFlowOriginal.class);
-        augmentationsOfExtension.add(NxAugMatchRpcUpdateFlowUpdated.class);
-        augmentationsOfExtension.add(NxAugMatchNodesNodeTableFlow.class);
-        augmentationsOfExtension.add(NxAugMatchNotifSwitchFlowRemoved.class);
-        augmentationsOfExtension.add(NxAugMatchNotifPacketIn.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchRpcAddFlow.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchRpcRemoveFlow.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchRpcUpdateFlowOriginal.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchRpcUpdateFlowUpdated.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchNodesNodeTableFlow.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchNotifSwitchFlowRemoved.class);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchNotifPacketIn.class);
         //augmentationsOfExtension.add(NxAugMatchNotifUpdateFlowStats.class);
-        augmentationsOfExtension.add(NxAugMatchPacketInMessage.class);
-        regResolver.setAugmentations(augmentationsOfExtension);
-        tunIdResolver.setAugmentations(augmentationsOfExtension);
-        arpShaResolver.setAugmentations(augmentationsOfExtension);
-        arpThaResolver.setAugmentations(augmentationsOfExtension);
-        arpOpResolver.setAugmentations(augmentationsOfExtension);
-        arpSpaResolver.setAugmentations(augmentationsOfExtension);
-        arpTpaResolver.setAugmentations(augmentationsOfExtension);
-        tunIpv4DstResolver.setAugmentations(augmentationsOfExtension);
-        tunIpv4SrcResolver.setAugmentations(augmentationsOfExtension);
-        ethDstResolver.setAugmentations(augmentationsOfExtension);
-        ethSrcResolver.setAugmentations(augmentationsOfExtension);
-        ethTypeResolver.setAugmentations(augmentationsOfExtension);
-        nspResolver.setAugmentations(augmentationsOfExtension);
-        nsiResolver.setAugmentations(augmentationsOfExtension);
-        nsc1Resolver.setAugmentations(augmentationsOfExtension);
-        nsc2Resolver.setAugmentations(augmentationsOfExtension);
-        nsc3Resolver.setAugmentations(augmentationsOfExtension);
-        nsc4Resolver.setAugmentations(augmentationsOfExtension);
-        encapEthTypeResolver.setAugmentations(augmentationsOfExtension);
-        encapEthSrcResolver.setAugmentations(augmentationsOfExtension);
-        encapEthDstResolver.setAugmentations(augmentationsOfExtension);
-        nshMdtypeResolver.setAugmentations(augmentationsOfExtension);
-        nshNpResolver.setAugmentations(augmentationsOfExtension);
-        tunGpeNpResolver.setAugmentations(augmentationsOfExtension);
-        tcpSrcResolver.setAugmentations(augmentationsOfExtension);
-        tcpDstResolver.setAugmentations(augmentationsOfExtension);
-        udpSrcResolver.setAugmentations(augmentationsOfExtension);
-        udpDstResolver.setAugmentations(augmentationsOfExtension);
-        ctStateResolver.setAugmentations(augmentationsOfExtension);
-        ctZoneResolver.setAugmentations(augmentationsOfExtension);
-        nxmOfInportResolver.setAugmentations(augmentationsOfExtension);
-        ctMarkResolver.setAugmentations(augmentationsOfExtension);
+        AUGMENTATIONS_OF_EXTENSION.add(NxAugMatchPacketInMessage.class);
+        REG_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TUN_ID_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ARP_SHA_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ARP_THA_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ARP_OP_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ARP_SPA_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ARP_TPA_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TUN_IPV4_DST_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TUN_IPV4_SRC_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ETH_DST_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ETH_SRC_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ETH_TYPE_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSP_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSI_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSC1_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSC2_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSC3_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSC4_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ENCAP_ETH_TYPE_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ENCAP_ETH_SRC_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        ENCAP_ETH_DST_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSH_MDTYPE_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NSH_NP_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TUN_GPE_NP_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TCP_SRC_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        TCP_DST_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        UDP_SRC_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        UDP_DST_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        CT_STATE_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        CT_ZONE_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        NXM_OF_INPORT_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+        CT_MARK_RESOLVER.setAugmentations(AUGMENTATIONS_OF_EXTENSION);
+    }
+
+    private MatchUtil() {
     }
 
     public static MatchEntryBuilder createDefaultMatchEntryBuilder(Class<? extends MatchField> matchField,
                                                                    Class<? extends OxmClassBase> oxmClass,
-                                                                   MatchEntryValue matchEntryValue){
+                                                                   MatchEntryValue matchEntryValue) {
         MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
         matchEntryBuilder.setHasMask(false);
         matchEntryBuilder.setOxmMatchField(matchField);
@@ -195,22 +199,22 @@ public class MatchUtil {
     public static Long ipv4ToLong(Ipv4Address ipv4) {
         Iterator<String> iterator = SPLITTER.split(ipv4.getValue()).iterator();
         byte[] bytes = new byte[8];
-        for(int i =0;i < bytes.length;i++) {
-            if(i<4) {
+        for (int i = 0; i < bytes.length; i++) {
+            if (i < 4) {
                 bytes[i] = 0;
             } else {
-                bytes[i] = UnsignedBytes.parseUnsignedByte((iterator.next()));
+                bytes[i] = UnsignedBytes.parseUnsignedByte(iterator.next());
             }
         }
         Long result = Longs.fromByteArray(bytes);
         return result;
     }
 
-    public static Ipv4Address longToIpv4Address(Long l) {
-        byte[] bytes = Longs.toByteArray(l);
+    public static Ipv4Address longToIpv4Address(Long value) {
+        byte[] bytes = Longs.toByteArray(value);
         String[] strArray = new String[4];
-        for(int i = 4;i < bytes.length;i++) {
-            strArray[i-4]=UnsignedBytes.toString(bytes[i]);
+        for (int i = 4; i < bytes.length; i++) {
+            strArray[i - 4] = UnsignedBytes.toString(bytes[i]);
         }
         String str = JOINER.join(strArray);
         Ipv4Address result = new Ipv4Address(str);
index ea3ba35daf68dc08fbe623e908eb3d34e3f7539b..d6fc5fdd3d53b1e6dc119a073f376416434a02fa 100644 (file)
@@ -40,50 +40,48 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class NshMdtypeConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        NshMdtypeCaseValue nshMdtypeCaseValue = ((NshMdtypeCaseValue) input.getMatchEntryValue());
+        NshMdtypeCaseValue nshMdtypeCaseValue = (NshMdtypeCaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshMdtypeBuilder().setValue(nshMdtypeCaseValue.getNshMdtypeValues().getValue()).build(), path,
+        return resolveAugmentation(
+                new NxmNxNshMdtypeBuilder().setValue(nshMdtypeCaseValue.getNshMdtypeValues().getValue()).build(), path,
                 NxmNxNshMdtypeKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshMdtypeGrouping> matchGrouping = MatchUtil.NSH_MDTYPE_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Short value = matchGrouping.get().getNxmNxNshMdtype().getValue();
+        NshMdtypeCaseValueBuilder nshMdtypeCaseValueBuilder = new NshMdtypeCaseValueBuilder();
+        nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshMdtype.class,
+                Nxm1Class.class, nshMdtypeCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshMdtype value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshMdtype(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshMdtype(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshMdtype(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshMdtype(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshMdtype(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshMdtypeGrouping> matchGrouping = MatchUtil.nshMdtypeResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Short value = matchGrouping.get().getNxmNxNshMdtype().getValue();
-        NshMdtypeCaseValueBuilder nshMdtypeCaseValueBuilder = new NshMdtypeCaseValueBuilder();
-        nshMdtypeCaseValueBuilder.setNshMdtypeValues(new NshMdtypeValuesBuilder()
-                .setValue(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshMdtype.class,
-                Nxm1Class.class,
-                nshMdtypeCaseValueBuilder.build()).build();
-    }
-
 }
index 2ac93f1a6c713447016e681aabeb9c8afd7dfee2..e0c7227d3569872ac3104a93cde89c1ba1e46ab8 100644 (file)
@@ -40,50 +40,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class NshNpConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        NshNpCaseValue nshNpCaseValue = ((NshNpCaseValue) input.getMatchEntryValue());
+        NshNpCaseValue nshNpCaseValue = (NshNpCaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshNpBuilder().setValue(nshNpCaseValue.getNshNpValues().getValue()).build(), path,
-                NxmNxNshNpKey.class);
+        return resolveAugmentation(new NxmNxNshNpBuilder().setValue(nshNpCaseValue.getNshNpValues().getValue()).build(),
+                path, NxmNxNshNpKey.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshNpGrouping> matchGrouping = MatchUtil.NSH_NP_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Short value = matchGrouping.get().getNxmNxNshNp().getValue();
+        NshNpCaseValueBuilder nshNpCaseValueBuilder = new NshNpCaseValueBuilder();
+        nshNpCaseValueBuilder.setNshNpValues(new NshNpValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshNp.class,
+                Nxm1Class.class, nshNpCaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshNp value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshNp(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshNp(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshNp(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshNp(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshNp(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshNpGrouping> matchGrouping = MatchUtil.nshNpResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Short value = matchGrouping.get().getNxmNxNshNp().getValue();
-        NshNpCaseValueBuilder nshNpCaseValueBuilder = new NshNpCaseValueBuilder();
-        nshNpCaseValueBuilder.setNshNpValues(new NshNpValuesBuilder()
-                .setValue(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshNp.class,
-                Nxm1Class.class,
-                nshNpCaseValueBuilder.build()).build();
-    }
-
 }
index b07dad1e5a708f11b1a7080b1bf7a04be3bde08d..d0e277cdb30ff911988857e7f155ca6643b4826d 100644 (file)
@@ -39,50 +39,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class Nshc1Convertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        Nshc1CaseValue nsc1CaseValue = ((Nshc1CaseValue) input.getMatchEntryValue());
+        Nshc1CaseValue nsc1CaseValue = (Nshc1CaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshc1Builder().setValue(nsc1CaseValue.getNshc1Values().getNshc()).build(), path,
-                NxmNxNshc1Key.class);
+        return resolveAugmentation(new NxmNxNshc1Builder().setValue(nsc1CaseValue.getNshc1Values().getNshc()).build(),
+                path, NxmNxNshc1Key.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshc1Grouping> matchGrouping = MatchUtil.NSC1_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNshc1().getValue();
+        Nshc1CaseValueBuilder nsc1CaseValueBuilder = new Nshc1CaseValueBuilder();
+        nsc1CaseValueBuilder.setNshc1Values(new Nshc1ValuesBuilder()
+                .setNshc(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc1.class,
+                Nxm1Class.class, nsc1CaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshc1 value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshc1(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshc1(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshc1(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshc1(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshc1(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshc1Grouping> matchGrouping = MatchUtil.nsc1Resolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = matchGrouping.get().getNxmNxNshc1().getValue();
-        Nshc1CaseValueBuilder nsc1CaseValueBuilder = new Nshc1CaseValueBuilder();
-        nsc1CaseValueBuilder.setNshc1Values(new Nshc1ValuesBuilder()
-                .setNshc(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc1.class,
-                Nxm1Class.class,
-                nsc1CaseValueBuilder.build()).build();
-    }
-
 }
index b46337b1bfd61f9264c4d8211baab6c31496cf55..f27174571bd568135a70d62dc7e528671b5a5dc9 100644 (file)
@@ -39,50 +39,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class Nshc2Convertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        Nshc2CaseValue nsc2CaseValue = ((Nshc2CaseValue) input.getMatchEntryValue());
+        Nshc2CaseValue nsc2CaseValue = (Nshc2CaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshc2Builder().setValue(nsc2CaseValue.getNshc2Values().getNshc()).build(), path,
-                NxmNxNshc2Key.class);
+        return resolveAugmentation(new NxmNxNshc2Builder().setValue(nsc2CaseValue.getNshc2Values().getNshc()).build(),
+                path, NxmNxNshc2Key.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshc2Grouping> matchGrouping = MatchUtil.NSC2_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNshc2().getValue();
+        Nshc2CaseValueBuilder nsc2CaseValueBuilder = new Nshc2CaseValueBuilder();
+        nsc2CaseValueBuilder.setNshc2Values(new Nshc2ValuesBuilder()
+                .setNshc(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc2.class,
+                Nxm1Class.class, nsc2CaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshc2 value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshc2(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshc2(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshc2(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshc2(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshc2(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshc2Grouping> matchGrouping = MatchUtil.nsc2Resolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = matchGrouping.get().getNxmNxNshc2().getValue();
-        Nshc2CaseValueBuilder nsc2CaseValueBuilder = new Nshc2CaseValueBuilder();
-        nsc2CaseValueBuilder.setNshc2Values(new Nshc2ValuesBuilder()
-                .setNshc(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc2.class,
-                Nxm1Class.class,
-                nsc2CaseValueBuilder.build()).build();
-    }
-
 }
index a38d2ae6f8f87c1d67cccfa26792c02d7fa58473..d5673573bce3e884653a313054ee4de186eab64a 100644 (file)
@@ -39,50 +39,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class Nshc3Convertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        Nshc3CaseValue nsc3CaseValue = ((Nshc3CaseValue) input.getMatchEntryValue());
+        Nshc3CaseValue nsc3CaseValue = (Nshc3CaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshc3Builder().setValue(nsc3CaseValue.getNshc3Values().getNshc()).build(), path,
-                NxmNxNshc3Key.class);
+        return resolveAugmentation(new NxmNxNshc3Builder().setValue(nsc3CaseValue.getNshc3Values().getNshc()).build(),
+                path, NxmNxNshc3Key.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshc3Grouping> matchGrouping = MatchUtil.NSC3_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNshc3().getValue();
+        Nshc3CaseValueBuilder nsc3CaseValueBuilder = new Nshc3CaseValueBuilder();
+        nsc3CaseValueBuilder.setNshc3Values(new Nshc3ValuesBuilder()
+                .setNshc(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc3.class,
+                Nxm1Class.class, nsc3CaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshc3 value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshc3(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshc3(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshc3(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshc3(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshc3(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshc3Grouping> matchGrouping = MatchUtil.nsc3Resolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = matchGrouping.get().getNxmNxNshc3().getValue();
-        Nshc3CaseValueBuilder nsc3CaseValueBuilder = new Nshc3CaseValueBuilder();
-        nsc3CaseValueBuilder.setNshc3Values(new Nshc3ValuesBuilder()
-                .setNshc(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc3.class,
-                Nxm1Class.class,
-                nsc3CaseValueBuilder.build()).build();
-    }
-
 }
index 01d1abc3cfdb32cd01f8e6eec27167967b1e1027..41d846f7caa142811b3c887b3a0a541f6473b5db 100644 (file)
@@ -39,50 +39,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class Nshc4Convertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        Nshc4CaseValue nsc4CaseValue = ((Nshc4CaseValue) input.getMatchEntryValue());
+        Nshc4CaseValue nsc4CaseValue = (Nshc4CaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxNshc4Builder().setValue(nsc4CaseValue.getNshc4Values().getNshc()).build(), path,
-                NxmNxNshc4Key.class);
+        return resolveAugmentation(new NxmNxNshc4Builder().setValue(nsc4CaseValue.getNshc4Values().getNshc()).build(),
+                path, NxmNxNshc4Key.class);
+    }
+
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNshc4Grouping> matchGrouping = MatchUtil.NSC4_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNshc4().getValue();
+        Nshc4CaseValueBuilder nsc4CaseValueBuilder = new Nshc4CaseValueBuilder();
+        nsc4CaseValueBuilder.setNshc4Values(new Nshc4ValuesBuilder()
+                .setNshc(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc4.class,
+                Nxm1Class.class, nsc4CaseValueBuilder.build()).build();
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNshc4 value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNshc4(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNshc4(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNshc4(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNshc4(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNshc4(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNshc4Grouping> matchGrouping = MatchUtil.nsc4Resolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = matchGrouping.get().getNxmNxNshc4().getValue();
-        Nshc4CaseValueBuilder nsc4CaseValueBuilder = new Nshc4CaseValueBuilder();
-        nsc4CaseValueBuilder.setNshc4Values(new Nshc4ValuesBuilder()
-                .setNshc(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNshc4.class,
-                Nxm1Class.class,
-                nsc4CaseValueBuilder.build()).build();
-    }
-
 }
index b0f2bda241bab03bddb5727d88993a42f737f54b..fed9736ec9d7bedf145cd3a30419d7a46099d8c6 100644 (file)
@@ -40,49 +40,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class NsiConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        NsiCaseValue nsiCaseValue = ((NsiCaseValue) input.getMatchEntryValue());
+        NsiCaseValue nsiCaseValue = (NsiCaseValue) input.getMatchEntryValue();
         return resolveAugmentation(new NxmNxNsiBuilder().setNsi(nsiCaseValue.getNsiValues().getNsi()).build(), path,
                 NxmNxNsiKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNsiGrouping> matchGrouping = MatchUtil.NSI_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Short value = matchGrouping.get().getNxmNxNsi().getNsi();
+
+        NsiCaseValueBuilder nsiCaseValueBuilder = new NsiCaseValueBuilder();
+        nsiCaseValueBuilder.setNsiValues(new NsiValuesBuilder()
+                .setNsi(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi.class,
+                Nxm1Class.class, nsiCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNsi value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNsi(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNsi(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNsi(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNsi(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNsi(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNsiGrouping> matchGrouping = MatchUtil.nsiResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Short value = matchGrouping.get().getNxmNxNsi().getNsi();
-
-        NsiCaseValueBuilder nsiCaseValueBuilder = new NsiCaseValueBuilder();
-        nsiCaseValueBuilder.setNsiValues(new NsiValuesBuilder()
-                .setNsi(value).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsi.class,
-                Nxm1Class.class,
-                nsiCaseValueBuilder.build()).build();
-
-    }
-
 }
index 301bd29c0976891298d3db0edb7b90aeaad4e1b9..47be5017e39874561bcb865055a514e1a36a8833 100644 (file)
@@ -40,50 +40,47 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class NspConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        NspCaseValue nspCaseValue = ((NspCaseValue) input.getMatchEntryValue());
+        NspCaseValue nspCaseValue = (NspCaseValue) input.getMatchEntryValue();
 
         return resolveAugmentation(new NxmNxNspBuilder().setValue(nspCaseValue.getNspValues().getNsp()).build(), path,
                 NxmNxNspKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxNspGrouping> matchGrouping = MatchUtil.NSP_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Long value = matchGrouping.get().getNxmNxNsp().getValue();
+        NspCaseValueBuilder nspCaseValueBuilder = new NspCaseValueBuilder();
+        nspCaseValueBuilder.setNspValues(new NspValuesBuilder()
+                .setNsp(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp.class,
+                Nxm1Class.class, nspCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxNsp value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxNsp(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxNsp(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxNsp(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxNsp(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxNsp(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxNspGrouping> matchGrouping = MatchUtil.nspResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Long value = matchGrouping.get().getNxmNxNsp().getValue();
-        NspCaseValueBuilder nspCaseValueBuilder = new NspCaseValueBuilder();
-        nspCaseValueBuilder.setNspValues(new NspValuesBuilder()
-                .setNsp(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxNsp.class,
-                Nxm1Class.class,
-                nspCaseValueBuilder.build()).build();
-    }
-
 }
index bd382261a1d78bcc71d0d01b936d14e3c095363b..f3a33a1637852672ac07600ba9cc3b9393c61d64 100644 (file)
@@ -38,59 +38,19 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class NxmInPortConvertor implements ConvertorToOFJava<MatchEntry>,
         ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(
             MatchEntry input, MatchPath path) {
-        OfInPortCaseValue inPortCaseValue = ((OfInPortCaseValue) input
-                .getMatchEntryValue());
+        OfInPortCaseValue inPortCaseValue = (OfInPortCaseValue) input
+                .getMatchEntryValue();
         return NxmInPortConvertor.resolveAugmentation(new OfInPortBuilder()
                 .setValue(inPortCaseValue.getNxmOfInPortValues().getValue())
                 .build(), path, NxmOfInPortKey.class);
     }
 
-    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(
-            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.in.port.grouping.OfInPort value,
-            MatchPath path, Class<? extends ExtensionKey> key) {
-        switch (path) {
-        case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
-            return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
-                    new NxAugMatchNodesNodeTableFlowBuilder().setOfInPort(value).build(), key);
-        case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
-            return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
-                     new NxAugMatchRpcGetFlowStatsBuilder().setOfInPort(value).build(), key);
-        case PACKETRECEIVED_MATCH:
-            return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
-                    new NxAugMatchNotifPacketInBuilder().setOfInPort(value).build(), key);
-        case SWITCHFLOWREMOVED_MATCH:
-            return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
-                    new NxAugMatchNotifSwitchFlowRemovedBuilder().setOfInPort(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
-                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
-                        new NxAugMatchPacketInMessageBuilder().setOfInPort(value).build(), key);
-        default:
-            throw new CodecPreconditionException(path);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.
-     * general .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmOfInPortGrouping> matchGrouping = MatchUtil.nxmOfInportResolver
+        Optional<NxmOfInPortGrouping> matchGrouping = MatchUtil.NXM_OF_INPORT_RESOLVER
                 .getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
@@ -106,4 +66,28 @@ public class NxmInPortConvertor implements ConvertorToOFJava<MatchEntry>,
                 .build();
 
     }
+
+    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(
+            org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.in
+                .port.grouping.OfInPort value, MatchPath path, Class<? extends ExtensionKey> key) {
+        switch (path) {
+            case FLOWS_STATISTICS_UPDATE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
+                        new NxAugMatchNodesNodeTableFlowBuilder().setOfInPort(value).build(), key);
+            case FLOWS_STATISTICS_RPC_MATCH:
+                return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
+                        new NxAugMatchRpcGetFlowStatsBuilder().setOfInPort(value).build(), key);
+            case PACKET_RECEIVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
+                        new NxAugMatchNotifPacketInBuilder().setOfInPort(value).build(), key);
+            case SWITCH_FLOW_REMOVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                        new NxAugMatchNotifSwitchFlowRemovedBuilder().setOfInPort(value).build(), key);
+            case PACKET_IN_MESSAGE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
+                        new NxAugMatchPacketInMessageBuilder().setOfInPort(value).build(), key);
+            default:
+                throw new CodecPreconditionException(path);
+        }
+    }
 }
index b56695d02673baa86aa3778a0c1fe1ecb598dc40..42320ce5364ff5e714e69daf3ede7ba0a99364d9 100644 (file)
@@ -49,20 +49,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for NxmNxReg.
+ *
  * @author msunal
  */
 public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    private final static Logger LOG = LoggerFactory.getLogger(RegConvertor.class);
+    private static final Logger LOG = LoggerFactory.getLogger(RegConvertor.class);
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @SuppressWarnings("unchecked")
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
@@ -75,10 +69,9 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
             LOG.warn(msg);
             throw new IllegalStateException(msg);
         }
-        nxRegBuilder
-                .setReg((Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg>) input
-                        .getOxmMatchField());
-        RegCaseValue regCaseValue = ((RegCaseValue) input.getMatchEntryValue());
+        nxRegBuilder.setReg((Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match
+                .rev140421.NxmNxReg>) input.getOxmMatchField());
+        RegCaseValue regCaseValue = (RegCaseValue) input.getMatchEntryValue();
         nxRegBuilder.setValue(regCaseValue.getRegValues().getValue());
 
         if (input.isHasMask()) {
@@ -88,6 +81,26 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
         return resolveAugmentation(nxRegBuilder.build(), path, resolveRegKey(input.getOxmMatchField()));
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxRegGrouping> matchGrouping = MatchUtil.REG_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        NxmNxReg nxmNxReg = matchGrouping.get().getNxmNxReg();
+        RegValuesBuilder regValuesBuilder = new RegValuesBuilder()
+            .setValue(nxmNxReg.getValue())
+            .setMask(nxmNxReg.getMask());
+
+        RegCaseValueBuilder regCaseValueBuilder = new RegCaseValueBuilder();
+        regCaseValueBuilder.setRegValues(regValuesBuilder.build());
+        return MatchUtil.createDefaultMatchEntryBuilder(nxmNxReg.getReg(),
+                Nxm1Class.class,
+                regCaseValueBuilder.build())
+            .setHasMask(Objects.nonNull(nxmNxReg.getMask()))
+            .build();
+    }
+
     private static Class<? extends ExtensionKey> resolveRegKey(Class<? extends MatchField> oxmMatchField) {
         if (NiciraMatchCodecs.REG0_CODEC.getNxmField().isAssignableFrom(oxmMatchField)) {
             return NxmNxReg0Key.class;
@@ -117,55 +130,25 @@ public class RegConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFro
     }
 
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxReg nxmNxReg,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxReg(nxmNxReg).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxReg(nxmNxReg).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxReg(nxmNxReg).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxReg(nxmNxReg).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxReg(nxmNxReg).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxRegGrouping> matchGrouping = MatchUtil.regResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        NxmNxReg nxmNxReg = matchGrouping.get().getNxmNxReg();
-        RegValuesBuilder regValuesBuilder = new RegValuesBuilder()
-            .setValue(nxmNxReg.getValue())
-            .setMask(nxmNxReg.getMask());
-
-        RegCaseValueBuilder regCaseValueBuilder = new RegCaseValueBuilder();
-        regCaseValueBuilder.setRegValues(regValuesBuilder.build());
-        return MatchUtil.createDefaultMatchEntryBuilder(nxmNxReg.getReg(),
-                Nxm1Class.class,
-                regCaseValueBuilder.build())
-            .setHasMask(Objects.nonNull(nxmNxReg.getMask()))
-            .build();
-    }
-
 }
index 3979d687057bb29a2e21a778bb6a1ef1dd4d43cb..5c556c65486ee571a412e0bdcb36a0a881175eda 100644 (file)
@@ -39,21 +39,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for TcpDstCase.
+ *
  * @author Aswin Suryanarayanan.
  */
 public class TcpDstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        TcpDstCaseValue tcpDstCaseValue = ((TcpDstCaseValue) input.getMatchEntryValue());
+        TcpDstCaseValue tcpDstCaseValue = (TcpDstCaseValue) input.getMatchEntryValue();
         NxmOfTcpDstBuilder tcpDstBuilder = new NxmOfTcpDstBuilder();
         tcpDstBuilder.setPort(tcpDstCaseValue.getTcpDstValues().getPort());
         tcpDstBuilder.setMask(tcpDstCaseValue.getTcpDstValues().getMask());
@@ -61,18 +55,9 @@ public class TcpDstConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
                 NxmOfTcpDstKey.class);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmOfTcpDstGrouping> matchGrouping = MatchUtil.tcpDstResolver.getExtension(extension);
+        Optional<NxmOfTcpDstGrouping> matchGrouping = MatchUtil.TCP_DST_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -92,19 +77,19 @@ public class TcpDstConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfTcpDst value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfTcpDst(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfTcpDst(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfTcpDst(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfTcpDst(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfTcpDst(value).build(), key);
             default:
index e707ad696efaf0fbd1d26ee7b56fab32fa52800d..8eaa8b2b4eb48b0397c02c9f096fe90cd0b643a5 100644 (file)
@@ -39,21 +39,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for TcpSrcCase.
+ *
  * @author Aswin Suryanarayanan.
  */
 public class TcpSrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        TcpSrcCaseValue tcpSrcCaseValue = ((TcpSrcCaseValue) input.getMatchEntryValue());
+        TcpSrcCaseValue tcpSrcCaseValue = (TcpSrcCaseValue) input.getMatchEntryValue();
         NxmOfTcpSrcBuilder tcpSrcBuilder = new NxmOfTcpSrcBuilder();
         tcpSrcBuilder.setPort(tcpSrcCaseValue.getTcpSrcValues().getPort());
         tcpSrcBuilder.setMask(tcpSrcCaseValue.getTcpSrcValues().getMask());
@@ -61,18 +54,9 @@ public class TcpSrcConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
                 NxmOfTcpSrcKey.class);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmOfTcpSrcGrouping> matchGrouping = MatchUtil.tcpSrcResolver.getExtension(extension);
+        Optional<NxmOfTcpSrcGrouping> matchGrouping = MatchUtil.TCP_SRC_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -92,19 +76,19 @@ public class TcpSrcConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfTcpSrc value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfTcpSrc(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfTcpSrc(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfTcpSrc(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfTcpSrc(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfTcpSrc(value).build(), key);
             default:
index 6c6a51b3728dd8ef0c599351cf6ddb338bfa2d62..d7fee0b96b6413e04476a1cd273aa38f3d606aa9 100644 (file)
@@ -40,50 +40,48 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 public class TunGpeNpConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        TunGpeNpCaseValue tunGpeNpCaseValue = ((TunGpeNpCaseValue) input.getMatchEntryValue());
+        TunGpeNpCaseValue tunGpeNpCaseValue = (TunGpeNpCaseValue) input.getMatchEntryValue();
 
-        return resolveAugmentation(new NxmNxTunGpeNpBuilder().setValue(tunGpeNpCaseValue.getTunGpeNpValues().getValue()).build(), path,
+        return resolveAugmentation(
+                new NxmNxTunGpeNpBuilder().setValue(tunGpeNpCaseValue.getTunGpeNpValues().getValue()).build(), path,
                 NxmNxTunGpeNpKey.class);
     }
 
+    @Override
+    public MatchEntry convert(Extension extension) {
+        Optional<NxmNxTunGpeNpGrouping> matchGrouping = MatchUtil.TUN_GPE_NP_RESOLVER.getExtension(extension);
+        if (!matchGrouping.isPresent()) {
+            throw new CodecPreconditionException(extension);
+        }
+        Short value = matchGrouping.get().getNxmNxTunGpeNp().getValue();
+        TunGpeNpCaseValueBuilder tunGpeNpCaseValueBuilder = new TunGpeNpCaseValueBuilder();
+        tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder()
+                .setValue(value).build());
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunGpeNp.class,
+                Nxm1Class.class, tunGpeNpCaseValueBuilder.build()).build();
+    }
+
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxTunGpeNp value,
-                                                                                           MatchPath path, Class<? extends ExtensionKey> key) {
+            MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunGpeNp(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunGpeNp(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmNxTunGpeNp(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunGpeNp(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmNxTunGpeNp(value).build(), key);
             default:
                 throw new CodecPreconditionException(path);
         }
     }
-
-    @Override
-    public MatchEntry convert(Extension extension) {
-        Optional<NxmNxTunGpeNpGrouping> matchGrouping = MatchUtil.tunGpeNpResolver.getExtension(extension);
-        if (!matchGrouping.isPresent()) {
-            throw new CodecPreconditionException(extension);
-        }
-        Short value = matchGrouping.get().getNxmNxTunGpeNp().getValue();
-        TunGpeNpCaseValueBuilder tunGpeNpCaseValueBuilder = new TunGpeNpCaseValueBuilder();
-        tunGpeNpCaseValueBuilder.setTunGpeNpValues(new TunGpeNpValuesBuilder()
-                .setValue(value).build());
-
-
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunGpeNp.class,
-                Nxm1Class.class,
-                tunGpeNpCaseValueBuilder.build()).build();
-    }
-
 }
index 0f29ae2629065ce60402f8de3e6e8753d1381762..6c9af2287a83bf90d35165477ccf394668a10334 100644 (file)
@@ -38,41 +38,42 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.dst.grouping.NxmNxTunIpv4DstBuilder;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
-public class TunIPv4DstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath>{
+public class TunIPv4DstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxTunIpv4Dst value,
             MatchPath path, Class<? extends ExtensionKey> key) {
-            switch (path) {
-                case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
-                                new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunIpv4Dst(value).build(), key);
-                case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
-                    return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
-                            new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunIpv4Dst(value).build(), key);
-                case PACKETRECEIVED_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
-                                new NxAugMatchNotifPacketInBuilder().setNxmNxTunIpv4Dst(value).build(), key);
-                case SWITCHFLOWREMOVED_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
-                                new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunIpv4Dst(value).build(), key);
-                case PACKETINMESSAGE_MATCH:
-                    return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
-                            new NxAugMatchPacketInMessageBuilder().setNxmNxTunIpv4Dst(value).build(), key);
-                default:
-                    throw new CodecPreconditionException(path);
-            }
+        switch (path) {
+            case FLOWS_STATISTICS_UPDATE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
+                        new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunIpv4Dst(value).build(), key);
+            case FLOWS_STATISTICS_RPC_MATCH:
+                return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
+                        new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunIpv4Dst(value).build(), key);
+            case PACKET_RECEIVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
+                        new NxAugMatchNotifPacketInBuilder().setNxmNxTunIpv4Dst(value).build(), key);
+            case SWITCH_FLOW_REMOVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                        new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunIpv4Dst(value).build(), key);
+            case PACKET_IN_MESSAGE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
+                        new NxAugMatchPacketInMessageBuilder().setNxmNxTunIpv4Dst(value).build(), key);
+            default:
+                throw new CodecPreconditionException(path);
+        }
     }
 
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(
             MatchEntry input, MatchPath path) {
-        TunIpv4DstCaseValue tunIpv4DstCaseValue = ((TunIpv4DstCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxTunIpv4DstBuilder().setIpv4Address(MatchUtil.longToIpv4Address(tunIpv4DstCaseValue.getTunIpv4DstValues().getValue())).build(), path,
-                NxmNxTunIpv4DstKey.class);
+        TunIpv4DstCaseValue tunIpv4DstCaseValue = (TunIpv4DstCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxTunIpv4DstBuilder()
+                .setIpv4Address(MatchUtil.longToIpv4Address(tunIpv4DstCaseValue.getTunIpv4DstValues().getValue()))
+                .build(), path, NxmNxTunIpv4DstKey.class);
     }
 
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmNxTunIpv4DstGrouping> matchGrouping = MatchUtil.tunIpv4DstResolver.getExtension(extension);
+        Optional<NxmNxTunIpv4DstGrouping> matchGrouping = MatchUtil.TUN_IPV4_DST_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -81,9 +82,8 @@ public class TunIPv4DstConvertor implements ConvertorToOFJava<MatchEntry>, Conve
         TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder();
         tunIpv4DstCaseValueBuilder.setTunIpv4DstValues(new TunIpv4DstValuesBuilder()
                 .setValue(MatchUtil.ipv4ToLong(value)).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Dst.class,
-                Nxm1Class.class,
-                tunIpv4DstCaseValueBuilder.build()).build();
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Dst.class,
+                Nxm1Class.class, tunIpv4DstCaseValueBuilder.build()).build();
     }
-
 }
index 75f52f9568fcc831d02ff314cc57182ebad3de34..0b8752deb97ec46d95a7da2b6b912a411155ed85 100644 (file)
@@ -38,41 +38,42 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.src.grouping.NxmNxTunIpv4SrcBuilder;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
-public class TunIPv4SrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath>{
+public class TunIPv4SrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmNxTunIpv4Src value,
             MatchPath path, Class<? extends ExtensionKey> key) {
-            switch (path) {
-                case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
-                                new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunIpv4Src(value).build(), key);
-                case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
-                    return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
-                            new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunIpv4Src(value).build(), key);
-                case PACKETRECEIVED_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
-                                new NxAugMatchNotifPacketInBuilder().setNxmNxTunIpv4Src(value).build(), key);
-                case SWITCHFLOWREMOVED_MATCH:
-                        return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
-                                new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunIpv4Src(value).build(), key);
-                case PACKETINMESSAGE_MATCH:
-                    return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
-                            new NxAugMatchPacketInMessageBuilder().setNxmNxTunIpv4Src(value).build(), key);
-                default:
-                    throw new CodecPreconditionException(path);
-            }
+        switch (path) {
+            case FLOWS_STATISTICS_UPDATE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
+                        new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunIpv4Src(value).build(), key);
+            case FLOWS_STATISTICS_RPC_MATCH:
+                return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
+                        new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunIpv4Src(value).build(), key);
+            case PACKET_RECEIVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class,
+                        new NxAugMatchNotifPacketInBuilder().setNxmNxTunIpv4Src(value).build(), key);
+            case SWITCH_FLOW_REMOVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                        new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunIpv4Src(value).build(), key);
+            case PACKET_IN_MESSAGE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
+                        new NxAugMatchPacketInMessageBuilder().setNxmNxTunIpv4Src(value).build(), key);
+            default:
+                throw new CodecPreconditionException(path);
+        }
     }
 
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(
             MatchEntry input, MatchPath path) {
-        TunIpv4SrcCaseValue tunIpv4SrcCaseValue = ((TunIpv4SrcCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxTunIpv4SrcBuilder().setIpv4Address(MatchUtil.longToIpv4Address(tunIpv4SrcCaseValue.getTunIpv4SrcValues().getValue())).build(), path,
-                NxmNxTunIpv4SrcKey.class);
+        TunIpv4SrcCaseValue tunIpv4SrcCaseValue = (TunIpv4SrcCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxTunIpv4SrcBuilder()
+                .setIpv4Address(MatchUtil.longToIpv4Address(tunIpv4SrcCaseValue.getTunIpv4SrcValues().getValue()))
+                .build(), path, NxmNxTunIpv4SrcKey.class);
     }
 
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmNxTunIpv4SrcGrouping> matchGrouping = MatchUtil.tunIpv4SrcResolver.getExtension(extension);
+        Optional<NxmNxTunIpv4SrcGrouping> matchGrouping = MatchUtil.TUN_IPV4_SRC_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -81,8 +82,8 @@ public class TunIPv4SrcConvertor implements ConvertorToOFJava<MatchEntry>, Conve
         TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder();
         tunIpv4SrcCaseValueBuilder.setTunIpv4SrcValues(new TunIpv4SrcValuesBuilder()
                 .setValue(MatchUtil.ipv4ToLong(value)).build());
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Src.class,
-                Nxm1Class.class,
-                tunIpv4SrcCaseValueBuilder.build()).build();
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunIpv4Src.class,
+                Nxm1Class.class, tunIpv4SrcCaseValueBuilder.build()).build();
     }
 }
index 228817ba67f1d18b4c8b84910b8af341adbd013f..cb80d4c48ad673de7d0371920404218893484373 100644 (file)
@@ -38,60 +38,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for TunIdCase.
+ *
  * @author msunal
  */
 public class TunIdConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(final MatchEntry input, final MatchPath path) {
-        TunIdCaseValue tunnelIdCase = ((TunIdCaseValue) input.getMatchEntryValue());
-        return resolveAugmentation(new NxmNxTunIdBuilder().setValue(tunnelIdCase.getTunIdValues().getValue()).build(), path,
-                NxmNxTunIdKey.class);
+        TunIdCaseValue tunnelIdCase = (TunIdCaseValue) input.getMatchEntryValue();
+        return resolveAugmentation(new NxmNxTunIdBuilder().setValue(tunnelIdCase.getTunIdValues().getValue()).build(),
+                path, NxmNxTunIdKey.class);
     }
 
-    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(final NxmNxTunId value,
-                                                                                           final MatchPath path, final Class<? extends ExtensionKey> key) {
-        switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
-                return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
-                        new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunId(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
-                return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
-                        new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunId(value).build(), key);
-            case PACKETRECEIVED_MATCH:
-                return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
-                        .setNxmNxTunId(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
-                return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
-                        new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunId(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
-                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
-                        new NxAugMatchPacketInMessageBuilder().setNxmNxTunId(value).build(), key);
-            default:
-                throw new CodecPreconditionException(path);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(final Extension extension) {
-        Optional<NxmNxTunIdGrouping> matchGrouping = MatchUtil.tunIdResolver.getExtension(extension);
+        Optional<NxmNxTunIdGrouping> matchGrouping = MatchUtil.TUN_ID_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -103,10 +64,32 @@ public class TunIdConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorF
         tunnelIdBuilder.setValue(value);
         tunnelIdCaseBuilder.setTunIdValues(tunnelIdBuilder.build());
 
-        return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunId.class,
-                Nxm1Class.class,
-                tunnelIdCaseBuilder.build()).build();
+        return MatchUtil.createDefaultMatchEntryBuilder(
+                org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxTunId.class,
+                Nxm1Class.class, tunnelIdCaseBuilder.build()).build();
 
     }
 
+    private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(final NxmNxTunId value,
+            final MatchPath path, final Class<? extends ExtensionKey> key) {
+        switch (path) {
+            case FLOWS_STATISTICS_UPDATE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
+                        new NxAugMatchNodesNodeTableFlowBuilder().setNxmNxTunId(value).build(), key);
+            case FLOWS_STATISTICS_RPC_MATCH:
+                return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
+                        new NxAugMatchRpcGetFlowStatsBuilder().setNxmNxTunId(value).build(), key);
+            case PACKET_RECEIVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
+                        .setNxmNxTunId(value).build(), key);
+            case SWITCH_FLOW_REMOVED_MATCH:
+                return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
+                        new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmNxTunId(value).build(), key);
+            case PACKET_IN_MESSAGE_MATCH:
+                return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
+                        new NxAugMatchPacketInMessageBuilder().setNxmNxTunId(value).build(), key);
+            default:
+                throw new CodecPreconditionException(path);
+        }
+    }
 }
index 3d97ed292b38e10c0741a9676f251f7c96020c6b..0a93a9f793c63504d3b0103d53871fd2f5220128 100644 (file)
@@ -39,21 +39,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for UdpDstCase.
+ *
  * @author Aswin Suryanarayanan.
  */
 public class UdpDstConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        UdpDstCaseValue udpDstCaseValue = ((UdpDstCaseValue) input.getMatchEntryValue());
+        UdpDstCaseValue udpDstCaseValue = (UdpDstCaseValue) input.getMatchEntryValue();
         NxmOfUdpDstBuilder udpDstBuilder = new NxmOfUdpDstBuilder();
         udpDstBuilder.setPort(udpDstCaseValue.getUdpDstValues().getPort());
         udpDstBuilder.setMask(udpDstCaseValue.getUdpDstValues().getMask());
@@ -61,18 +55,9 @@ public class UdpDstConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
                 NxmOfUdpDstKey.class);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmOfUdpDstGrouping> matchGrouping = MatchUtil.udpDstResolver.getExtension(extension);
+        Optional<NxmOfUdpDstGrouping> matchGrouping = MatchUtil.UDP_DST_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -92,19 +77,19 @@ public class UdpDstConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfUdpDst value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfUdpDst(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfUdpDst(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfUdpDst(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfUdpDst(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfUdpDst(value).build(), key);
             default:
index 532016426633a37131e2638241871583ec1659ca..4ad47b3bc50e2fd488ff5961d5f9228471c1e0c2 100644 (file)
@@ -39,39 +39,25 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 
 /**
+ * Convert to/from SAL flow model to openflowjava model for CtZoneCase.
+ *
  * @author Aswin Suryanarayanan.
  */
 public class UdpSrcConvertor implements ConvertorToOFJava<MatchEntry>, ConvertorFromOFJava<MatchEntry, MatchPath> {
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorFromOFJava#convert
-     * (org.opendaylight.yangtools.yang.binding.DataContainer,
-     * org.opendaylight.openflowplugin.extension.api.path.AugmentationPath)
-     */
     @Override
     public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
-        UdpSrcCaseValue udpSrcCaseValue = ((UdpSrcCaseValue) input.getMatchEntryValue());
+        UdpSrcCaseValue udpSrcCaseValue = (UdpSrcCaseValue) input.getMatchEntryValue();
         NxmOfUdpSrcBuilder udpSrcBuilder = new NxmOfUdpSrcBuilder();
         udpSrcBuilder.setPort(udpSrcCaseValue.getUdpSrcValues().getPort());
         udpSrcBuilder.setMask(udpSrcCaseValue.getUdpSrcValues().getMask());
         return resolveAugmentation(udpSrcBuilder.build(), path,
                 NxmOfUdpSrcKey.class);
     }
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.opendaylight.openflowplugin.extension.api.ConvertorToOFJava#convert
-     * (org
-     * .opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general
-     * .rev140714.general.extension.grouping.Extension)
-     */
+
     @Override
     public MatchEntry convert(Extension extension) {
-        Optional<NxmOfUdpSrcGrouping> matchGrouping = MatchUtil.udpSrcResolver.getExtension(extension);
+        Optional<NxmOfUdpSrcGrouping> matchGrouping = MatchUtil.UDP_SRC_RESOLVER.getExtension(extension);
         if (!matchGrouping.isPresent()) {
             throw new CodecPreconditionException(extension);
         }
@@ -91,19 +77,19 @@ public class UdpSrcConvertor implements ConvertorToOFJava<MatchEntry>, Convertor
     private static ExtensionAugment<? extends Augmentation<Extension>> resolveAugmentation(NxmOfUdpSrc value,
                                                                    MatchPath path, Class<? extends ExtensionKey> key) {
         switch (path) {
-            case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_UPDATE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNodesNodeTableFlow.class,
                         new NxAugMatchNodesNodeTableFlowBuilder().setNxmOfUdpSrc(value).build(), key);
-            case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+            case FLOWS_STATISTICS_RPC_MATCH:
                 return new ExtensionAugment<>(NxAugMatchRpcGetFlowStats.class,
                         new NxAugMatchRpcGetFlowStatsBuilder().setNxmOfUdpSrc(value).build(), key);
-            case PACKETRECEIVED_MATCH:
+            case PACKET_RECEIVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifPacketIn.class, new NxAugMatchNotifPacketInBuilder()
                         .setNxmOfUdpSrc(value).build(), key);
-            case SWITCHFLOWREMOVED_MATCH:
+            case SWITCH_FLOW_REMOVED_MATCH:
                 return new ExtensionAugment<>(NxAugMatchNotifSwitchFlowRemoved.class,
                         new NxAugMatchNotifSwitchFlowRemovedBuilder().setNxmOfUdpSrc(value).build(), key);
-            case PACKETINMESSAGE_MATCH:
+            case PACKET_IN_MESSAGE_MATCH:
                 return new ExtensionAugment<>(NxAugMatchPacketInMessage.class,
                         new NxAugMatchPacketInMessageBuilder().setNxmOfUdpSrc(value).build(), key);
             default:
index 7e44696147c08030ad6cb8f1af5e05c5065b02f9..6396247e772b2ebfb52b0743b480065aae12240c 100644 (file)
@@ -44,6 +44,9 @@ public class NiciraExtensionProviderTest {
 
     @Test
     public void testRegisterConverters() throws Exception {
-        Mockito.verify(extensionConverterRegistrator, Mockito.atLeastOnce()).registerActionConvertor(Matchers.<TypeVersionKey<? extends Action>>any(), Matchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>>any());
+        Mockito.verify(extensionConverterRegistrator, Mockito.atLeastOnce()).registerActionConvertor(
+                Matchers.<TypeVersionKey<? extends Action>>any(),
+                Matchers.<ConvertorActionToOFJava<Action, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
+                    .common.action.rev150203.actions.grouping.Action>>any());
     }
 }
index 1bd6d61e8af0c542f1a3016a2595ac7bdb7cf3b1..7d27d44605710d6e7a43c6bca1c12f3bb91cc419 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
@@ -18,14 +18,14 @@ public class IpConverterTest {
     public void testIpv4AddressToLong() {
         Ipv4Address ipAddress = new Ipv4Address("192.168.1.2");
         long address = 0xc0a80102L;
-        assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
+        assertEquals(address, IpConverter.ipv4AddressToLong(ipAddress));
     }
 
     @Test
     public void testIpv4AddressToLong2() {
         Ipv4Address ipAddress = new Ipv4Address("10.168.1.2");
         long address = 0x0aa80102L;
-        assertEquals(address, IpConverter.Ipv4AddressToLong(ipAddress));
+        assertEquals(address, IpConverter.ipv4AddressToLong(ipAddress));
     }
 
 }
index e1f2c92aab734b10a326ebdaa7d6c040b73e5b9c..167592305fac0b8eef58fd8d5a22b803c4b0a019 100644 (file)
@@ -9,9 +9,8 @@ package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor;
 
 import static org.junit.Assert.assertEquals;
 
-import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.MatchUtil;
-
 import org.junit.Test;
+import org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.match.MatchUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 
 public class MatchUtilTest {
index 887ee0ea3561f043e896ca3f27ddccdc25874fce..ab43d96fb071007cc6fe820c216f9530c993c26a 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.action
 
 import java.util.ArrayList;
 import java.util.List;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -35,8 +34,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.ni
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.NxActionNatCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNat;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.ofpact.actions.ofpact.actions.nx.action.nat._case.NxActionNatBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Test for {@link ConntrackConvertor}.
@@ -90,7 +87,7 @@ public class ConntrackConvertorTest {
         NxActionNat natactionCase = ((NxActionNatCase) actionsCase.getNxConntrack().getCtActions().get(0)
                 .getOfpactActions()).getNxActionNat();
         org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
-            .nx.action.nat._case.NxActionNat nataction = ( (org.opendaylight
+            .nx.action.nat._case.NxActionNat nataction = ((org.opendaylight
                     .yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofpact.actions.ofpact.actions
                     .NxActionNatCase) actionConntrack.getNxActionConntrack().getCtActions().get(0).getOfpactActions())
             .getNxActionNat();
@@ -143,17 +140,17 @@ public class ConntrackConvertorTest {
         final Action groupingAction = actionBuilder.build();
 
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action
-                = conntrackConvertor.convert(groupingAction, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action1
-                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action2
-                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action3
-                = conntrackConvertor.convert(groupingAction, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action4
-                = conntrackConvertor.convert(groupingAction, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action5
-                = conntrackConvertor.convert(groupingAction, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = conntrackConvertor.convert(groupingAction, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
 
         Assert.assertEquals(1, ((NxActionConntrackNodesNodeTableFlowWriteActionsCase) action).getNxConntrack()
                 .getConntrackZone().longValue());
@@ -245,4 +242,4 @@ public class ConntrackConvertorTest {
         Assert.assertEquals(1, ((NxActionConntrackNotifDirectStatisticsUpdateApplyActionsCase) action5).getNxConntrack()
                 .getFlags().intValue());
     }
-}
\ No newline at end of file
+}
index aa3bab2bf0ef5ed949c92b1550c92225df85f005..4da5062e5f1f7171f1086c81f9428e78416ca051 100644 (file)
@@ -44,9 +44,10 @@ public class FinTimeoutConvertorTest {
 
     @Before
     public void setUp() throws Exception {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping.NxActionFinTimeout nxFinTimeout =
-                Mockito.mock(
-                        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping.NxActionFinTimeout.class);
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action
+            .fin.timeout.grouping.NxActionFinTimeout nxFinTimeout =  Mockito.mock(org.opendaylight.yang.gen.v1.urn
+                .opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.fin.timeout.grouping
+                    .NxActionFinTimeout.class);
         when(actionsCase.getNxActionFinTimeout()).thenReturn(nxFinTimeout);
         when(nxFinTimeout.getFinIdleTimeout()).thenReturn(1);
         when(nxFinTimeout.getFinHardTimeout()).thenReturn(2);
@@ -73,22 +74,22 @@ public class FinTimeoutConvertorTest {
     public void testConvert1() throws Exception {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                        ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1 =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                        ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2 =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                        ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3 =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                        ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4 =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                        ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5 =
                 finTimeoutConvertor.convert(action,
-                        ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                        ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
 
         Assert.assertEquals(3, ((NxActionFinTimeoutNotifFlowsStatisticsUpdateApplyActionsCase) actionResult)
                 .getNxActionFinTimeout().getFinIdleTimeout().intValue());
@@ -120,4 +121,4 @@ public class FinTimeoutConvertorTest {
         Assert.assertEquals(4, ((NxActionFinTimeoutNotifDirectStatisticsUpdateWriteActionsCase) actionResult5)
                 .getNxActionFinTimeout().getFinHardTimeout().intValue());
     }
-}
\ No newline at end of file
+}
index 15c7fff5e24b8217472f2eaa3532b9c23a6bdfdd..846ddcad73300991fe914a0cad84ebbcd0347411 100644 (file)
@@ -85,10 +85,12 @@ public class MultipathConvertorTest {
 
     @Test
     public void testConvert() throws Exception {
-        final ActionMultipath actionMultipath = (ActionMultipath) multipathConvertor.convert(bucketActionsCase).getActionChoice();
+        final ActionMultipath actionMultipath =
+                (ActionMultipath) multipathConvertor.convert(bucketActionsCase).getActionChoice();
         Assert.assertEquals(OfjNxHashFields.NXHASHFIELDSETHSRC, actionMultipath.getNxActionMultipath().getFields());
         Assert.assertEquals(Integer.valueOf(2), actionMultipath.getNxActionMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHASHTHRESHOLD, actionMultipath.getNxActionMultipath().getAlgorithm());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHASHTHRESHOLD,
+                actionMultipath.getNxActionMultipath().getAlgorithm());
         Assert.assertEquals(Integer.valueOf(2), actionMultipath.getNxActionMultipath().getMaxLink());
         Assert.assertEquals(Long.valueOf(2L), actionMultipath.getNxActionMultipath().getArg());
     }
@@ -96,46 +98,85 @@ public class MultipathConvertorTest {
     @Test
     public void testConvert1() throws Exception {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
-                = multipathConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = multipathConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
-                = multipathConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = multipathConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
-                = multipathConvertor.convert(action, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = multipathConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
-                = multipathConvertor.convert(action, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = multipathConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
-                = multipathConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = multipathConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
-                = multipathConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath().getMaxLink());
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath().getMaxLink());
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getMaxLink());
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getMaxLink());
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath().getMaxLink());
-
-        Assert.assertEquals(Integer.valueOf(1), ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath().getBasis());
-        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW, ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath().getAlgorithm());
-        Assert.assertEquals(Long.valueOf(2L), ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath().getArg());
-        Assert.assertEquals(Integer.valueOf(2), ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath().getMaxLink());
+                = multipathConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath()
+                        .getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath()
+                        .getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath().getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxMultipath()
+                        .getMaxLink());
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath()
+                        .getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath()
+                        .getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath()
+                        .getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxMultipath()
+                        .getMaxLink());
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNotifGroupDescStatsUpdatedCase) actionResult2).getNxMultipath().getMaxLink());
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNodesNodeTableFlowWriteActionsCase) actionResult3).getNxMultipath().getMaxLink());
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath()
+                        .getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath()
+                        .getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath()
+                        .getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxMultipath()
+                        .getMaxLink());
+
+        Assert.assertEquals(Integer.valueOf(1),
+                ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath()
+                        .getBasis());
+        Assert.assertEquals(OfjNxMpAlgorithm.NXMPALGHRW,
+                ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath()
+                        .getAlgorithm());
+        Assert.assertEquals(Long.valueOf(2L),
+                ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath()
+                        .getArg());
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxActionMultipathNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxMultipath()
+                        .getMaxLink());
     }
 }
index 1b90f148babd0c1d062433987e1ade0e5cd2e559..e00fee65ae5953169534853bc960ed0277a15328 100644 (file)
@@ -75,7 +75,8 @@ public class OutputRegConvertorTest {
 
     @Test
     public void testConvert() throws Exception {
-        final ActionOutputReg actionOutputReg = (ActionOutputReg) outputRegConvertor.convert(actionsCase).getActionChoice();
+        final ActionOutputReg actionOutputReg =
+                (ActionOutputReg) outputRegConvertor.convert(actionsCase).getActionChoice();
         Assert.assertEquals(Integer.valueOf(1), actionOutputReg.getNxActionOutputReg().getNBits());
         Assert.assertEquals(Integer.valueOf(2), actionOutputReg.getNxActionOutputReg().getMaxLen());
     }
@@ -83,35 +84,54 @@ public class OutputRegConvertorTest {
     @Test
     public void testConvert1() throws Exception {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
-                = outputRegConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = outputRegConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
-                = outputRegConvertor.convert(action, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = outputRegConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
-                = outputRegConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = outputRegConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
-                = outputRegConvertor.convert(action, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = outputRegConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
-                = outputRegConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = outputRegConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
-                = outputRegConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxOutputReg().getSrc().getOfsNbits());
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNodesNodeTableFlowWriteActionsCase) actionResult1).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNodesNodeTableFlowWriteActionsCase) actionResult1).getNxOutputReg().getSrc().getOfsNbits());
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxOutputReg().getSrc().getOfsNbits());
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNotifGroupDescStatsUpdatedCase) actionResult3).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifGroupDescStatsUpdatedCase) actionResult3).getNxOutputReg().getSrc().getOfsNbits());
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxOutputReg().getSrc().getOfsNbits());
-
-        Assert.assertEquals(Integer.valueOf(3), ((NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxOutputReg().getMaxLen());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxOutputReg().getSrc().getOfsNbits());
-
+                = outputRegConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxOutputReg()
+                        .getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionOutputRegNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxOutputReg().getSrc()
+                        .getOfsNbits());
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNodesNodeTableFlowWriteActionsCase) actionResult1).getNxOutputReg().getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNodesNodeTableFlowWriteActionsCase) actionResult1)
+                .getNxOutputReg().getSrc().getOfsNbits());
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxOutputReg()
+                        .getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionOutputRegNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxOutputReg().getSrc()
+                        .getOfsNbits());
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNotifGroupDescStatsUpdatedCase) actionResult3).getNxOutputReg().getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4), ((NxActionOutputRegNotifGroupDescStatsUpdatedCase) actionResult3)
+                .getNxOutputReg().getSrc().getOfsNbits());
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxOutputReg()
+                        .getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionOutputRegNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxOutputReg().getSrc()
+                        .getOfsNbits());
+
+        Assert.assertEquals(Integer.valueOf(3),
+                ((NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxOutputReg()
+                        .getMaxLen());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionOutputRegNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxOutputReg().getSrc()
+                        .getOfsNbits());
     }
 }
index 394f6009d502ad3ac3c4f0ae49048c8e48e24b5a..acc6de64bdb6abd965ff3f3d57f8eb8e74880a8e 100644 (file)
@@ -85,42 +85,66 @@ public class RegLoadConvertorTest {
     @Test
     public void testConvert1() throws Exception {
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
-                = regLoadConvertor.convert(action, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = regLoadConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
-                = regLoadConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = regLoadConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
-                = regLoadConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = regLoadConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
-                = regLoadConvertor.convert(action, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = regLoadConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
-                = regLoadConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = regLoadConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
-                = regLoadConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getValue());
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getValue());
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getValue());
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getValue());
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getValue());
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(4), ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getDst().getEnd());
-        Assert.assertEquals(BigInteger.ONE, ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getValue());
-
+                = regLoadConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getDst().getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getDst().getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNodesNodeTableFlowWriteActionsCase) actionResult).getNxRegLoad().getValue());
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getDst()
+                        .getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateApplyActionsCase) actionResult1).getNxRegLoad().getValue());
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getDst()
+                        .getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegLoad().getValue());
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getDst().getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getDst().getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegLoad().getValue());
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getDst()
+                        .getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegLoad().getValue());
+
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(4),
+                ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getDst()
+                        .getEnd());
+        Assert.assertEquals(BigInteger.ONE,
+                ((NxActionRegLoadNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegLoad().getValue());
     }
-
 }
index b7c11354173a652298746b5ee47f79a41c863989..6e1f79b426c2ecde1322e2a55b367827d8fdf46d 100644 (file)
@@ -130,31 +130,50 @@ public class RegMoveConvertorTest {
     @Test
     public void testConvert1() throws Exception {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
-                = regMoveConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = regMoveConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
-                = regMoveConvertor.convert(action, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = regMoveConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
-                = regMoveConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = regMoveConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
-                = regMoveConvertor.convert(action, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = regMoveConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
-                = regMoveConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = regMoveConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
-                = regMoveConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
-
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxRegMove().getDst().getEnd());
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNodesNodeTableFlowWriteActionsCase) actionResult1).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNodesNodeTableFlowWriteActionsCase) actionResult1).getNxRegMove().getDst().getEnd());
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegMove().getDst().getEnd());
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegMove().getDst().getEnd());
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegMove().getDst().getEnd());
-        Assert.assertEquals(Integer.valueOf(0), ((NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegMove().getDst().getStart());
-        Assert.assertEquals(Integer.valueOf(6), ((NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegMove().getDst().getEnd());
+                = regMoveConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
 
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxRegMove().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxRegMove().getDst()
+                        .getEnd());
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNodesNodeTableFlowWriteActionsCase) actionResult1).getNxRegMove().getDst().getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNodesNodeTableFlowWriteActionsCase) actionResult1).getNxRegMove().getDst().getEnd());
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegMove().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNotifFlowsStatisticsUpdateWriteActionsCase) actionResult2).getNxRegMove().getDst()
+                        .getEnd());
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegMove().getDst().getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNotifGroupDescStatsUpdatedCase) actionResult3).getNxRegMove().getDst().getEnd());
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegMove().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxRegMove().getDst()
+                        .getEnd());
+        Assert.assertEquals(Integer.valueOf(0),
+                ((NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegMove().getDst()
+                        .getStart());
+        Assert.assertEquals(Integer.valueOf(6),
+                ((NxActionRegMoveNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxRegMove().getDst()
+                        .getEnd());
     }
 
     @Test
@@ -247,48 +266,85 @@ public class RegMoveConvertorTest {
 
     @Test
     public void testResolveSrc1() throws Exception {
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIdCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ARP_SHA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxArpShaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ARP_THA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxArpThaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ARP_OP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpOpCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ARP_SPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpSpaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ARP_TPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpTpaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ETH_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthDstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ETH_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthSrcCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.ETH_TYPE_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthTypeCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.TUN_IPV4_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIpv4DstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.TUN_IPV4_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIpv4SrcCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNspCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSI_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNsiCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSC1_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc1Case);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSC2_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc2Case);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSC3_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc3Case);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.NSC4_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc4Case);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.IP_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfIpDstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveSrc(NiciraMatchCodecs.IP_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfIpSrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIdCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ARP_SHA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxArpShaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ARP_THA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxArpThaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ARP_OP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpOpCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ARP_SPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpSpaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ARP_TPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfArpTpaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ETH_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthDstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ETH_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthSrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.ETH_TYPE_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfEthTypeCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(NiciraMatchCodecs.TUN_IPV4_DST_CODEC
+                .getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIpv4DstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(NiciraMatchCodecs.TUN_IPV4_SRC_CODEC
+                .getHeaderWithoutHasMask().toLong()) instanceof SrcNxTunIpv4SrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNspCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSI_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNsiCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSC1_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc1Case);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSC2_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc2Case);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSC3_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc3Case);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.NSC4_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcNxNshc4Case);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.IP_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfIpDstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveSrcValue(
+                NiciraMatchCodecs.IP_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof SrcOfIpSrcCase);
     }
 
     @Test
     public void testResolveDst1() throws Exception {
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIdCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ARP_SHA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxArpShaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ARP_THA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxArpThaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ARP_OP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpOpCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ARP_SPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpSpaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ARP_TPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpTpaCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ETH_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfEthDstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ETH_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfEthSrcCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.TUN_IPV4_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIpv4DstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.TUN_IPV4_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIpv4SrcCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNspCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSI_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNsiCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSC1_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc1Case);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSC2_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc2Case);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSC3_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc3Case);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.NSC4_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc4Case);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.IP_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIpDstCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.IP_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIpSrcCase);
-        Assert.assertTrue(RegMoveConvertor.resolveDst(NiciraMatchCodecs.ICMP_TYPE_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIcmpTypeCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIdCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ARP_SHA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxArpShaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ARP_THA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxArpThaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ARP_OP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpOpCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ARP_SPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpSpaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ARP_TPA_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfArpTpaCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ETH_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfEthDstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ETH_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfEthSrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(NiciraMatchCodecs.TUN_IPV4_DST_CODEC
+                .getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIpv4DstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(NiciraMatchCodecs.TUN_IPV4_SRC_CODEC
+                .getHeaderWithoutHasMask().toLong()) instanceof DstNxTunIpv4SrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSP_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNspCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSI_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNsiCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSC1_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc1Case);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSC2_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc2Case);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSC3_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc3Case);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.NSC4_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstNxNshc4Case);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.IP_DST_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIpDstCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.IP_SRC_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIpSrcCase);
+        Assert.assertTrue(RegMoveConvertor.resolveDstValue(
+                NiciraMatchCodecs.ICMP_TYPE_CODEC.getHeaderWithoutHasMask().toLong()) instanceof DstOfIcmpTypeCase);
     }
-
 }
index a0ac194039584ea07f114d3eb79fcd0e3a6e94d2..d471453934eca20ec1984bf5ded2aa65c45a5957 100644 (file)
@@ -74,34 +74,46 @@ public class ResubmitConvertorTest {
     @Test
     public void testConvert1() throws Exception {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult
-                = resubmitConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = resubmitConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult1
-                = resubmitConvertor.convert(action, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                = resubmitConvertor.convert(action, ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult2
-                = resubmitConvertor.convert(action, ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+                = resubmitConvertor.convert(action, ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult3
-                = resubmitConvertor.convert(action, ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION);
+                = resubmitConvertor.convert(action, ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult4
-                = resubmitConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                = resubmitConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_APPLY_ACTIONS);
         final org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action actionResult5
-                = resubmitConvertor.convert(action, ActionPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
-
-        Assert.assertEquals(3, ((NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCase) actionResult).getNxResubmit().getTable().intValue());
-
-        Assert.assertEquals(3, ((NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1).getNxResubmit().getTable().intValue());
-
-        Assert.assertEquals(3, ((NxActionResubmitNotifGroupDescStatsUpdatedCase) actionResult2).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNotifGroupDescStatsUpdatedCase) actionResult2).getNxResubmit().getTable().intValue());
-
-        Assert.assertEquals(3, ((NxActionResubmitNodesNodeTableFlowWriteActionsCase) actionResult3).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNodesNodeTableFlowWriteActionsCase) actionResult3).getNxResubmit().getTable().intValue());
-
-        Assert.assertEquals(3, ((NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCase) actionResult4).getNxResubmit().getTable().intValue());
-
-        Assert.assertEquals(3, ((NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxResubmit().getInPort().intValue());
-        Assert.assertEquals(4, ((NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCase) actionResult5).getNxResubmit().getTable().intValue());
+                = resubmitConvertor.convert(action, ActionPath.FLOWS_STATISTICS_RPC_WRITE_ACTIONS);
+
+        Assert.assertEquals(3, ((NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCase) actionResult)
+                .getNxResubmit().getInPort().intValue());
+        Assert.assertEquals(4, ((NxActionResubmitNotifFlowsStatisticsUpdateApplyActionsCase) actionResult)
+                .getNxResubmit().getTable().intValue());
+
+        Assert.assertEquals(3, ((NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1)
+                .getNxResubmit().getInPort().intValue());
+        Assert.assertEquals(4, ((NxActionResubmitNotifFlowsStatisticsUpdateWriteActionsCase) actionResult1)
+                .getNxResubmit().getTable().intValue());
+
+        Assert.assertEquals(3, ((NxActionResubmitNotifGroupDescStatsUpdatedCase) actionResult2).getNxResubmit()
+                .getInPort().intValue());
+        Assert.assertEquals(4,
+                ((NxActionResubmitNotifGroupDescStatsUpdatedCase) actionResult2).getNxResubmit().getTable().intValue());
+
+        Assert.assertEquals(3, ((NxActionResubmitNodesNodeTableFlowWriteActionsCase) actionResult3).getNxResubmit()
+                .getInPort().intValue());
+        Assert.assertEquals(4, ((NxActionResubmitNodesNodeTableFlowWriteActionsCase) actionResult3).getNxResubmit()
+                .getTable().intValue());
+
+        Assert.assertEquals(3, ((NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCase) actionResult4)
+                .getNxResubmit().getInPort().intValue());
+        Assert.assertEquals(4, ((NxActionResubmitNotifDirectStatisticsUpdateApplyActionsCase) actionResult4)
+                .getNxResubmit().getTable().intValue());
+
+        Assert.assertEquals(3, ((NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCase) actionResult5)
+                .getNxResubmit().getInPort().intValue());
+        Assert.assertEquals(4, ((NxActionResubmitNotifDirectStatisticsUpdateWriteActionsCase) actionResult5)
+                .getNxResubmit().getTable().intValue());
     }
-}
\ No newline at end of file
+}
index 72247fe5fc0b60401595a72af5df4dfd926b6b57..8f9c4cd1823cbc7c814866d7b18ed29b6bab73d6 100644 (file)
@@ -64,10 +64,12 @@ public class ArpOpConvertorTest {
         nxAugMatchRpcAddFlowBuilder.setNxmOfArpOp(nxmOfArpOpBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+                .thenReturn(extensionAugmentation);
 
-        final MatchEntry matchEntry = arpOpConvertor.convert(extension);
-        Assert.assertEquals(nxAugMatchRpcAddFlowBuilder.getNxmOfArpOp().getValue(), ((ArpOpCaseValue)matchEntry.getMatchEntryValue()).getArpOpValues().getValue());
+        final MatchEntry converted = arpOpConvertor.convert(extension);
+        Assert.assertEquals(nxAugMatchRpcAddFlowBuilder.getNxmOfArpOp().getValue(),
+                ((ArpOpCaseValue) converted.getMatchEntryValue()).getArpOpValues().getValue());
     }
 
     @Test
@@ -80,21 +82,29 @@ public class ArpOpConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpOpCase);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpOpConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfArpOp().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpOpConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpOp().getValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpOpKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpOpConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNodesNodeTableFlow)extensionAugment1.getAugmentationObject()).getNxmOfArpOp().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpOpConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment1.getAugmentationObject()).getNxmOfArpOp().getValue());
         Assert.assertEquals(extensionAugment1.getKey(), NxmOfArpOpKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpOpConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment2.getAugmentationObject()).getNxmOfArpOp().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpOpConvertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment2.getAugmentationObject()).getNxmOfArpOp()
+                        .getValue());
         Assert.assertEquals(extensionAugment2.getKey(), NxmOfArpOpKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpOpConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfArpOp().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpOpConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(arpOpCase.getArpOp().getOpCode(),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfArpOp().getValue());
         Assert.assertEquals(extensionAugment3.getKey(), NxmOfArpOpKey.class);
-
     }
 }
index ff7a7d57637f0692799ae54f7a78cebcd2273d04..5f70f50f7245e7fb227823f3b4cc4ad891dcadef 100644 (file)
@@ -61,15 +61,17 @@ public class ArpShaConvertorTest {
                 .setNxmNxArpSha(nxmNxArpShaBuilder.build());
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
 
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         arpShaConvertor = new ArpShaConvertor();
     }
 
     @Test
     public void testConvertToOFJava() throws Exception {
-        final MatchEntry matchEntry = arpShaConvertor.convert(extension);
-        Assert.assertEquals(MAC_ADDRESS.getValue(), ((ArpShaCaseValue)matchEntry.getMatchEntryValue()).getArpShaValues().getMacAddress().getValue());
+        final MatchEntry converted = arpShaConvertor.convert(extension);
+        Assert.assertEquals(MAC_ADDRESS.getValue(),
+                ((ArpShaCaseValue) converted.getMatchEntryValue()).getArpShaValues().getMacAddress().getValue());
     }
 
     @Test
@@ -82,20 +84,31 @@ public class ArpShaConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpShaCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpShaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpShaConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpShaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpShaConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpSha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpShaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpShaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpSha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpShaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpShaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpSha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
     }
 
index f9c5f8a27e7ea2047c846a9cbd971a7639c73866..c4d3033223bec21684d69a872e656b6bf1c52f77 100644 (file)
@@ -63,16 +63,18 @@ public class ArpSpaConvertorTest {
         nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+                .thenReturn(extensionAugmentation);
 
-        final MatchEntry matchEntry = arpSpaConvertor.convert(extension);
-        Assert.assertEquals(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS), ((ArpSpaCaseValue)matchEntry.getMatchEntryValue()).getArpSpaValues().getValue().longValue());
+        final MatchEntry converted = arpSpaConvertor.convert(extension);
+        Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
+                ((ArpSpaCaseValue) converted.getMatchEntryValue()).getArpSpaValues().getValue().longValue());
     }
 
     @Test
     public void testConvertFromOFJava() throws Exception {
         final ArpSpaValuesBuilder arpSpaValuesBuilder = new ArpSpaValuesBuilder()
-                .setValue(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS));
+                .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
         final ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder()
                 .setArpSpaValues(arpSpaValuesBuilder.build());
 
@@ -80,22 +82,28 @@ public class ArpSpaConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpSpaCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpSpaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpSpaConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpSpaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpSpaConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfArpSpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpSpaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpSpaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfArpSpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpSpaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfArpSpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpSpaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmOfArpSpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpSpaKey.class);
-
     }
-
 }
index 22f46b2b9296cb3985d46eeb12dc39370a106f09..13520a1923cc0da66f63cae22c7b8599af826b29 100644 (file)
@@ -58,15 +58,17 @@ public class ArpThaConvertorTest {
                 .setNxmNxArpTha(nxArpThaBuilder.build());
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
 
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         arpThaConvertor = new ArpThaConvertor();
     }
 
     @Test
     public void testConvertToOFJava() throws Exception {
-        final MatchEntry matchEntry = arpThaConvertor.convert(extension);
-        Assert.assertEquals(MAC_ADDRESS.getValue(), ((ArpThaCaseValue)matchEntry.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
+        final MatchEntry converted = arpThaConvertor.convert(extension);
+        Assert.assertEquals(MAC_ADDRESS.getValue(),
+                ((ArpThaCaseValue) converted.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
     }
 
     @Test
@@ -79,22 +81,31 @@ public class ArpThaConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpThaCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpTha()
+                        .getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
-
     }
-
 }
index ffc625f8135e3f1198071606c6faab2815498e2f..add196126cbb62d6fd9dffb025c18254226d0965 100644 (file)
@@ -59,21 +59,23 @@ public class ArpTpaConvertorTest {
         nxAugMatchRpcAddFlowBuilder.setNxmOfArpTpa(nxmOfArpTpaBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         arpTpaConvertor = new ArpTpaConvertor();
     }
 
     @Test
     public void testConvertFromOFJava() throws Exception {
-        final MatchEntry matchEntry = arpTpaConvertor.convert(extension);
-        Assert.assertEquals(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS), ((ArpTpaCaseValue)matchEntry.getMatchEntryValue()).getArpTpaValues().getValue().longValue());
+        final MatchEntry converted = arpTpaConvertor.convert(extension);
+        Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
+                ((ArpTpaCaseValue)converted.getMatchEntryValue()).getArpTpaValues().getValue().longValue());
     }
 
     @Test
     public void testConvertToOFJava() throws Exception {
         final ArpTpaValuesBuilder arpTpaValuesBuilder = new ArpTpaValuesBuilder()
-                .setValue(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS));
+                .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
         final ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder()
                 .setArpTpaValues(arpTpaValuesBuilder.build());
 
@@ -81,21 +83,28 @@ public class ArpTpaConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(arpTpaCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpTpaConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpTpaConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpTpaConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpTpaConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfArpTpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpTpaConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpTpaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfArpTpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpTpaConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfArpTpa().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpTpaConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmOfArpTpa().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfArpTpaKey.class);
     }
-
 }
index b4af7380e5f2df7e279a2e6a8e6f8ca096f5e139..a4b3a3fd208bf099520d7bedb909f903c61406c6 100644 (file)
@@ -52,20 +52,24 @@ public class CtStateConvertorTest {
         final NxmNxCtStateBuilder nxmNxCtStateBuilder = new NxmNxCtStateBuilder()
                 .setCtState(1L)
                 .setMask(2L);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtState(nxmNxCtStateBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         ctStateConvertor = new CtStateConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = ctStateConvertor.convert(extension);
-        Assert.assertEquals(1L, ((CtStateCaseValue)matchEntry.getMatchEntryValue()).getCtStateValues().getCtState().longValue());
-        Assert.assertEquals(2L, ((CtStateCaseValue)matchEntry.getMatchEntryValue()).getCtStateValues().getMask().longValue());
+        final MatchEntry converted = ctStateConvertor.convert(extension);
+        Assert.assertEquals(1L,
+                ((CtStateCaseValue) converted.getMatchEntryValue()).getCtStateValues().getCtState().longValue());
+        Assert.assertEquals(2L,
+                ((CtStateCaseValue) converted.getMatchEntryValue()).getCtStateValues().getMask().longValue());
     }
 
     @Test
@@ -81,26 +85,36 @@ public class CtStateConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(ctStateCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctStateConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(3L, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
-        Assert.assertEquals(4L, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctStateConvertor
+                .convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(3L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtState()
+                .getCtState().longValue());
+        Assert.assertEquals(4L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtState()
+                .getMask().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctStateConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(3L, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
-        Assert.assertEquals(4L, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctStateConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(3L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxCtState().getCtState().longValue());
+        Assert.assertEquals(4L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxCtState().getMask().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctStateConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(3L, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
-        Assert.assertEquals(4L, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctStateConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(3L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxCtState().getCtState().longValue());
+        Assert.assertEquals(4L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxCtState().getMask().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctStateConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(3L, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
-        Assert.assertEquals(4L, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctStateConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(3L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmNxCtState().getCtState().longValue());
+        Assert.assertEquals(4L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmNxCtState().getMask().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
-
     }
-
 }
index e9f8523b7d2bad5772067d76dad71e9fb285b7b8..fbf720f7b0dd9ee36055029c2e42021d428ce23b 100644 (file)
@@ -51,11 +51,13 @@ public class CtZoneConvertorTest {
 
         final NxmNxCtZoneBuilder nxmNxCtZoneBuilder = new NxmNxCtZoneBuilder()
                 .setCtZone(1);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtZone(nxmNxCtZoneBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         ctZoneConvertor = new CtZoneConvertor();
 
@@ -63,8 +65,9 @@ public class CtZoneConvertorTest {
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = ctZoneConvertor.convert(extension);
-        Assert.assertEquals(1L, ((CtZoneCaseValue)matchEntry.getMatchEntryValue()).getCtZoneValues().getCtZone().longValue());
+        final MatchEntry converted = ctZoneConvertor.convert(extension);
+        Assert.assertEquals(1L,
+                ((CtZoneCaseValue) converted.getMatchEntryValue()).getCtZoneValues().getCtZone().longValue());
     }
 
     @Test
@@ -78,22 +81,28 @@ public class CtZoneConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(ctZoneCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctZoneConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(2L, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctZoneConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(2L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtZone()
+                .getCtZone().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctZoneConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(2L, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctZoneConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(2L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxCtZone().getCtZone().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2L, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctZoneConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(2L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxCtZone().getCtZone().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctZoneConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2L, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctZoneConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(2L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtZone()
+                .getCtZone().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
-
     }
-
 }
index 0b93853424f9cfc0bd8813d8c9d72e3b85e28308..fbc693beae1e1e8b894d06bc9504a62f2cda48d4 100644 (file)
@@ -54,11 +54,13 @@ public class EthDstConvertorTest {
 
         final NxmOfEthDstBuilder nxmOfEthDstBuilder = new NxmOfEthDstBuilder()
                 .setMacAddress(MAC_ADDRESS);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthDst(nxmOfEthDstBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         ethDstConvertor = new EthDstConvertor();
 
@@ -66,8 +68,9 @@ public class EthDstConvertorTest {
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = ethDstConvertor.convert(extension);
-        Assert.assertEquals(MAC_ADDRESS, ((EthDstCaseValue)matchEntry.getMatchEntryValue()).getEthDstValues().getMacAddress());
+        final MatchEntry converted = ethDstConvertor.convert(extension);
+        Assert.assertEquals(MAC_ADDRESS, ((EthDstCaseValue)converted.getMatchEntryValue())
+                .getEthDstValues().getMacAddress());
     }
 
     @Test
@@ -81,23 +84,28 @@ public class EthDstConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(ethDstCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethDstConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethDstConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(MAC_ADDRESS,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethDstConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethDstConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfEthDst().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethDstConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfEthDst().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethDstConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmOfEthDst().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
-
-
-
     }
 }
index c9cb4024391e1f41138884a21611ed0f08874357..23bb8c9127f709a9e002ad936aa4bb461815369d 100644 (file)
@@ -53,19 +53,22 @@ public class EthSrcConvertorTest {
     public void setUp() throws Exception {
         final NxmOfEthSrcBuilder nxmOfEthSrcBuilder = new NxmOfEthSrcBuilder()
                 .setMacAddress(MAC_ADDRESS);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthSrc(nxmOfEthSrcBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         ethSrcConvertor = new EthSrcConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = ethSrcConvertor.convert(extension);
-        Assert.assertEquals(MAC_ADDRESS, ((EthSrcCaseValue)matchEntry.getMatchEntryValue()).getEthSrcValues().getMacAddress());
+        final MatchEntry converted = ethSrcConvertor.convert(extension);
+        Assert.assertEquals(MAC_ADDRESS, ((EthSrcCaseValue)converted.getMatchEntryValue())
+                .getEthSrcValues().getMacAddress());
     }
 
     @Test
@@ -79,20 +82,28 @@ public class EthSrcConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(ethSrcCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethSrcConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethSrcConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(MAC_ADDRESS,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethSrcConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethSrcConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfEthSrc().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethSrcConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfEthSrc().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethSrcConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmOfEthSrc().getMacAddress());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
     }
 }
index 8ea3b0ace039ccd2becb38905e375c3a253cf848..6a4e7556d557eca86c5dab4be4df0efd68cc6db7 100644 (file)
@@ -51,11 +51,13 @@ public class EthTypeConvertorTest {
 
         final NxmOfEthTypeBuilder nxmOfEthTypeBuilder = new NxmOfEthTypeBuilder()
                 .setValue(1);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthType(nxmOfEthTypeBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         ethTypeConvertor = new EthTypeConvertor();
 
@@ -63,8 +65,9 @@ public class EthTypeConvertorTest {
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = ethTypeConvertor.convert(extension);
-        Assert.assertEquals(1, ((EthTypeCaseValue)matchEntry.getMatchEntryValue()).getEthTypeValues().getValue().intValue());
+        final MatchEntry converted = ethTypeConvertor.convert(extension);
+        Assert.assertEquals(1, ((EthTypeCaseValue)converted.getMatchEntryValue())
+                .getEthTypeValues().getValue().intValue());
     }
 
     @Test
@@ -78,20 +81,28 @@ public class EthTypeConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(ethTypeCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethTypeConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethTypeConvertor
+                .convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthType()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethTypeConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethTypeConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfEthType().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethTypeConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethTypeConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfEthType().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethTypeConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethTypeConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthType()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
     }
 }
index 0b30ba491c14ec92425da2613156cbee706d6e85..111d205a75e2113c9698596be821fea07c909120 100644 (file)
@@ -50,19 +50,21 @@ public class Nshc1ConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNshc1Builder nxmNxNshc1Builder = new NxmNxNshc1Builder()
                 .setValue(1L);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc1(nxmNxNshc1Builder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nshc1Convertor = new Nshc1Convertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nshc1Convertor.convert(extension);
-        Assert.assertEquals(1, ((Nshc1CaseValue)matchEntry.getMatchEntryValue()).getNshc1Values().getNshc().intValue());
+        final MatchEntry converted = nshc1Convertor.convert(extension);
+        Assert.assertEquals(1, ((Nshc1CaseValue)converted.getMatchEntryValue()).getNshc1Values().getNshc().intValue());
     }
 
     @Test
@@ -76,21 +78,28 @@ public class Nshc1ConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nshc1CaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc1Convertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc1Convertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc1()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc1Convertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc1Convertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNshc1().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc1Convertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc1Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxNshc1().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc1Convertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc1Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc1()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
     }
-
 }
index 45259273f0004a59f5a3c948d6f4171f61de6bec..26fcc44113859c282da1ac0a4bc1960167293e0f 100644 (file)
@@ -49,19 +49,21 @@ public class Nshc2ConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNshc2Builder nxmNxNshc2Builder = new NxmNxNshc2Builder()
                 .setValue(1L);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc2(nxmNxNshc2Builder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nshc2Convertor = new Nshc2Convertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nshc2Convertor.convert(extension);
-        Assert.assertEquals(1, ((Nshc2CaseValue)matchEntry.getMatchEntryValue()).getNshc2Values().getNshc().intValue());
+        final MatchEntry converted = nshc2Convertor.convert(extension);
+        Assert.assertEquals(1, ((Nshc2CaseValue)converted.getMatchEntryValue()).getNshc2Values().getNshc().intValue());
     }
 
     @Test
@@ -75,22 +77,28 @@ public class Nshc2ConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nshc2CaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc2Convertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc2Convertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc2()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc2Convertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc2Convertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNshc2().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc2Convertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc2Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxNshc2().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc2Convertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc2Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc2()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
     }
-
-
 }
index 9d13b124fb8f3f67203538e9d2b47c92043b7802..ecf8c2f852d4f08c6caf3d91efee8ccf68354854 100644 (file)
@@ -50,19 +50,21 @@ public class Nshc3ConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNshc3Builder nxmNxNshc3Builder = new NxmNxNshc3Builder()
                 .setValue(1L);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc3(nxmNxNshc3Builder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nshc3Convertor = new Nshc3Convertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nshc3Convertor.convert(extension);
-        Assert.assertEquals(1, ((Nshc3CaseValue)matchEntry.getMatchEntryValue()).getNshc3Values().getNshc().intValue());
+        final MatchEntry converted = nshc3Convertor.convert(extension);
+        Assert.assertEquals(1, ((Nshc3CaseValue)converted.getMatchEntryValue()).getNshc3Values().getNshc().intValue());
     }
 
     @Test
@@ -76,21 +78,28 @@ public class Nshc3ConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nshc3CaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc3Convertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc3Convertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc3()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc3Convertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc3Convertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNshc3().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc3Convertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc3Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxNshc3().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc3Convertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNshc3().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc3Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc3()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc3Key.class);
     }
-
 }
index 4a4a54d854e5e7a9cac75cf469ca1ed67a1164ad..4a6de9e4579d4d0bc96311880007318c575dc5e9 100644 (file)
@@ -49,19 +49,21 @@ public class Nshc4ConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNshc4Builder nxmNxNshc4Builder = new NxmNxNshc4Builder()
                 .setValue(1L);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc4(nxmNxNshc4Builder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nshc4Convertor = new Nshc4Convertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nshc4Convertor.convert(extension);
-        Assert.assertEquals(1, ((Nshc4CaseValue)matchEntry.getMatchEntryValue()).getNshc4Values().getNshc().intValue());
+        final MatchEntry converted = nshc4Convertor.convert(extension);
+        Assert.assertEquals(1, ((Nshc4CaseValue)converted.getMatchEntryValue()).getNshc4Values().getNshc().intValue());
     }
 
     @Test
@@ -75,20 +77,28 @@ public class Nshc4ConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nshc4CaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc4Convertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc4Convertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc4()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc4Convertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc4Convertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNshc4().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc4Convertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc4Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxNshc4().getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc4Convertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc4Convertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc4()
+                .getValue().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
     }
 }
index 0d799a5d1cc06e53d9ae4f37591bbc0e2685c61e..55cf9af277586dd9fdcde7330d7f2cf22f523fb7 100644 (file)
@@ -49,19 +49,21 @@ public class NsiConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNsiBuilder nxmNxNsiBuilder = new NxmNxNsiBuilder()
                 .setNsi((short)1);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNsi(nxmNxNsiBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nsiConvertor = new NsiConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nsiConvertor.convert(extension);
-        Assert.assertEquals(1, ((NsiCaseValue)matchEntry.getMatchEntryValue()).getNsiValues().getNsi().intValue());
+        final MatchEntry converted = nsiConvertor.convert(extension);
+        Assert.assertEquals(1, ((NsiCaseValue)converted.getMatchEntryValue()).getNsiValues().getNsi().intValue());
     }
 
     @Test
@@ -75,21 +77,28 @@ public class NsiConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nsiCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nsiConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nsiConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(1,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nsiConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nsiConvertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNsi().getNsi().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nsiConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nsiConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsi()
+                .getNsi().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nsiConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nsiConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsi()
+                .getNsi().intValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
     }
-
 }
index 87a8abf2e9e85a9ec5d5bde2f59072cf2f025714..f52fceb926bd3372a985e49f2c307b3cc046aec3 100644 (file)
@@ -49,19 +49,21 @@ public class NspConvertorTest {
     public void setUp() throws Exception {
         final NxmNxNspBuilder nxmNxNspBuilder = new NxmNxNspBuilder()
                 .setValue(Long.valueOf(1L));
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNsp(nxmNxNspBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         nspConvertor = new NspConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = nspConvertor.convert(extension);
-        Assert.assertEquals(1, ((NspCaseValue)matchEntry.getMatchEntryValue()).getNspValues().getNsp().intValue());
+        final MatchEntry converted = nspConvertor.convert(extension);
+        Assert.assertEquals(1, ((NspCaseValue)converted.getMatchEntryValue()).getNspValues().getNsp().intValue());
     }
 
     @Test
@@ -75,20 +77,28 @@ public class NspConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(nspCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nspConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nspConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsp()
+                .getValue().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nspConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nspConvertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxNsp().getValue().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nspConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nspConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsp()
+                .getValue().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nspConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nspConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsp()
+                .getValue().longValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
     }
 }
index 5ea0c76f7087d83e428ebaef7cb4257986b5d55e..8b0f7ed053585ae5ad912f663d69ac80fb0d06ba 100644 (file)
@@ -53,20 +53,24 @@ public class TcpDstConvertorTest {
         final NxmOfTcpDstBuilder nxmOfTcpDstBuilder = new NxmOfTcpDstBuilder()
                 .setMask(1)
                 .setPort(DEFAULT_PORT);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpDst(nxmOfTcpDstBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         tcpDstConvertor = new TcpDstConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = tcpDstConvertor.convert(extension);
-        Assert.assertEquals(1, ((TcpDstCaseValue)matchEntry.getMatchEntryValue()).getTcpDstValues().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((TcpDstCaseValue)matchEntry.getMatchEntryValue()).getTcpDstValues().getPort());
+        final MatchEntry converted = tcpDstConvertor.convert(extension);
+        Assert.assertEquals(1,
+                ((TcpDstCaseValue) converted.getMatchEntryValue()).getTcpDstValues().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((TcpDstCaseValue) converted.getMatchEntryValue()).getTcpDstValues().getPort());
     }
 
     @Test
@@ -81,24 +85,36 @@ public class TcpDstConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(tcpDstCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpDstConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfTcpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpDstConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpDst()
+                .getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpDstConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfTcpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpDstConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfTcpDst().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfTcpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpDstConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfTcpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfTcpDst().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpDstConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfTcpDst().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfTcpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpDst()
+                .getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpDstKey.class);
     }
 }
index d873b2d74ef0fdd2860ed9f7b841906ca87f902e..6bee196ea1d4042ce5242b976431347938673ddc 100644 (file)
@@ -53,20 +53,24 @@ public class TcpSrcConvertorTest {
         final NxmOfTcpSrcBuilder nxmOfTcpSrcBuilder = new NxmOfTcpSrcBuilder()
                 .setMask(1)
                 .setPort(DEFAULT_PORT);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpSrc(nxmOfTcpSrcBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         tcpSrcConvertor = new TcpSrcConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = tcpSrcConvertor.convert(extension);
-        Assert.assertEquals(1, ((TcpSrcCaseValue)matchEntry.getMatchEntryValue()).getTcpSrcValues().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((TcpSrcCaseValue)matchEntry.getMatchEntryValue()).getTcpSrcValues().getPort());
+        final MatchEntry converted = tcpSrcConvertor.convert(extension);
+        Assert.assertEquals(1,
+                ((TcpSrcCaseValue) converted.getMatchEntryValue()).getTcpSrcValues().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((TcpSrcCaseValue) converted.getMatchEntryValue()).getTcpSrcValues().getPort());
     }
 
     @Test
@@ -81,24 +85,36 @@ public class TcpSrcConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(tcpSrcCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpSrcConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfTcpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tcpSrcConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpSrc()
+                .getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfTcpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpSrcConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfTcpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tcpSrcConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfTcpSrc().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfTcpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpSrcConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfTcpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tcpSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmOfTcpSrc().getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfTcpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpSrcConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc().getMask().intValue());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tcpSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc()
+                .getMask().intValue());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfTcpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfTcpSrcKey.class);
     }
 }
index 58f7318d6dd8d12c57df9b5af82b2c560f0e9d12..7f8a48e46592b58e43ee51dca6291d00e306a0fc 100644 (file)
@@ -53,25 +53,28 @@ public class TunIPv4DstConvertorTest {
     public void setUp() throws Exception {
         final NxmNxTunIpv4DstBuilder nxmNxTunIpv4DstBuilder = new NxmNxTunIpv4DstBuilder()
                 .setIpv4Address(IPV4_ADDRESS);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Dst(nxmNxTunIpv4DstBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         tunIPv4DstConvertor = new TunIPv4DstConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = tunIPv4DstConvertor.convert(extension);
-        Assert.assertEquals(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS), ((TunIpv4DstCaseValue)matchEntry.getMatchEntryValue()).getTunIpv4DstValues().getValue().longValue());
+        final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
+        Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
+                ((TunIpv4DstCaseValue)converted.getMatchEntryValue()).getTunIpv4DstValues().getValue().longValue());
     }
 
     @Test
     public void testConvert1() throws Exception {
         final TunIpv4DstValuesBuilder tunIpv4DstValuesBuilder = new TunIpv4DstValuesBuilder()
-                .setValue(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS));
+                .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
         final TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder()
                 .setTunIpv4DstValues(tunIpv4DstValuesBuilder.build());
 
@@ -79,21 +82,28 @@ public class TunIPv4DstConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(tunIpv4DstCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject())
+                .getNxmNxTunIpv4Dst().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxTunIpv4Dst().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxTunIpv4Dst().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxTunIpv4Dst().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmNxTunIpv4Dst().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4DstKey.class);
     }
-
 }
index fdd5cceeba8c39df687b6709104e12bd82943c84..ccfd790f843ee54ce8d1a4fc9e558e2be16ab3e8 100644 (file)
@@ -53,25 +53,28 @@ public class TunIPv4SrcConvertorTest {
     public void setUp() throws Exception {
         final NxmNxTunIpv4SrcBuilder nxmNxTunIpv4SrcBuilder = new NxmNxTunIpv4SrcBuilder()
                 .setIpv4Address(IPV4_ADDRESS);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Src(nxmNxTunIpv4SrcBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         tunIPv4DstConvertor = new TunIPv4SrcConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = tunIPv4DstConvertor.convert(extension);
-        Assert.assertEquals(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS), ((TunIpv4SrcCaseValue)matchEntry.getMatchEntryValue()).getTunIpv4SrcValues().getValue().longValue());
+        final MatchEntry converted = tunIPv4DstConvertor.convert(extension);
+        Assert.assertEquals(IpConverter.ipv4AddressToLong(IPV4_ADDRESS),
+                ((TunIpv4SrcCaseValue) converted.getMatchEntryValue()).getTunIpv4SrcValues().getValue().longValue());
     }
 
     @Test
     public void testConvert1() throws Exception {
         final TunIpv4SrcValuesBuilder tunIpv4SrcValuesBuilder = new TunIpv4SrcValuesBuilder()
-                .setValue(IpConverter.Ipv4AddressToLong(IPV4_ADDRESS));
+                .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
         final TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder()
                 .setTunIpv4SrcValues(tunIpv4SrcValuesBuilder.build());
 
@@ -79,21 +82,28 @@ public class TunIPv4SrcConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(tunIpv4SrcCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject())
+                .getNxmNxTunIpv4Src().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmNxTunIpv4Src().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject())
+                .getNxmNxTunIpv4Src().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxTunIpv4Src().getIpv4Address());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIPv4DstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(IPV4_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject())
+                .getNxmNxTunIpv4Src().getIpv4Address());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIpv4SrcKey.class);
     }
-
 }
index 9dda6e10ce93888ccb2103b32fb677a194aa04a0..1a1cb6c0d42adc5870ccccad08485c9eec3856a6 100644 (file)
@@ -50,19 +50,22 @@ public class TunIdConvertorTest {
     public void setUp() throws Exception {
         final NxmNxTunIdBuilder nxmNxTunIdBuilder = new NxmNxTunIdBuilder()
                 .setValue(BigInteger.ONE);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunId(nxmNxTunIdBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         tunIdConvertor = new TunIdConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = tunIdConvertor.convert(extension);
-        Assert.assertEquals(BigInteger.ONE, ((TunIdCaseValue)matchEntry.getMatchEntryValue()).getTunIdValues().getValue());
+        final MatchEntry converted = tunIdConvertor.convert(extension);
+        Assert.assertEquals(BigInteger.ONE, ((TunIdCaseValue)converted.getMatchEntryValue())
+                .getTunIdValues().getValue());
     }
 
     @Test
@@ -76,21 +79,29 @@ public class TunIdConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(tunIdCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIdConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmNxTunId().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIdConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(BigInteger.TEN,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxTunId().getValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIdConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmNxTunId().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIdConvertor.convert(matchEntry,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(BigInteger.TEN,
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxTunId()
+                        .getValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIdConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmNxTunId().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIdConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(BigInteger.TEN,
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxTunId().getValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIdConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(BigInteger.TEN, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmNxTunId().getValue());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIdConvertor.convert(matchEntry,
+                MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(BigInteger.TEN,
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxTunId().getValue());
         Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
     }
-
 }
index d2a4bf0186a2eb1455d611dd6dff40b0d58a256c..9eeae22d98461beca3f03046af9b03e74d1a7afc 100644 (file)
@@ -53,20 +53,24 @@ public class UdpDstConvertorTest {
         final NxmOfUdpDstBuilder nxmOfUdpDstBuilder = new NxmOfUdpDstBuilder()
                 .setMask(1)
                 .setPort(DEFAULT_PORT);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpDst(nxmOfUdpDstBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         udpDstConvertor = new UdpDstConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = udpDstConvertor.convert(extension);
-        Assert.assertEquals(Integer.valueOf(1), ((UdpDstCaseValue)matchEntry.getMatchEntryValue()).getUdpDstValues().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((UdpDstCaseValue)matchEntry.getMatchEntryValue()).getUdpDstValues().getPort());
+        final MatchEntry converted = udpDstConvertor.convert(extension);
+        Assert.assertEquals(Integer.valueOf(1),
+                ((UdpDstCaseValue) converted.getMatchEntryValue()).getUdpDstValues().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((UdpDstCaseValue) converted.getMatchEntryValue()).getUdpDstValues().getPort());
     }
 
     @Test
@@ -81,25 +85,37 @@ public class UdpDstConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(udpDstCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = udpDstConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = udpDstConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = udpDstConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfUdpDst().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfUdpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = udpDstConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfUdpDst()
+                        .getMask());
+        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfUdpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = udpDstConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = udpDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = udpDstConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = udpDstConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpDst().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpDstKey.class);
     }
-
 }
index 27384236786ec15383c4fbd704f095c003b03f81..a4bd524d4f9604a706c3c11df1b57ebd6ea884f8 100644 (file)
@@ -53,20 +53,24 @@ public class UdpSrcConvertorTest {
         final NxmOfUdpSrcBuilder nxmOfUdpSrcBuilder = new NxmOfUdpSrcBuilder()
                 .setMask(1)
                 .setPort(DEFAULT_PORT);
-        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
+        final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder =
+                new NxAugMatchNodesNodeTableFlowBuilder();
         nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpSrc(nxmOfUdpSrcBuilder.build());
 
         final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
-        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
+        when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+            .thenReturn(extensionAugmentation);
 
         udpSrcConvertor = new UdpSrcConvertor();
     }
 
     @Test
     public void testConvert() throws Exception {
-        final MatchEntry matchEntry = udpSrcConvertor.convert(extension);
-        Assert.assertEquals(Integer.valueOf(1), ((UdpSrcCaseValue)matchEntry.getMatchEntryValue()).getUdpSrcValues().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((UdpSrcCaseValue)matchEntry.getMatchEntryValue()).getUdpSrcValues().getPort());
+        final MatchEntry converted = udpSrcConvertor.convert(extension);
+        Assert.assertEquals(Integer.valueOf(1),
+                ((UdpSrcCaseValue) converted.getMatchEntryValue()).getUdpSrcValues().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((UdpSrcCaseValue) converted.getMatchEntryValue()).getUdpSrcValues().getPort());
     }
 
     @Test
@@ -81,25 +85,37 @@ public class UdpSrcConvertorTest {
 
         when(matchEntry.getMatchEntryValue()).thenReturn(udpSrcCaseValue);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = udpSrcConvertor.convert(matchEntry, MatchPath.PACKETRECEIVED_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfUdpSrc().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifPacketIn)extensionAugment.getAugmentationObject()).getNxmOfUdpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = udpSrcConvertor.convert(matchEntry,
+                MatchPath.PACKET_RECEIVED_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpSrc().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfUdpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = udpSrcConvertor.convert(matchEntry, MatchPath.SWITCHFLOWREMOVED_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfUdpSrc().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved)extensionAugment1.getAugmentationObject()).getNxmOfUdpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = udpSrcConvertor
+                .convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfUdpSrc()
+                        .getMask());
+        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject())
+                .getNxmOfUdpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = udpSrcConvertor.convert(matchEntry, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfUdpSrc().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchNodesNodeTableFlow)extensionAugment2.getAugmentationObject()).getNxmOfUdpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = udpSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpSrc().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfUdpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpSrcKey.class);
 
-        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = udpSrcConvertor.convert(matchEntry, MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
-        Assert.assertEquals(Integer.valueOf(2), ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfUdpSrc().getMask());
-        Assert.assertEquals(DEFAULT_PORT, ((NxAugMatchRpcGetFlowStats)extensionAugment3.getAugmentationObject()).getNxmOfUdpSrc().getPort());
+        final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = udpSrcConvertor
+                .convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
+        Assert.assertEquals(Integer.valueOf(2),
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpSrc().getMask());
+        Assert.assertEquals(DEFAULT_PORT,
+                ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfUdpSrc().getPort());
         Assert.assertEquals(extensionAugment.getKey(), NxmOfUdpSrcKey.class);
     }
-
 }
index bf6b240fd97150e302ee281c4eb4bcb8d47fa85a..b2e5551e4f9440bd5487a2ea92d44239d3c2d863 100644 (file)
@@ -11,13 +11,14 @@ package org.opendaylight.openflowplugin.extension.onf;
 /**
  * Stores common constants for ONF approved extensions.
  */
-public abstract class OnfConstants {
+public interface OnfConstants {
 
-    /** Experimenter ID of ONF approved extensions */
-    public static final long ONF_EXPERIMENTER_ID = 0x4F4E4600;
-    /** ONF_ET_BUNDLE_CONTROL message type */
-    public static final int ONF_ET_BUNDLE_CONTROL = 2300;
-    /** ONF_ET_BUNDLE_ADD_MESSAGE message type */
-    public static final int ONF_ET_BUNDLE_ADD_MESSAGE = 2301;
+    /** Experimenter ID of ONF approved extensions. */
+    long ONF_EXPERIMENTER_ID = 0x4F4E4600;
 
+    /** ONF_ET_BUNDLE_CONTROL message type. */
+    int ONF_ET_BUNDLE_CONTROL = 2300;
+
+    /** ONF_ET_BUNDLE_ADD_MESSAGE message type. */
+    int ONF_ET_BUNDLE_ADD_MESSAGE = 2301;
 }
index 61b0b03485a0b341db415d1e6dea6f266ba07f5f..f154165e5bcf8e5c7e14cccf2adf01c097abec74 100644 (file)
@@ -42,8 +42,8 @@ public class OnfExtensionProvider {
     private final SwitchConnectionProvider switchConnectionProvider;
     private final ExtensionConverterRegistrator converterRegistrator;
 
-    private static final BundleControlConverter bundleControlConverter = new BundleControlConverter();
-    private static final BundleAddMessageConverter bundleAddMessageConverter = new BundleAddMessageConverter();
+    private static final BundleControlConverter BUNDLE_CONTROL_CONVERTER = new BundleControlConverter();
+    private static final BundleAddMessageConverter BUNDLE_ADD_MESSAGE_CONVERTER = new BundleAddMessageConverter();
 
     public OnfExtensionProvider(final SwitchConnectionProvider switchConnectionProvider,
                                 final OpenFlowPluginExtensionRegistratorProvider converterRegistrator) {
@@ -95,13 +95,15 @@ public class OnfExtensionProvider {
 
     private void registerConverters() {
         converterRegistrator.registerMessageConvertor(
-                new TypeVersionKey<>(BundleControlSal.class, OFConstants.OFP_VERSION_1_3), bundleControlConverter);
+                new TypeVersionKey<>(BundleControlSal.class, OFConstants.OFP_VERSION_1_3), BUNDLE_CONTROL_CONVERTER);
         converterRegistrator.registerMessageConvertor(
-                new MessageTypeKey<>(OFConstants.OFP_VERSION_1_3, BundleControlOnf.class), bundleControlConverter);
+                new MessageTypeKey<>(OFConstants.OFP_VERSION_1_3, BundleControlOnf.class), BUNDLE_CONTROL_CONVERTER);
         converterRegistrator.registerMessageConvertor(
-                new TypeVersionKey<>(BundleAddMessageSal.class, OFConstants.OFP_VERSION_1_3), bundleAddMessageConverter);
+                new TypeVersionKey<>(BundleAddMessageSal.class, OFConstants.OFP_VERSION_1_3),
+                    BUNDLE_ADD_MESSAGE_CONVERTER);
         converterRegistrator.registerMessageConvertor(
-                new MessageTypeKey<>(OFConstants.OFP_VERSION_1_3, BundleAddMessageOnf.class), bundleAddMessageConverter);
+                new MessageTypeKey<>(OFConstants.OFP_VERSION_1_3, BundleAddMessageOnf.class),
+                    BUNDLE_ADD_MESSAGE_CONVERTER);
     }
 
 }
index 11a3c8d4c8c86ae846552eed322821c86d5ea408..af6c5c238dbfcfaca8d92b65d8ce742a538d3bcf 100644 (file)
@@ -67,7 +67,7 @@ public class BundleAddMessageConverter implements
         ConvertorMessageFromOFJava<BundleAddMessageOnf, MessagePath>,
         BundleMessageDataInjector {
 
-    private static final ConvertorExecutor converterExecutor = ConvertorManagerFactory.createDefaultManager();
+    private static final ConvertorExecutor CONVERTER_EXECUTOR = ConvertorManagerFactory.createDefaultManager();
     private long xid;
     private NodeRef node;
 
@@ -81,13 +81,13 @@ public class BundleAddMessageConverter implements
         final VersionDatapathIdConvertorData data = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_3);
         data.setDatapathId(digDatapathId(node));
 
-        if (innerMessage.getImplementedInterface().equals(BundleAddFlowCase.class)   ||
-                innerMessage.getImplementedInterface().equals(BundleUpdateFlowCase.class) ||
-                innerMessage.getImplementedInterface().equals(BundleRemoveFlowCase.class)) {
+        if (innerMessage.getImplementedInterface().equals(BundleAddFlowCase.class)
+                || innerMessage.getImplementedInterface().equals(BundleUpdateFlowCase.class)
+                || innerMessage.getImplementedInterface().equals(BundleRemoveFlowCase.class)) {
             dataBuilder.setBundleInnerMessage(convertBundleFlowCase(innerMessage, data));
-        } else if (innerMessage.getImplementedInterface().equals(BundleAddGroupCase.class) ||
-                innerMessage.getImplementedInterface().equals(BundleUpdateGroupCase.class) ||
-                innerMessage.getImplementedInterface().equals(BundleRemoveGroupCase.class)) {
+        } else if (innerMessage.getImplementedInterface().equals(BundleAddGroupCase.class)
+                || innerMessage.getImplementedInterface().equals(BundleUpdateGroupCase.class)
+                || innerMessage.getImplementedInterface().equals(BundleRemoveGroupCase.class)) {
             dataBuilder.setBundleInnerMessage(convertBundleGroupCase(innerMessage, data));
         } else if (innerMessage.getImplementedInterface().equals(BundleUpdatePortCase.class)) {
             dataBuilder.setBundleInnerMessage(convertBundlePortCase(innerMessage, data));
@@ -98,15 +98,29 @@ public class BundleAddMessageConverter implements
         return new BundleAddMessageOnfBuilder().setOnfAddMessageGroupingData(dataBuilder.build()).build();
     }
 
-    private BundleFlowModCase convertBundleFlowCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
+    @Override
+    public BundleAddMessageSal convert(final BundleAddMessageOnf input, final MessagePath path)
+            throws ConversionException {
+        return new BundleAddMessageSalBuilder()
+                .setSalAddMessageData(new SalAddMessageDataBuilder(input.getOnfAddMessageGroupingData())
+                        .build())
+                .build();
+    }
+
+    private BundleFlowModCase convertBundleFlowCase(final BundleInnerMessage messageCase,
+            final VersionDatapathIdConvertorData data) throws ConversionException {
         Optional<List<FlowModInputBuilder>> flowModInputs = Optional.empty();
         final Class clazz = messageCase.getImplementedInterface();
         if (clazz.equals(BundleAddFlowCase.class)) {
-            flowModInputs = converterExecutor.convert(new AddFlowInputBuilder(((BundleAddFlowCase)messageCase).getAddFlowCaseData()).build(), data);
+            flowModInputs = CONVERTER_EXECUTOR.convert(
+                    new AddFlowInputBuilder(((BundleAddFlowCase) messageCase).getAddFlowCaseData()).build(), data);
         } else if (clazz.equals(BundleUpdateFlowCase.class)) {
-            flowModInputs = converterExecutor.convert(new UpdatedFlowBuilder(((BundleUpdateFlowCase)messageCase).getUpdateFlowCaseData()).build(), data);
+            flowModInputs = CONVERTER_EXECUTOR.convert(
+                    new UpdatedFlowBuilder(((BundleUpdateFlowCase) messageCase).getUpdateFlowCaseData()).build(), data);
         } else if (clazz.equals(BundleRemoveFlowCase.class)) {
-            flowModInputs = converterExecutor.convert(new RemoveFlowInputBuilder(((BundleRemoveFlowCase)messageCase).getRemoveFlowCaseData()).build(), data);
+            flowModInputs = CONVERTER_EXECUTOR.convert(
+                    new RemoveFlowInputBuilder(((BundleRemoveFlowCase) messageCase).getRemoveFlowCaseData()).build(),
+                    data);
         }
 
         if (flowModInputs.isPresent()) {
@@ -114,30 +128,37 @@ public class BundleAddMessageConverter implements
                 return new BundleFlowModCaseBuilder()
                         .setFlowModCaseData(
                                 new FlowModCaseDataBuilder(
-                                        (flowModInputs
+                                        flowModInputs
                                                 .get()
                                                 .get(0)
-                                                .setXid(xid))
+                                                .setXid(xid)
                                                 .build())
                                         .build())
                         .build();
             } else {
-                throw new ConversionException("BundleFlowCase conversion unsuccessful - not able to convert to multiple flows.");
+                throw new ConversionException(
+                        "BundleFlowCase conversion unsuccessful - not able to convert to multiple flows.");
             }
         } else {
             throw new ConversionException("BundleFlowCase conversion unsuccessful.");
         }
     }
 
-    private BundleGroupModCase convertBundleGroupCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
+    private BundleGroupModCase convertBundleGroupCase(final BundleInnerMessage messageCase,
+            final VersionDatapathIdConvertorData data) throws ConversionException {
         Optional<GroupModInputBuilder> groupModInput = Optional.empty();
         final Class clazz = messageCase.getImplementedInterface();
         if (clazz.equals(BundleAddGroupCase.class)) {
-            groupModInput = converterExecutor.convert(new AddGroupInputBuilder(((BundleAddGroupCase)messageCase).getAddGroupCaseData()).build(), data);
+            groupModInput = CONVERTER_EXECUTOR.convert(
+                    new AddGroupInputBuilder(((BundleAddGroupCase) messageCase).getAddGroupCaseData()).build(), data);
         } else if (clazz.equals(BundleUpdateGroupCase.class)) {
-            groupModInput = converterExecutor.convert(new UpdatedGroupBuilder(((BundleUpdateGroupCase)messageCase).getUpdateGroupCaseData()).build(), data);
+            groupModInput = CONVERTER_EXECUTOR.convert(
+                    new UpdatedGroupBuilder(((BundleUpdateGroupCase) messageCase).getUpdateGroupCaseData()).build(),
+                    data);
         } else if (clazz.equals(BundleRemoveGroupCase.class)) {
-            groupModInput = converterExecutor.convert(new RemoveGroupInputBuilder(((BundleRemoveGroupCase)messageCase).getRemoveGroupCaseData()).build(), data);
+            groupModInput = CONVERTER_EXECUTOR.convert(
+                    new RemoveGroupInputBuilder(((BundleRemoveGroupCase) messageCase).getRemoveGroupCaseData()).build(),
+                    data);
         }
 
         if (groupModInput.isPresent()) {
@@ -154,11 +175,14 @@ public class BundleAddMessageConverter implements
         }
     }
 
-    private BundlePortModCase convertBundlePortCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
+    private BundlePortModCase convertBundlePortCase(final BundleInnerMessage messageCase,
+            final VersionDatapathIdConvertorData data) throws ConversionException {
         Optional<PortModInput> portModInput = Optional.empty();
-        final Class clazz = messageCase.getImplementedInterface();
+        final Class<?> clazz = messageCase.getImplementedInterface();
         if (clazz.equals(BundleUpdatePortCase.class)) {
-            portModInput = converterExecutor.convert(new PortBuilder(((BundleUpdatePortCase)messageCase).getUpdatePortCaseData().getPort().getPort().get(0)).build(), data);
+            portModInput = CONVERTER_EXECUTOR.convert(new PortBuilder(
+                    ((BundleUpdatePortCase) messageCase).getUpdatePortCaseData().getPort().getPort().get(0)).build(),
+                    data);
         }
 
         if (portModInput.isPresent()) {
@@ -197,12 +221,4 @@ public class BundleAddMessageConverter implements
     public void setNode(NodeRef node) {
         this.node = node;
     }
-
-    @Override
-    public BundleAddMessageSal convert(final BundleAddMessageOnf input, final MessagePath path) throws ConversionException {
-        return new BundleAddMessageSalBuilder()
-                .setSalAddMessageData(new SalAddMessageDataBuilder(input.getOnfAddMessageGroupingData())
-                        .build())
-                .build();
-    }
 }
index 92818b643bc8227c5a68f6f654713d609977c909..c00adad4acb55bbfc920fa5589ac6ac1350c6b4d 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.openflowplugin.extension.onf.converter;
 
-import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.ConverterMessageToOFJava;
+import org.opendaylight.openflowplugin.extension.api.ConvertorMessageFromOFJava;
 import org.opendaylight.openflowplugin.extension.api.path.MessagePath;
 import org.opendaylight.openflowplugin.extension.onf.OnfConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
@@ -30,9 +30,8 @@ public class BundleControlConverter implements
     @Override
     public BundleControlOnf
             convert(final BundleControlSal experimenterMessageCase) {
-        return new BundleControlOnfBuilder()
-                .setOnfControlGroupingData(new OnfControlGroupingDataBuilder(experimenterMessageCase.getSalControlData()).build())
-                .build();
+        return new BundleControlOnfBuilder().setOnfControlGroupingData(
+                new OnfControlGroupingDataBuilder(experimenterMessageCase.getSalControlData()).build()).build();
     }
 
     @Override
index b53f28e60e1d7a892d38fde719956a11d3866527..8521be64a2935821c26a1bb25b0c522147b428c5 100644 (file)
@@ -51,8 +51,8 @@ public class BundleControlFactory implements OFDeserializer<BundleControlOnf>, D
     }
 
     private static BundleFlags createBundleFlags(final int flags) {
-        Boolean isAtomic = (flags & (1 << 0)) != 0;
-        Boolean isOrdered = (flags & (1 << 1)) != 0;
+        Boolean isAtomic = (flags & 1 << 0) != 0;
+        Boolean isOrdered = (flags & 1 << 1) != 0;
         return new BundleFlags(isAtomic, isOrdered);
     }
 
@@ -80,7 +80,8 @@ public class BundleControlFactory implements OFDeserializer<BundleControlOnf>, D
         OFDeserializer<BundlePropertyExperimenterData> deserializer = deserializerRegistry.getDeserializer(
                 new ExperimenterIdTypeDeserializerKey(EncodeConstants.OF13_VERSION_ID, experimenterId, expType,
                         BundlePropertyExperimenterData.class));
-        experimenterProperty.setBundlePropertyExperimenterData(deserializer.deserialize(message.readBytes(length - 12)));
+        experimenterProperty.setBundlePropertyExperimenterData(
+                deserializer.deserialize(message.readBytes(length - 12)));
 
         return new BundlePropertyBuilder().setType(BundlePropertyType.ONFETBPTEXPERIMENTER)
                 .setBundlePropertyEntry(experimenterProperty.build())
@@ -88,8 +89,8 @@ public class BundleControlFactory implements OFDeserializer<BundleControlOnf>, D
     }
 
     @Override
-    public void injectDeserializerRegistry(DeserializerRegistry deserializerRegistry) {
-        this.deserializerRegistry = deserializerRegistry;
+    public void injectDeserializerRegistry(DeserializerRegistry registry) {
+        this.deserializerRegistry = registry;
     }
 
 }
index 2845168acd9cc179a284e6485cb8af798fc98587..3f3243b75b7d63956032a638a16dafdbc9838cee 100644 (file)
@@ -34,8 +34,8 @@ public abstract class AbstractBundleMessageFactory<T extends DataContainer> impl
     protected SerializerRegistry serializerRegistry;
 
     @Override
-    public void injectSerializerRegistry(SerializerRegistry serializerRegistry) {
-        this.serializerRegistry = serializerRegistry;
+    public void injectSerializerRegistry(SerializerRegistry registry) {
+        this.serializerRegistry = registry;
     }
 
     static void writeBundleFlags(final BundleFlags bundleFlags, final ByteBuf outBuffer) {
@@ -47,11 +47,12 @@ public abstract class AbstractBundleMessageFactory<T extends DataContainer> impl
         for (BundleProperty property : properties) {
             BundlePropertyType type = property.getType();
             if (type != null && type.equals(BundlePropertyType.ONFETBPTEXPERIMENTER)) {
-                int startIndex = outBuffer.writerIndex();
+                final int startIndex = outBuffer.writerIndex();
                 outBuffer.writeShort(type.getIntValue());
                 int lengthIndex = outBuffer.writerIndex();
                 outBuffer.writeShort(EncodeConstants.EMPTY_LENGTH);
-                writeBundleExperimenterProperty((BundlePropertyExperimenter)property.getBundlePropertyEntry(), outBuffer);
+                writeBundleExperimenterProperty((BundlePropertyExperimenter)property.getBundlePropertyEntry(),
+                        outBuffer);
                 outBuffer.setShort(lengthIndex, outBuffer.writerIndex() - startIndex);
             } else {
                 LOG.warn("Trying to serialize unknown bundle property (type: {}), skipping",
@@ -73,14 +74,13 @@ public abstract class AbstractBundleMessageFactory<T extends DataContainer> impl
 
     private static short fillBitMask(final boolean... values) {
         short bitmask = 0;
-        short i = 0;
+        short index = 0;
         for (boolean v : values) {
             if (v) {
-                bitmask |= 1 << i;
+                bitmask |= 1 << index;
             }
-            ++i;
+            ++index;
         }
         return bitmask;
     }
-
 }
index cf75e1fb5c868d10846caf6ddd9b96705ad9baca..321030514922a71dfb8c9fc227b57dc4245b8b37 100644 (file)
@@ -48,10 +48,10 @@ public abstract class ByteBufUtils {
     private static byte[] hexStringToBytes(final String hexSrc) {
         List<String> byteChips = Lists.newArrayList(HEXSTRING_SPLITTER.split(hexSrc));
         byte[] result = new byte[byteChips.size()];
-        int i = 0;
+        int index = 0;
         for (String chip : byteChips) {
-            result[i] = (byte) Short.parseShort(chip, 16);
-            i++;
+            result[index] = (byte) Short.parseShort(chip, 16);
+            index++;
         }
         return result;
     }
index 950dcfddcb5ac92fa8bf0aa5600ca8a90c3e9366..3fa8ac9f9029cddd203d6559413589938ee51f0d 100644 (file)
@@ -13,7 +13,6 @@ import java.util.Collections;
 import java.util.List;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.openflowplugin.extension.onf.BundleTestUtils;
@@ -95,32 +94,44 @@ public class BundleAddMessageConverterTest {
 
     @Test
     public void testConvertAddFlowCase() throws Exception {
-        testConvert(new BundleAddFlowCaseBuilder().setAddFlowCaseData(new AddFlowCaseDataBuilder().build()).build(), BundleFlowModCase.class);
+        testConvert(new BundleAddFlowCaseBuilder().setAddFlowCaseData(new AddFlowCaseDataBuilder().build()).build(),
+                BundleFlowModCase.class);
     }
 
     @Test
     public void testConvertUpdateFlowCase() throws Exception {
-        testConvert(new BundleUpdateFlowCaseBuilder().setUpdateFlowCaseData(new UpdateFlowCaseDataBuilder().build()).build(), BundleFlowModCase.class);
+        testConvert(new BundleUpdateFlowCaseBuilder().setUpdateFlowCaseData(new UpdateFlowCaseDataBuilder().build())
+                .build(), BundleFlowModCase.class);
     }
 
     @Test
     public void testConvertRemoveFlowCase() throws Exception {
-        testConvert(new BundleRemoveFlowCaseBuilder().setRemoveFlowCaseData(new RemoveFlowCaseDataBuilder().build()).build(), BundleFlowModCase.class);
+        testConvert(new BundleRemoveFlowCaseBuilder().setRemoveFlowCaseData(new RemoveFlowCaseDataBuilder().build())
+                .build(), BundleFlowModCase.class);
     }
 
     @Test
     public void testConvertAddGroupCase() throws Exception {
-        testConvert(new BundleAddGroupCaseBuilder().setAddGroupCaseData(new AddGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(), BundleGroupModCase.class);
+        testConvert(
+                new BundleAddGroupCaseBuilder()
+                        .setAddGroupCaseData(new AddGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(),
+                BundleGroupModCase.class);
     }
 
     @Test
     public void testConvertUpdateGroupCase() throws Exception {
-        testConvert(new BundleUpdateGroupCaseBuilder().setUpdateGroupCaseData(new UpdateGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(), BundleGroupModCase.class);
+        testConvert(
+                new BundleUpdateGroupCaseBuilder()
+                        .setUpdateGroupCaseData(new UpdateGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(),
+                BundleGroupModCase.class);
     }
 
     @Test
     public void testConvertRemoveGroupCase() throws Exception {
-        testConvert(new BundleRemoveGroupCaseBuilder().setRemoveGroupCaseData(new RemoveGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(), BundleGroupModCase.class);
+        testConvert(
+                new BundleRemoveGroupCaseBuilder()
+                        .setRemoveGroupCaseData(new RemoveGroupCaseDataBuilder().setGroupId(GROUP_ID).build()).build(),
+                BundleGroupModCase.class);
     }
 
     @Test
@@ -128,7 +139,8 @@ public class BundleAddMessageConverterTest {
         testConvert(new BundleUpdatePortCaseBuilder()
                 .setUpdatePortCaseData(new UpdatePortCaseDataBuilder()
                 .setPort(new PortBuilder()
-                            .setPort(Collections.singletonList(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder()
+                            .setPort(Collections.singletonList(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow
+                                        .types.port.rev130925.port.mod.port.PortBuilder()
                                     .setConfiguration(Mockito.mock(PortConfig.class))
                                     .setAdvertisedFeatures(Mockito.mock(PortFeatures.class))
                                     .setPortNumber(Mockito.mock(PortNumberUni.class))
@@ -143,34 +155,49 @@ public class BundleAddMessageConverterTest {
     }
 
     private void testConvert(final boolean withProperty) throws Exception {
-        final BundleInnerMessage message = new BundleAddFlowCaseBuilder().setAddFlowCaseData(new AddFlowCaseDataBuilder().build()).build();
+        final BundleInnerMessage message = new BundleAddFlowCaseBuilder()
+                .setAddFlowCaseData(new AddFlowCaseDataBuilder().build()).build();
         testConvert(message, BundleFlowModCase.class, withProperty);
     }
 
-    private void testConvert(final BundleInnerMessage message, Class clazz, final boolean withProperty) throws Exception {
+    private void testConvert(final BundleInnerMessage message, Class clazz, final boolean withProperty)
+            throws Exception {
         final BundleAddMessageSal original = createMessage(withProperty, message);
         final BundleAddMessageOnf converted = converter.convert(original);
-        Assert.assertEquals("Wrong BundleId", new BundleId(original.getSalAddMessageData().getBundleId().getValue()), converted.getOnfAddMessageGroupingData().getBundleId());
-        Assert.assertEquals("Wrong flags", new BundleFlags(original.getSalAddMessageData().getFlags().isAtomic(), original.getSalAddMessageData().getFlags().isOrdered()), converted.getOnfAddMessageGroupingData().getFlags());
-        Assert.assertEquals("Wrong inner message conversion", clazz, converted.getOnfAddMessageGroupingData().getBundleInnerMessage().getImplementedInterface());
+        Assert.assertEquals("Wrong BundleId", new BundleId(original.getSalAddMessageData().getBundleId().getValue()),
+                converted.getOnfAddMessageGroupingData().getBundleId());
+        Assert.assertEquals("Wrong flags",
+                new BundleFlags(original.getSalAddMessageData().getFlags().isAtomic(),
+                        original.getSalAddMessageData().getFlags().isOrdered()),
+                converted.getOnfAddMessageGroupingData().getFlags());
+        Assert.assertEquals("Wrong inner message conversion", clazz,
+                converted.getOnfAddMessageGroupingData().getBundleInnerMessage().getImplementedInterface());
         if (withProperty) {
-            final BundlePropertyExperimenter originalProperty = (BundlePropertyExperimenter) original.getSalAddMessageData().getBundleProperty().get(0).getBundlePropertyEntry();
-            final BundlePropertyExperimenter convertedProperty = ((BundlePropertyExperimenter) converted.getOnfAddMessageGroupingData().getBundleProperty().get(0).getBundlePropertyEntry());
-            Assert.assertEquals("Wrong property ExperimenterId", new ExperimenterId(originalProperty.getExperimenter()), convertedProperty.getExperimenter());
-            Assert.assertEquals("Wrong property experimenter type", originalProperty.getExpType(), convertedProperty.getExpType());
-            Assert.assertEquals("Wrong property data", originalProperty.getBundlePropertyExperimenterData(), convertedProperty.getBundlePropertyExperimenterData());
+            final BundlePropertyExperimenter originalProperty = (BundlePropertyExperimenter) original
+                    .getSalAddMessageData().getBundleProperty().get(0).getBundlePropertyEntry();
+            final BundlePropertyExperimenter convertedProperty = (BundlePropertyExperimenter) converted
+                    .getOnfAddMessageGroupingData().getBundleProperty().get(0).getBundlePropertyEntry();
+            Assert.assertEquals("Wrong property ExperimenterId", new ExperimenterId(originalProperty.getExperimenter()),
+                    convertedProperty.getExperimenter());
+            Assert.assertEquals("Wrong property experimenter type", originalProperty.getExpType(),
+                    convertedProperty.getExpType());
+            Assert.assertEquals("Wrong property data", originalProperty.getBundlePropertyExperimenterData(),
+                    convertedProperty.getBundlePropertyExperimenterData());
         } else {
-            Assert.assertTrue("Properties not empty", converted.getOnfAddMessageGroupingData().getBundleProperty().isEmpty());
+            Assert.assertTrue("Properties not empty",
+                    converted.getOnfAddMessageGroupingData().getBundleProperty().isEmpty());
         }
     }
 
-    private static BundleAddMessageSal createMessage(final boolean withProperty, final BundleInnerMessage innerMessage) {
+    private static BundleAddMessageSal createMessage(final boolean withProperty,
+            final BundleInnerMessage innerMessage) {
         final SalAddMessageDataBuilder dataBuilder = new SalAddMessageDataBuilder();
         dataBuilder.setBundleId(new BundleId(1L));
         dataBuilder.setFlags(new BundleFlags(true, false));
         List<BundleProperty> properties = new ArrayList<>();
         if (withProperty) {
-            properties.add(BundleTestUtils.createExperimenterProperty(Mockito.mock(BundlePropertyExperimenterData.class)));
+            properties.add(
+                    BundleTestUtils.createExperimenterProperty(Mockito.mock(BundlePropertyExperimenterData.class)));
         }
         dataBuilder.setBundleProperty(properties);
         dataBuilder.setBundleInnerMessage(innerMessage);
@@ -178,4 +205,4 @@ public class BundleAddMessageConverterTest {
         return new BundleAddMessageSalBuilder().setSalAddMessageData(dataBuilder.build()).build();
     }
 
-}
\ No newline at end of file
+}
index 77d75f9a4315b5cb369ac2d34ba73904bba81acc..24d21188b96ad4492374a9e21e7f5edad4dad044 100644 (file)
@@ -103,14 +103,17 @@ public class BundleControlConverterTest {
                     .getBundleProperty()
                     .get(0)
                     .getBundlePropertyEntry();
-            final BundlePropertyExperimenter convertedProperty = ((BundlePropertyExperimenter) ofjMessage
+            final BundlePropertyExperimenter convertedProperty = (BundlePropertyExperimenter) ofjMessage
                     .getOnfControlGroupingData()
                     .getBundleProperty()
                     .get(0)
-                    .getBundlePropertyEntry());
-            Assert.assertEquals("Wrong property ExperimenterId", new ExperimenterId(originalProperty.getExperimenter()), convertedProperty.getExperimenter());
-            Assert.assertEquals("Wrong property experimenter type", originalProperty.getExpType(), convertedProperty.getExpType());
-            Assert.assertEquals("Wrong property data", originalProperty.getBundlePropertyExperimenterData(), convertedProperty.getBundlePropertyExperimenterData());
+                    .getBundlePropertyEntry();
+            Assert.assertEquals("Wrong property ExperimenterId", new ExperimenterId(originalProperty.getExperimenter()),
+                    convertedProperty.getExperimenter());
+            Assert.assertEquals("Wrong property experimenter type", originalProperty.getExpType(),
+                    convertedProperty.getExpType());
+            Assert.assertEquals("Wrong property data", originalProperty.getBundlePropertyExperimenterData(),
+                    convertedProperty.getBundlePropertyExperimenterData());
         } else {
             Assert.assertTrue("Properties not empty",
                     ofjMessage
@@ -127,7 +130,8 @@ public class BundleControlConverterTest {
         dataBuilder.setFlags(new BundleFlags(true, false));
         List<BundleProperty> properties = new ArrayList<>();
         if (withProperty) {
-            properties.add(BundleTestUtils.createExperimenterProperty(Mockito.mock(BundlePropertyExperimenterData.class)));
+            properties.add(BundleTestUtils.createExperimenterProperty(
+                    Mockito.mock(BundlePropertyExperimenterData.class)));
         }
         dataBuilder.setBundleProperty(properties);
         return new BundleControlSalBuilder().setSalControlData(dataBuilder.build()).build();
@@ -141,10 +145,10 @@ public class BundleControlConverterTest {
         dataBuilder.setFlags(new BundleFlags(false, false));
         List<BundleProperty> properties = new ArrayList<>();
         if (withProperty) {
-            properties.add(BundleTestUtils.createExperimenterProperty(Mockito.mock(BundlePropertyExperimenterData.class)));
+            properties.add(BundleTestUtils.createExperimenterProperty(
+                    Mockito.mock(BundlePropertyExperimenterData.class)));
         }
         dataBuilder.setBundleProperty(properties);
         return new BundleControlOnfBuilder().setOnfControlGroupingData(dataBuilder.build()).build();
     }
-
 }
index 0025e6160515171a1613ebeb85886346f8de6a1e..ae873962710e2c9dfa0924f7b14cacc69b4fc950 100644 (file)
@@ -20,7 +20,6 @@ import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistryInjector;
-import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey;
 import org.opendaylight.openflowplugin.extension.onf.BundleTestUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleControlType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleFlags;
@@ -55,8 +54,8 @@ public class BundleControlFactoryTest extends AbstractBundleMessageFactoryTest {
         dataBuilder.setFlags(new BundleFlags(true, true));
 
         if (withProperty) {
-            dataBuilder.setBundleProperty((new ArrayList<>(Collections.singleton(
-                    BundleTestUtils.createExperimenterProperty(propertyExperimenterData)))));
+            dataBuilder.setBundleProperty(new ArrayList<>(Collections.singleton(
+                    BundleTestUtils.createExperimenterProperty(propertyExperimenterData))));
             Mockito.when(registry.getSerializer(Matchers.any())).thenReturn(propertySerializer);
             ((SerializerRegistryInjector) factory).injectSerializerRegistry(registry);
         }
@@ -68,8 +67,9 @@ public class BundleControlFactoryTest extends AbstractBundleMessageFactoryTest {
         Assert.assertEquals("Wrong type", BundleControlType.ONFBCTOPENREQUEST.getIntValue(), out.readUnsignedShort());
         Assert.assertEquals("Wrong flags", 3, out.readUnsignedShort());
         if (withProperty) {
-            Assert.assertEquals("Wrong property type", BundlePropertyType.ONFETBPTEXPERIMENTER.getIntValue(), out.readUnsignedShort());
-            int length = out.readUnsignedShort();
+            Assert.assertEquals("Wrong property type", BundlePropertyType.ONFETBPTEXPERIMENTER.getIntValue(),
+                    out.readUnsignedShort());
+            out.readUnsignedShort(); // length
             Assert.assertEquals("Wrong experimenter ID", 1, out.readUnsignedInt());
             Assert.assertEquals("Wrong experimenter type", 2, out.readUnsignedInt());
             Mockito.verify(propertySerializer, Mockito.times(1)).serialize(propertyExperimenterData, out);
@@ -78,5 +78,4 @@ public class BundleControlFactoryTest extends AbstractBundleMessageFactoryTest {
             Assert.assertTrue("Unexpected data", out.readableBytes() == 0);
         }
     }
-
-}
\ No newline at end of file
+}
index dce3447153dfc946187770ca541472754e79546d..645a804beef73f7b6582695bde3fbb843f088553 100644 (file)
-/**\r
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.\r
- * \r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.openflowplugin.extension.test;\r
-\r
-import java.math.BigInteger;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.concurrent.Future;\r
-\r
-import org.opendaylight.openflowplugin.extension.api.AugmentTuple;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestFlowInput;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestService;\r
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
-import org.opendaylight.yangtools.yang.common.RpcResult;\r
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;\r
-\r
-import com.google.common.util.concurrent.Futures;\r
-\r
-/**\r
- * @author msunal\r
- *\r
- */\r
-public class Test implements TestService {\r
-    \r
-    private SalFlowService flowService;\r
-\r
-\r
-    @Override\r
-    public Future<RpcResult<Void>> testFlow(TestFlowInput input) {\r
-        AddFlowInputBuilder flow = new AddFlowInputBuilder();\r
-        flow.setPriority(2);\r
-        flow.setMatch(createMatchBld().build());\r
-        flow.setInstructions(createDecNwTtlInstructionsBld().build());\r
-        flow.setBarrier(Boolean.FALSE);\r
-        BigInteger value = BigInteger.valueOf(10L);\r
-        flow.setCookie(new FlowCookie(value));\r
-        flow.setCookieMask(new FlowCookie(value));\r
-        flow.setHardTimeout(0);\r
-        flow.setIdleTimeout(0);\r
-        flow.setInstallHw(false);\r
-        flow.setStrict(false);\r
-        flow.setContainerName(null);\r
-        flow.setFlags(new FlowModFlags(false, false, false, false, true));\r
-        flow.setTableId((short) 0);\r
-\r
-        flow.setFlowName("NiciraFLOW");\r
-        \r
-        // Construct the flow instance id\r
-        final InstanceIdentifier<Node> flowInstanceId = InstanceIdentifier\r
-                .builder(Nodes.class) // File under nodes\r
-                .child(Node.class, new NodeKey(new NodeId("openflow:1"))).build(); // A particular node identified by nodeKey\r
-        flow.setNode(new NodeRef(flowInstanceId));\r
-        \r
-        pushFlowViaRpc(flow.build());\r
-        \r
-        return Futures.immediateFuture(RpcResultBuilder.<Void>status(true).build());\r
-    }\r
-    \r
-    /**\r
-     * @param addFlowInput\r
-     */\r
-    private void pushFlowViaRpc(AddFlowInput addFlowInput) {\r
-        flowService.addFlow(addFlowInput);\r
-    }\r
-\r
-    /**\r
-     * @param flowService the flowService to set\r
-     */\r
-    public void setFlowService(SalFlowService flowService) {\r
-        this.flowService = flowService;\r
-    }\r
-    \r
-    private static MatchBuilder createMatchBld() {\r
-        MatchBuilder match = new MatchBuilder();\r
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();\r
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");\r
-        ipv4Match.setIpv4Destination(prefix);\r
-        Ipv4Match i4m = ipv4Match.build();\r
-        match.setLayer3Match(i4m);\r
-\r
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();\r
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();\r
-        ethTypeBuilder.setType(new EtherType(0x0800L));\r
-        eth.setEthernetType(ethTypeBuilder.build());\r
-        match.setEthernetMatch(eth.build());\r
-        \r
-//        AugmentTuple<Match> extAugmentWrapper = createNxMatchAugment();\r
-//        match.addAugmentation(extAugmentWrapper.getAugmentationClass(), extAugmentWrapper.getAugmentationObject());\r
-        \r
-        return match;\r
-    }\r
-    \r
-    private static AugmentTuple<Match> createNxMatchAugment() {\r
-        // TODO add example\r
-        return null;\r
-    }\r
-\r
-    private static InstructionsBuilder createDecNwTtlInstructionsBld() {\r
-        // Add our drop action to a list\r
-        List<Action> actionList = new ArrayList<Action>();\r
-        actionList.add(createOFAction(0).build());\r
-        actionList.add(createNxActionBld(1).build());\r
-        \r
-        // Create an Apply Action\r
-        ApplyActionsBuilder aab = new ApplyActionsBuilder();\r
-        aab.setAction(actionList);\r
-       \r
-        // Wrap our Apply Action in an Instruction\r
-        InstructionBuilder ib = new InstructionBuilder();\r
-        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());\r
-        ib.setKey(new InstructionKey(0));\r
-        ib.setOrder(0);\r
-\r
-        // Put our Instruction in a list of Instructions\r
-        InstructionsBuilder isb = new InstructionsBuilder();\r
-        List<Instruction> instructions = new ArrayList<Instruction>();\r
-        instructions.add(ib.build());\r
-        ib.setKey(new InstructionKey(0));\r
-        isb.setInstruction(instructions);\r
-        return isb;\r
-    }\r
-\r
-    /**\r
-     * @param actionKeyVal \r
-     * @return\r
-     */\r
-    private static ActionBuilder createOFAction(int actionKeyVal) {\r
-        DecNwTtlBuilder ta = new DecNwTtlBuilder();\r
-        DecNwTtl decNwTtl = ta.build();\r
-        ActionBuilder ab = new ActionBuilder();\r
-        ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());\r
-        ab.setKey(new ActionKey(actionKeyVal));\r
-        return ab;\r
-    }\r
-\r
-    /**\r
-     * @param actionKeyVal TODO\r
-     * @return\r
-     */\r
-    private static ActionBuilder createNxActionBld(int actionKeyVal) {\r
-        // vendor part\r
-        DstNxRegCaseBuilder nxRegCaseBld = new DstNxRegCaseBuilder().setNxReg(NxmNxReg0.class);\r
-        DstBuilder dstBld = new DstBuilder()\r
-            .setDstChoice(nxRegCaseBld.build())\r
-            .setStart(0)\r
-            .setEnd(5);\r
-        NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();\r
-        nxRegLoadBuilder.setDst(dstBld.build());\r
-        nxRegLoadBuilder.setValue(BigInteger.valueOf(55L));\r
-        NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder topNxActionCaseBld = new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder();\r
-        topNxActionCaseBld.setNxRegLoad(nxRegLoadBuilder.build());\r
-        \r
-        // base part\r
-        ActionBuilder abExt = new ActionBuilder();\r
-        abExt.setKey(new ActionKey(actionKeyVal));\r
-        abExt.setAction(topNxActionCaseBld.build());\r
-        return abExt;\r
-    }\r
-    \r
-\r
-}\r
+/**
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.openflowplugin.extension.test;
+
+import com.google.common.util.concurrent.Futures;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Future;
+import org.opendaylight.openflowplugin.extension.api.AugmentTuple;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DecNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtl;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.dec.nw.ttl._case.DecNwTtlBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.test.rev130819.TestService;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
+/**
+ * Implementation of TestService.
+ *
+ * @author msunal
+ */
+public class Test implements TestService {
+
+    private SalFlowService flowService;
+
+
+    @Override
+    public Future<RpcResult<Void>> testFlow(TestFlowInput input) {
+        AddFlowInputBuilder flow = new AddFlowInputBuilder();
+        flow.setPriority(2);
+        flow.setMatch(createMatchBld().build());
+        flow.setInstructions(createDecNwTtlInstructionsBld().build());
+        flow.setBarrier(Boolean.FALSE);
+        BigInteger value = BigInteger.valueOf(10L);
+        flow.setCookie(new FlowCookie(value));
+        flow.setCookieMask(new FlowCookie(value));
+        flow.setHardTimeout(0);
+        flow.setIdleTimeout(0);
+        flow.setInstallHw(false);
+        flow.setStrict(false);
+        flow.setContainerName(null);
+        flow.setFlags(new FlowModFlags(false, false, false, false, true));
+        flow.setTableId((short) 0);
+
+        flow.setFlowName("NiciraFLOW");
+
+        // Construct the flow instance id
+        final InstanceIdentifier<Node> flowInstanceId = InstanceIdentifier
+                .builder(Nodes.class) // File under nodes
+                // A particular node identified by nodeKey
+                .child(Node.class, new NodeKey(new NodeId("openflow:1"))).build();
+        flow.setNode(new NodeRef(flowInstanceId));
+
+        pushFlowViaRpc(flow.build());
+
+        return Futures.immediateFuture(RpcResultBuilder.<Void>status(true).build());
+    }
+
+    private void pushFlowViaRpc(AddFlowInput addFlowInput) {
+        flowService.addFlow(addFlowInput);
+    }
+
+    public void setFlowService(SalFlowService flowService) {
+        this.flowService = flowService;
+    }
+
+    private static MatchBuilder createMatchBld() {
+        MatchBuilder match = new MatchBuilder();
+        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
+        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
+        ipv4Match.setIpv4Destination(prefix);
+        Ipv4Match i4m = ipv4Match.build();
+        match.setLayer3Match(i4m);
+
+        EthernetMatchBuilder eth = new EthernetMatchBuilder();
+        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
+        ethTypeBuilder.setType(new EtherType(0x0800L));
+        eth.setEthernetType(ethTypeBuilder.build());
+        match.setEthernetMatch(eth.build());
+
+//        AugmentTuple<Match> extAugmentWrapper = createNxMatchAugment();
+//        match.addAugmentation(extAugmentWrapper.getAugmentationClass(), extAugmentWrapper.getAugmentationObject());
+
+        return match;
+    }
+
+    private static AugmentTuple<Match> createNxMatchAugment() {
+        // TODO add example
+        return null;
+    }
+
+    private static InstructionsBuilder createDecNwTtlInstructionsBld() {
+        // Add our drop action to a list
+        List<Action> actionList = new ArrayList<>();
+        actionList.add(createOFAction(0).build());
+        actionList.add(createNxActionBld(1).build());
+
+        // Create an Apply Action
+        ApplyActionsBuilder aab = new ApplyActionsBuilder();
+        aab.setAction(actionList);
+
+        // Wrap our Apply Action in an Instruction
+        InstructionBuilder ib = new InstructionBuilder();
+        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+        ib.setKey(new InstructionKey(0));
+        ib.setOrder(0);
+
+        // Put our Instruction in a list of Instructions
+        InstructionsBuilder isb = new InstructionsBuilder();
+        List<Instruction> instructions = new ArrayList<>();
+        instructions.add(ib.build());
+        ib.setKey(new InstructionKey(0));
+        isb.setInstruction(instructions);
+        return isb;
+    }
+
+    private static ActionBuilder createOFAction(int actionKeyVal) {
+        DecNwTtlBuilder ta = new DecNwTtlBuilder();
+        DecNwTtl decNwTtl = ta.build();
+        ActionBuilder ab = new ActionBuilder();
+        ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
+        ab.setKey(new ActionKey(actionKeyVal));
+        return ab;
+    }
+
+    private static ActionBuilder createNxActionBld(int actionKeyVal) {
+        // vendor part
+        DstNxRegCaseBuilder nxRegCaseBld = new DstNxRegCaseBuilder().setNxReg(NxmNxReg0.class);
+        DstBuilder dstBld = new DstBuilder()
+            .setDstChoice(nxRegCaseBld.build())
+            .setStart(0)
+            .setEnd(5);
+        NxRegLoadBuilder nxRegLoadBuilder = new NxRegLoadBuilder();
+        nxRegLoadBuilder.setDst(dstBld.build());
+        nxRegLoadBuilder.setValue(BigInteger.valueOf(55L));
+        NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder topNxActionCaseBld =
+                new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder();
+        topNxActionCaseBld.setNxRegLoad(nxRegLoadBuilder.build());
+
+        // base part
+        ActionBuilder abExt = new ActionBuilder();
+        abExt.setKey(new ActionKey(actionKeyVal));
+        abExt.setAction(topNxActionCaseBld.build());
+        return abExt;
+    }
+}
index a9d5646ee473f45a07144bdf5c7bb0831419bd11..8470f299d1fb17275c95c27edba7dbe40f8dd52b 100644 (file)
@@ -246,7 +246,7 @@ public final class MultipartReplyTranslatorUtil {
                                                          final ConvertorExecutor convertorExecutor) {
         FlowStatsResponseConvertorData flowData = new FlowStatsResponseConvertorData(data.getVersion());
         flowData.setDatapathId(data.getDatapathId());
-        flowData.setMatchPath(MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+        flowData.setMatchPath(MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
         MultipartReplyFlowStatsBuilder message = new MultipartReplyFlowStatsBuilder();
         MultipartReplyFlowCase caseBody = (MultipartReplyFlowCase) msg.getMultipartReplyBody();
         MultipartReplyFlow replyBody = caseBody.getMultipartReplyFlow();
index a5a4c979ee7a3dcd647f99033b4d3c26c640b27d..dc3bd432b54e92cb592e7dc6c37c43532a4b49b4 100644 (file)
@@ -29,7 +29,7 @@ public class SetFieldActionDeserializer extends AbstractActionDeserializer
             EncodeConstants.OF13_VERSION_ID,
             EncodeConstants.EMPTY_LENGTH,
             Match.class,
-            MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+            MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
 
     private DeserializerRegistry registry;
 
index 1803a401e2997f813e7424ed65f0cf4715df61e8..5382da8896d30a829d73ffa50543786fa8849f8f 100644 (file)
@@ -41,7 +41,7 @@ public class FlowMessageDeserializer implements OFDeserializer<FlowMessage>, Des
 
     private static final MessageCodeKey MATCH_KEY = new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID,
             EncodeConstants.EMPTY_VALUE, Match.class,
-            MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+            MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
 
     private DeserializerRegistry registry;
 
@@ -76,7 +76,7 @@ public class FlowMessageDeserializer implements OFDeserializer<FlowMessage>, Des
             final int startIndex = message.readerIndex();
             int offset = 0;
 
-            while ((message.readerIndex() - startIndex) < length) {
+            while (message.readerIndex() - startIndex < length) {
                 final int type = message.getUnsignedShort(message.readerIndex());
                 OFDeserializer<Instruction> deserializer = null;
 
@@ -84,13 +84,13 @@ public class FlowMessageDeserializer implements OFDeserializer<FlowMessage>, Des
                     deserializer = registry.getDeserializer(
                             new MessageCodeActionExperimenterKey(
                                 EncodeConstants.OF13_VERSION_ID, type, Instruction.class,
-                                ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                                ActionPath.INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS,
                                 null));
                 } else if (InstructionConstants.WRITE_ACTIONS_TYPE == type) {
                     deserializer = registry.getDeserializer(
                             new MessageCodeActionExperimenterKey(
                                 EncodeConstants.OF13_VERSION_ID, type, Instruction.class,
-                                ActionPath.NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                                ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS,
                                 null));
                 } else {
                     Long expId = null;
@@ -123,11 +123,11 @@ public class FlowMessageDeserializer implements OFDeserializer<FlowMessage>, Des
     }
 
     private static FlowModFlags createFlowModFlagsFromBitmap(int input) {
-        final Boolean ofp_FF_SendFlowRem = (input & (1 << 0)) > 0;
-        final Boolean ofp_FF_CheckOverlap = (input & (1 << 1)) > 0;
-        final Boolean ofp_FF_ResetCounts = (input & (1 << 2)) > 0;
-        final Boolean ofp_FF_NoPktCounts = (input & (1 << 3)) > 0;
-        final Boolean ofp_FF_NoBytCounts = (input & (1 << 4)) > 0;
+        final Boolean ofp_FF_SendFlowRem = (input & 1 << 0) > 0;
+        final Boolean ofp_FF_CheckOverlap = (input & 1 << 1) > 0;
+        final Boolean ofp_FF_ResetCounts = (input & 1 << 2) > 0;
+        final Boolean ofp_FF_NoPktCounts = (input & 1 << 3) > 0;
+        final Boolean ofp_FF_NoBytCounts = (input & 1 << 4) > 0;
         return new FlowModFlags(ofp_FF_CheckOverlap, ofp_FF_NoBytCounts, ofp_FF_NoPktCounts, ofp_FF_ResetCounts,
                 ofp_FF_SendFlowRem);
     }
index 1f4b7e31dfcc6237999d016d3caebf069c17210f..36efc59854ff996b6adb4120e91cab8ac5e9e0d3 100644 (file)
@@ -74,12 +74,12 @@ public class GroupMessageDeserializer implements OFDeserializer<GroupMessage>, D
                 final int bucketLength = length - BUCKETS_HEADER_LENGTH;
                 int offset = 0;
 
-                while ((message.readerIndex() - startIndex) < bucketLength) {
+                while (message.readerIndex() - startIndex < bucketLength) {
                     actions.add(new ActionBuilder()
                         .setKey(new ActionKey(offset))
                         .setOrder(offset)
                         .setAction(ActionUtil.readAction(EncodeConstants.OF13_VERSION_ID, message, registry,
-                                ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION))
+                                ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION))
                         .build());
 
                     offset++;
index 9e6dc0cae48f0ddf4d8a42176d14bb3772571686..d1f423bfcdb53ec674db558ac2f4100392a10c32 100644 (file)
@@ -30,7 +30,7 @@ public class PacketInMessageDeserializer implements OFDeserializer<PacketInMessa
     private static final byte PADDING_IN_PACKET_IN_HEADER = 2;
     private static final MessageCodeKey MATCH_KEY = new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID,
             EncodeConstants.EMPTY_VALUE, Match.class,
-            MatchPath.PACKETINMESSAGE_MATCH);
+            MatchPath.PACKET_IN_MESSAGE_MATCH);
 
     private DeserializerRegistry registry;
 
index 13fa7c22d021ab8844b93451b8e8557b38f631ad..24aa58677cafb7d34a2cafc5c3cf4ddd328d437f 100644 (file)
@@ -41,7 +41,7 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
 
     private static final MessageCodeKey MATCH_KEY = new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID,
             EncodeConstants.EMPTY_VALUE, Match.class,
-            MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+            MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
 
     private static final byte PADDING_IN_FLOW_STATS_HEADER_01 = 1;
     private static final byte PADDING_IN_FLOW_STATS_HEADER_02 = 4;
@@ -97,7 +97,7 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
                 final int startIndex = itemMessage.readerIndex();
                 int offset = 0;
 
-                while ((itemMessage.readerIndex() - startIndex) < length) {
+                while (itemMessage.readerIndex() - startIndex < length) {
                     instructions.add(new InstructionBuilder()
                             .setKey(new InstructionKey(offset))
                             .setOrder(offset)
@@ -122,11 +122,11 @@ public class MultipartReplyFlowStatsDeserializer implements OFDeserializer<Multi
     }
 
     private static FlowModFlags createFlowModFlagsFromBitmap(int input) {
-        final Boolean ofp_FF_SendFlowRem = (input & (1)) > 0;
-        final Boolean ofp_FF_CheckOverlap = (input & (1 << 1)) > 0;
-        final Boolean ofp_FF_ResetCounts = (input & (1 << 2)) > 0;
-        final Boolean ofp_FF_NoPktCounts = (input & (1 << 3)) > 0;
-        final Boolean ofp_FF_NoBytCounts = (input & (1 << 4)) > 0;
+        final Boolean ofp_FF_SendFlowRem = (input & 1) > 0;
+        final Boolean ofp_FF_CheckOverlap = (input & 1 << 1) > 0;
+        final Boolean ofp_FF_ResetCounts = (input & 1 << 2) > 0;
+        final Boolean ofp_FF_NoPktCounts = (input & 1 << 3) > 0;
+        final Boolean ofp_FF_NoBytCounts = (input & 1 << 4) > 0;
         return new FlowModFlags(ofp_FF_CheckOverlap, ofp_FF_NoBytCounts, ofp_FF_NoPktCounts, ofp_FF_ResetCounts,
                 ofp_FF_SendFlowRem);
     }
index 330c672a4b421900d67bec1d576a8d053c477ee4..b6e37ad0ece0fe12fd80d9b94b5e7fca96cab9ec 100644 (file)
@@ -77,12 +77,12 @@ public class MultipartReplyGroupDescDeserializer implements OFDeserializer<Multi
                 final int bucketLength = bucketsLength - BUCKETS_HEADER_LENGTH;
                 int offset = 0;
 
-                while ((message.readerIndex() - startIndex) < bucketLength) {
+                while (message.readerIndex() - startIndex < bucketLength) {
                     actions.add(new ActionBuilder()
                             .setKey(new ActionKey(offset))
                             .setOrder(offset)
                             .setAction(ActionUtil.readAction(EncodeConstants.OF13_VERSION_ID, message, registry,
-                                    ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION))
+                                    ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION))
                             .build());
 
                     offset++;
index 32dd0b54bb85470f1c9032c338679398a1f79976..772bfc35498dac4d84e4083d7a93c13ac47994d2 100644 (file)
@@ -283,7 +283,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
 
         final int startIndex = message.readerIndex();
 
-        while ((message.readerIndex() - startIndex) < length) {
+        while (message.readerIndex() - startIndex < length) {
             MATCH_FIELD_DESERIALIZER
                     .deserialize(message)
                     .map(matchFields::add)
@@ -316,7 +316,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
         final int startIndex = message.readerIndex();
         int offset = 0;
 
-        while ((message.readerIndex() - startIndex) < length) {
+        while (message.readerIndex() - startIndex < length) {
             try {
                 instructions.add(new InstructionBuilder()
                         .setKey(new InstructionKey(offset))
@@ -340,14 +340,13 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
         final int startIndex = message.readerIndex();
         int offset = 0;
 
-        while ((message.readerIndex() - startIndex) < length) {
+        while (message.readerIndex() - startIndex < length) {
             try {
                 actions.add(new ActionBuilder()
                         .setKey(new ActionKey(offset))
                         .setOrder(offset)
                         .setAction(ActionUtil.readActionHeader(EncodeConstants.OF13_VERSION_ID, message, registry,
-                                ActionPath
-                                        .FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION))
+                                ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS))
                         .build());
 
                 offset++;
index bb3cf7129a512355038b57129eac6d82977e9ef0..0f5cc192fc2125b7ade44fded4343ef7ecf81251 100644 (file)
@@ -45,15 +45,13 @@ public final class InstructionUtil {
             deserializer = registry.getDeserializer(
                     new MessageCodeActionExperimenterKey(
                             version, type, Instruction.class,
-                            ActionPath
-                                    .FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION,
+                            ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS,
                             null));
         } else if (InstructionConstants.WRITE_ACTIONS_TYPE == type) {
             deserializer = registry.getDeserializer(
                     new MessageCodeActionExperimenterKey(
                             version, type, Instruction.class,
-                            ActionPath
-                                    .FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION,
+                            ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS,
                             null));
         } else {
             Long expId = null;
@@ -88,15 +86,13 @@ public final class InstructionUtil {
             deserializer = registry.getDeserializer(
                     new MessageCodeActionExperimenterKey(
                             version, type, Instruction.class,
-                            ActionPath
-                                    .NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                            ActionPath.INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS,
                             null));
         } else if (InstructionConstants.WRITE_ACTIONS_TYPE == type) {
             deserializer = registry.getDeserializer(
                     new MessageCodeActionExperimenterKey(
                             version, type, Instruction.class,
-                            ActionPath
-                                    .NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                            ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS,
                             null));
         } else {
             Long expId = null;
index c8e631182de3c38834eac72ef022eb0e56831735..5e78cddcc30d558521f995e874af1910d8b29238 100644 (file)
@@ -52,7 +52,7 @@ public final class FlowStatisticsToNotificationTransformer {
                                                                 final ConvertorExecutor convertorExecutor) {
         final FlowStatsResponseConvertorData data = new FlowStatsResponseConvertorData(ofVersion.getVersion());
         data.setDatapathId(deviceInfo.getDatapathId());
-        data.setMatchPath(MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+        data.setMatchPath(MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
         final FlowsStatisticsUpdateBuilder notification = new FlowsStatisticsUpdateBuilder();
         final List<FlowAndStatisticsMapList> statsList = new ArrayList<>();
         notification.setId(deviceInfo.getNodeId());
index 246f6ec409aca65a41ddaf9e220e2cad784e0a93..624a18566eb0582f46c21762fbc7a191aa086ae6 100644 (file)
@@ -47,7 +47,7 @@ public class FlowDirectStatisticsService extends AbstractFlowDirectStatisticsSer
         super(requestContextStack, deviceContext, convertorExecutor, statisticsWriterProvider);
         data = new FlowStatsResponseConvertorData(getVersion());
         data.setDatapathId(getDatapathId());
-        data.setMatchPath(MatchPath.RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH);
+        data.setMatchPath(MatchPath.FLOWS_STATISTICS_RPC_MATCH);
     }
 
     @Override
index fd02344cbcc364cc5d7eef8835b8a34b92830305..35e031ffe2a79cc1ef40c70f3e2cd220f2d1d114 100644 (file)
@@ -91,7 +91,7 @@ public class PacketReceivedTranslator implements MessageTranslator<PacketInMessa
         final AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match>
                 matchExtensionWrap = MatchExtensionHelper
                 .processAllExtensions(input.getMatch().getMatchEntry(), OpenflowVersion.get(input.getVersion()),
-                                      MatchPath.PACKETRECEIVED_MATCH);
+                                      MatchPath.PACKET_RECEIVED_MATCH);
 
         if (matchExtensionWrap != null) {
             matchBuilder.addAugmentation(matchExtensionWrap.getAugmentationClass(),
index 3268c4f4ff0c3581f357a45ba9729bcafbe9b94d..74dd364ad8fdcc3df7b9cbffa366170f2cb42344 100644 (file)
@@ -32,8 +32,7 @@ public class ApplyActionsInstructionDeserializerTest extends AbstractInstruction
     protected void init() {
         deserializer = getRegistry().getDeserializer(
                 new MessageCodeActionExperimenterKey(EncodeConstants.OF13_VERSION_ID, getType(), Instruction.class,
-                        ActionPath
-                                .NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                        ActionPath.INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS,
                         null));
     }
 
index 1403efc9ab23948910af3540795f7aed34cfc283..3dcd2a8964e3a3b0eab58caafc0b695a6aede295 100644 (file)
@@ -32,8 +32,7 @@ public class WriteActionsInstructionDeserializerTest extends AbstractInstruction
     protected void init() {
         deserializer = getRegistry().getDeserializer(
                 new MessageCodeActionExperimenterKey(EncodeConstants.OF13_VERSION_ID, getType(), Instruction.class,
-                        ActionPath
-                                .NODES_NODE_TABLE_FLOW_INSTRUCTIONS_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION_EXTENSIONLIST_EXTENSION,
+                        ActionPath.INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS,
                         null));
     }
 
index 565758276877815614a0ad46a45a2be1bfb6ef36..1ab88eafc0b2d68c614e1c2de60ae20addb95ec6 100644 (file)
@@ -38,7 +38,7 @@ public abstract class AbstractMatchEntryDeserializerTest extends AbstractDeseria
         deserializer = getRegistry().getDeserializer(new MessageCodeMatchKey(EncodeConstants.OF13_VERSION_ID,
                 EncodeConstants.EMPTY_LENGTH,
                 Match.class,
-                MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH));
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH));
     }
 
     private void deserializeAlreadyFilledCase(ByteBuf inBuffer) {
index 7b69f1349e98251690f5449df5c2750b89a5fed2..87c715f755a01ed1e44661e5ed5a96cf949c2c3f 100644 (file)
@@ -109,38 +109,37 @@ public final class MatchExtensionHelper {
         AugmentTuple<EXT_POINT> augmentTuple = null;
         if (!extensionsList.isEmpty()) {
             switch (matchPath) {
-                case FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH:
+                case FLOWS_STATISTICS_UPDATE_MATCH:
                     GeneralAugMatchNotifUpdateFlowStatsBuilder generalExtMatchAugBld1 = new GeneralAugMatchNotifUpdateFlowStatsBuilder();
                     generalExtMatchAugBld1.setExtensionList(extensionsList);
                     augmentTuple = (AugmentTuple<EXT_POINT>)
-                            new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>(
+                            new AugmentTuple<>(
                                     GeneralAugMatchNotifUpdateFlowStats.class, generalExtMatchAugBld1.build());
                     break;
-                case PACKETRECEIVED_MATCH:
+                case PACKET_RECEIVED_MATCH:
                     GeneralAugMatchNotifPacketInBuilder generalExtMatchAugBld2 = new GeneralAugMatchNotifPacketInBuilder();
                     generalExtMatchAugBld2.setExtensionList(extensionsList);
                     augmentTuple = (AugmentTuple<EXT_POINT>)
-                            new AugmentTuple<Match>(GeneralAugMatchNotifPacketIn.class, generalExtMatchAugBld2.build());
+                            new AugmentTuple<>(GeneralAugMatchNotifPacketIn.class, generalExtMatchAugBld2.build());
                     break;
-                case PACKETINMESSAGE_MATCH:
+                case PACKET_IN_MESSAGE_MATCH:
                     GeneralAugMatchPacketInMessageBuilder generalExtMatchAugBld5 = new GeneralAugMatchPacketInMessageBuilder();
                     generalExtMatchAugBld5.setExtensionList(extensionsList);
                     augmentTuple = (AugmentTuple<EXT_POINT>)
-                            new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.in.message
-                                    .Match>(GeneralAugMatchPacketInMessage.class, generalExtMatchAugBld5.build());
+                            new AugmentTuple<>(GeneralAugMatchPacketInMessage.class, generalExtMatchAugBld5.build());
                     break;
-                case SWITCHFLOWREMOVED_MATCH:
+                case SWITCH_FLOW_REMOVED_MATCH:
                     GeneralAugMatchNotifSwitchFlowRemovedBuilder generalExtMatchAugBld3 = new GeneralAugMatchNotifSwitchFlowRemovedBuilder();
                     generalExtMatchAugBld3.setExtensionList(extensionsList);
                     augmentTuple = (AugmentTuple<EXT_POINT>)
-                            new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.mod.removed.Match>(
+                            new AugmentTuple<>(
                                     GeneralAugMatchNotifSwitchFlowRemoved.class, generalExtMatchAugBld3.build());
                     break;
-                case RPCFLOWSSTATISTICS_FLOWANDSTATISTICSMAPLIST_MATCH:
+                case FLOWS_STATISTICS_RPC_MATCH:
                     GeneralAugMatchRpcOutputFlowStatsBuilder generalExtMatchAugBld4 = new GeneralAugMatchRpcOutputFlowStatsBuilder();
                     generalExtMatchAugBld4.setExtensionList(extensionsList);
                     augmentTuple = (AugmentTuple<EXT_POINT>)
-                            new AugmentTuple<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>(
+                            new AugmentTuple<>(
                                     GeneralAugMatchRpcOutputFlowStats.class, generalExtMatchAugBld4.build());
                     break;
                 default:
index ba5f91e7b2b0a688ca5bdcf7ed6d03fa3d76ef04..e3e45aef817005067d0c225e4e366141872956b0 100644 (file)
@@ -32,7 +32,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStatsKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDesc;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
  * Converts GroupDesc message from library to MD SAL defined GroupDescStats
@@ -51,7 +50,7 @@ public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>,
 
     private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(List<BucketsList> bucketDescStats, short version) {
         final ActionResponseConvertorData data = new ActionResponseConvertorData(version);
-        data.setActionPath(ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+        data.setActionPath(ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
 
         org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder salBucketsDesc =
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder();
@@ -120,4 +119,4 @@ public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>,
 
         return convertedSALGroupsDesc;
     }
-}
\ No newline at end of file
+}
index 54a469e020786f0fea2a669cdd8ea2b79b3d81fb..f7dd39d9afa6ccd4d21f3514d247595ecd305b56 100644 (file)
@@ -42,7 +42,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.GotoTableCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.MeterCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteActionsCase;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
  * Converts Openflow 1.3+ specific instructions to MD-SAL format flow instruction
@@ -78,12 +77,12 @@ public final class FlowInstructionResponseConvertor extends Convertor<
         for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.
                 Instruction switchInst : source) {
             if (switchInst.getInstructionChoice() instanceof ApplyActionsCase) {
-                ApplyActionsCase actionsInstruction = ((ApplyActionsCase) switchInst.getInstructionChoice());
+                ApplyActionsCase actionsInstruction = (ApplyActionsCase) switchInst.getInstructionChoice();
                 ApplyActionsCaseBuilder applyActionsCaseBuilder = new ApplyActionsCaseBuilder();
                 ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
 
                 final ActionResponseConvertorData actionResponseConvertorData = new ActionResponseConvertorData(data.getVersion());
-                actionResponseConvertorData.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+                actionResponseConvertorData.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
 
                 final Optional<List<Action>> actions = getConvertorExecutor().convert(
                         actionsInstruction.getApplyActions().getAction(), actionResponseConvertorData);
@@ -95,7 +94,7 @@ public final class FlowInstructionResponseConvertor extends Convertor<
                 ClearActionsCaseBuilder clearActionsCaseBuilder = new ClearActionsCaseBuilder();
                 salInstruction = clearActionsCaseBuilder.build();
             } else if (switchInst.getInstructionChoice() instanceof GotoTableCase) {
-                GotoTableCase gotoTableCase = ((GotoTableCase) switchInst.getInstructionChoice());
+                GotoTableCase gotoTableCase = (GotoTableCase) switchInst.getInstructionChoice();
 
                 GoToTableCaseBuilder goToTableCaseBuilder = new GoToTableCaseBuilder();
                 GoToTableBuilder goToTableBuilder = new GoToTableBuilder();
@@ -104,7 +103,7 @@ public final class FlowInstructionResponseConvertor extends Convertor<
 
                 salInstruction = goToTableCaseBuilder.build();
             } else if (switchInst.getInstructionChoice() instanceof MeterCase) {
-                MeterCase meterIdInstruction = ((MeterCase) switchInst.getInstructionChoice());
+                MeterCase meterIdInstruction = (MeterCase) switchInst.getInstructionChoice();
 
                 MeterCaseBuilder meterCaseBuilder = new MeterCaseBuilder();
                 MeterBuilder meterBuilder = new MeterBuilder();
@@ -113,12 +112,12 @@ public final class FlowInstructionResponseConvertor extends Convertor<
 
                 salInstruction = meterCaseBuilder.build();
             } else if (switchInst.getInstructionChoice() instanceof WriteActionsCase) {
-                WriteActionsCase writeActionsCase = ((WriteActionsCase) switchInst.getInstructionChoice());
+                WriteActionsCase writeActionsCase = (WriteActionsCase) switchInst.getInstructionChoice();
                 WriteActionsCaseBuilder writeActionsCaseBuilder = new WriteActionsCaseBuilder();
                 WriteActionsBuilder writeActionsBuilder = new WriteActionsBuilder();
 
                 final ActionResponseConvertorData actionResponseConvertorData = new ActionResponseConvertorData(data.getVersion());
-                actionResponseConvertorData.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+                actionResponseConvertorData.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
 
                 final Optional<List<Action>> actions = getConvertorExecutor().convert(
                         writeActionsCase.getWriteActions().getAction(), actionResponseConvertorData);
@@ -128,7 +127,7 @@ public final class FlowInstructionResponseConvertor extends Convertor<
                 salInstruction = writeActionsCaseBuilder.build();
             } else if (switchInst.getInstructionChoice() instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) {
                 org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase writeMetadataCase =
-                        ((org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) switchInst.getInstructionChoice());
+                        (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.WriteMetadataCase) switchInst.getInstructionChoice();
                 WriteMetadataCaseBuilder writeMetadataCaseBuilder = new WriteMetadataCaseBuilder();
                 WriteMetadataBuilder writeMetadataBuilder = new WriteMetadataBuilder();
                 writeMetadataBuilder.setMetadata(new BigInteger(OFConstants.SIGNUM_UNSIGNED, writeMetadataCase.getWriteMetadata().getMetadata()));
index fb536a8998788042c9902541c12ea139ae858ddb..868ad08b54623d6bbd236cb2d502d5b92784b36e 100644 (file)
@@ -40,7 +40,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.flow._case.multipart.reply.flow.FlowStats;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
  * Converts flow related statistics messages coming from openflow switch to MD-SAL messages.
@@ -69,7 +68,7 @@ public class FlowStatsResponseConvertor extends Convertor<List<FlowStats>, List<
                                                       final short version,
                                                       final Short ipProtocol) {
         ActionResponseConvertorData actionResponseConvertorData = new ActionResponseConvertorData(version);
-        actionResponseConvertorData.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_WRITEACTIONSCASE_WRITEACTIONS_ACTION_ACTION);
+        actionResponseConvertorData.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS);
         actionResponseConvertorData.setIpProtocol(ipProtocol);
 
         InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
index 09f3e822c70c3a3b7df5c5c1e788f802f33839d0..9c634b2275fcb6c435c6eb5e3fc1701c297a2f21 100644 (file)
@@ -44,12 +44,7 @@ public class ActionExtensionHelperTest {
     @Before
     public void setup() {
         OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
-        when(extensionConverterProvider.getActionConverter(any(MessageTypeKey.class))).thenReturn(new ConvertorActionFromOFJava<DataContainer, AugmentationPath>() {
-            @Override
-            public Action convert(DataContainer input, AugmentationPath path) {
-                return new MockAction();
-            }
-        });
+        when(extensionConverterProvider.getActionConverter(any(MessageTypeKey.class))).thenReturn((ConvertorActionFromOFJava<DataContainer, AugmentationPath>) (input, path) -> new MockAction());
     }
 
     @Test
@@ -65,7 +60,8 @@ public class ActionExtensionHelperTest {
         experimenterBuilder.setExperimenter(new ExperimenterId(42L));
         experimenterIdCaseBuilder.setExperimenter(experimenterBuilder.build());
         actionBuilder.setActionChoice(experimenterIdCaseBuilder.build());
-        Action action = ActionExtensionHelper.processAlienAction(actionBuilder.build(), OpenflowVersion.OF13, ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);
+        Action action = ActionExtensionHelper.processAlienAction(actionBuilder.build(), OpenflowVersion.OF13,
+                ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
         assertNotNull(action);
         assertEquals(MockAction.class, action.getImplementedInterface());
     }
index 7fcad2bdf58d4d090e0f99a0165057a06ec60914..126fe4df806dc2e426c4eb020ab558eac2780ad2 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.openflow.md.core.extension;
 
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.when;
+
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Before;
@@ -49,12 +50,9 @@ public class MatchExtensionHelperTest {
     @Before
     public void setup() {
         OFSessionUtil.getSessionManager().setExtensionConverterProvider(extensionConverterProvider);
-        when(extensionConverterProvider.getConverter(key)).thenReturn(new ConvertorFromOFJava<DataContainer, AugmentationPath>() {
-            @Override
-            public ExtensionAugment<? extends Augmentation<Extension>> convert(final DataContainer input, final AugmentationPath path) {
-                MockAugmentation mockAugmentation = new MockAugmentation();
-                return new ExtensionAugment<MockAugmentation>(MockAugmentation.class, mockAugmentation, MockExtensionKey.class);
-            }
+        when(extensionConverterProvider.getConverter(key)).thenReturn((ConvertorFromOFJava<DataContainer, AugmentationPath>) (input, path) -> {
+            MockAugmentation mockAugmentation = new MockAugmentation();
+            return new ExtensionAugment<>(MockAugmentation.class, mockAugmentation, MockExtensionKey.class);
         });
     }
 
@@ -66,13 +64,16 @@ public class MatchExtensionHelperTest {
     public void testProcessAllExtensions() {
 
         List<MatchEntry> matchEntries = createMatchEntrieses();
-        AugmentTuple augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13, MatchPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_MATCH);
+        AugmentTuple augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13,
+                MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
         assertNotNull(augmentTuple);
 
-        augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13, MatchPath.PACKETRECEIVED_MATCH);
+        augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13,
+                MatchPath.PACKET_RECEIVED_MATCH);
         assertNotNull(augmentTuple);
 
-        augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13, MatchPath.SWITCHFLOWREMOVED_MATCH);
+        augmentTuple = MatchExtensionHelper.processAllExtensions(matchEntries, OpenflowVersion.OF13,
+                MatchPath.SWITCH_FLOW_REMOVED_MATCH);
         assertNotNull(augmentTuple);
     }
 
index aabb6f720a9b0b2e7be6a065df7d27a2cb401673..4e52e384f50d6f1ae92722bcd14bf105b994ec76 100644 (file)
-/*\r
- * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action;\r
-\r
-import java.math.BigInteger;\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-import java.util.Optional;\r
-import org.junit.Assert;\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowplugin.api.OFConstants;\r
-import org.opendaylight.openflowplugin.extension.api.path.ActionPath;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertorUtil;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpVersion;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.StripVlanActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;\r
-\r
-/**\r
- * @author michal.polkorab\r
- *\r
- */\r
-public class ActionConvertorV10Test {\r
-    private ConvertorManager convertorManager;\r
-\r
-    @Before\r
-    public void setUp() {\r
-        convertorManager = ConvertorManagerFactory.createDefaultManager();\r
-    }\r
-\r
-    /**\r
-     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)}}\r
-     */\r
-    @Test\r
-    public void testGetActions() {\r
-        List<Action> salActions = new ArrayList<>();\r
-        ActionBuilder actionBuilder = new ActionBuilder();\r
-        SetVlanPcpActionCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpActionCaseBuilder();\r
-        SetVlanPcpActionBuilder pcpBuilder = new SetVlanPcpActionBuilder();\r
-        pcpBuilder.setVlanPcp(new VlanPcp((short) 7));\r
-        vlanPcpCaseBuilder.setSetVlanPcpAction(pcpBuilder.build());\r
-        actionBuilder.setAction(vlanPcpCaseBuilder.build());\r
-        actionBuilder.setOrder(0);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        StripVlanActionCaseBuilder stripCaseBuilder = new StripVlanActionCaseBuilder();\r
-        StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder();\r
-        stripCaseBuilder.setStripVlanAction(stripBuilder.build());\r
-        actionBuilder.setAction(stripCaseBuilder.build());\r
-        actionBuilder.setOrder(1);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetDlDstActionCaseBuilder dlDstCaseBuilder = new SetDlDstActionCaseBuilder();\r
-        SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();\r
-        dlDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));\r
-        dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());\r
-        actionBuilder.setAction(dlDstCaseBuilder.build());\r
-        actionBuilder.setOrder(2);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetDlSrcActionCaseBuilder dlSrcCaseBuilder = new SetDlSrcActionCaseBuilder();\r
-        SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();\r
-        dlSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));\r
-        dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());\r
-        actionBuilder.setAction(dlSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(3);\r
-        salActions.add(actionBuilder.build());\r
-       \r
-        actionBuilder = new ActionBuilder();\r
-        SetNwSrcActionCaseBuilder nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();\r
-        SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();\r
-        Ipv4Builder ipv4Builder = new Ipv4Builder();\r
-        /* Use prefix which is correct in canonical representation in test */\r
-        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.0/24"));\r
-        nwSrcBuilder.setAddress(ipv4Builder.build());\r
-        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());\r
-        actionBuilder.setAction(nwSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(4);\r
-        salActions.add(actionBuilder.build());\r
-        \r
-        actionBuilder = new ActionBuilder();\r
-        SetNwDstActionCaseBuilder nwDstCaseBuilder = new SetNwDstActionCaseBuilder();\r
-        SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();\r
-        ipv4Builder = new Ipv4Builder();\r
-        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.2/32"));\r
-        nwDstBuilder.setAddress(ipv4Builder.build());\r
-        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());\r
-        actionBuilder.setAction(nwDstCaseBuilder.build());\r
-        actionBuilder.setOrder(5);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetTpSrcActionCaseBuilder tpSrcCaseBuilder = new SetTpSrcActionCaseBuilder();\r
-        SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();\r
-        tpSrcBuilder.setPort(new PortNumber(54));\r
-        tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());\r
-        actionBuilder.setAction(tpSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(6);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetTpDstActionCaseBuilder tpDstCaseBuilder = new SetTpDstActionCaseBuilder();\r
-        SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();\r
-        tpDstBuilder.setPort(new PortNumber(45));\r
-        tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());\r
-        actionBuilder.setAction(tpDstCaseBuilder.build());\r
-        actionBuilder.setOrder(7);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetNwTosActionCaseBuilder tosCaseBuilder = new SetNwTosActionCaseBuilder();\r
-        SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();\r
-        tosBuilder.setTos(18);\r
-        tosCaseBuilder.setSetNwTosAction(tosBuilder.build());\r
-        actionBuilder.setAction(tosCaseBuilder.build());\r
-        actionBuilder.setOrder(8);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetVlanIdActionCaseBuilder vlanIdCaseBuilder = new SetVlanIdActionCaseBuilder();\r
-        SetVlanIdActionBuilder vlanIdBuilder = new SetVlanIdActionBuilder();\r
-        vlanIdBuilder.setVlanId(new VlanId(22));\r
-        vlanIdCaseBuilder.setSetVlanIdAction(vlanIdBuilder.build());\r
-        actionBuilder.setAction(vlanIdCaseBuilder.build());\r
-        actionBuilder.setOrder(9);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        PopVlanActionCaseBuilder popVlanActionCaseBuilder = new PopVlanActionCaseBuilder();\r
-        actionBuilder.setAction(popVlanActionCaseBuilder.build());\r
-        actionBuilder.setOrder(10);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();\r
-        SetFieldBuilder setFieldBuilder = new SetFieldBuilder();\r
-        VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();\r
-        vlanMatchBuilder.setVlanId(new VlanIdBuilder().setVlanId(new VlanId(22)).build());\r
-        setFieldBuilder.setVlanMatch(vlanMatchBuilder.build());\r
-        setFieldCaseBuilder.setSetField(setFieldBuilder.build());\r
-        actionBuilder.setAction(setFieldCaseBuilder.build());\r
-        actionBuilder.setOrder(11);\r
-        salActions.add(actionBuilder.build());\r
-        \r
-        IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProto(IpVersion.Ipv4);\r
-        MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());\r
-        FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());\r
-        Flow flow = flowBld.build();\r
-\r
-        ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_0);\r
-        data.setDatapathId(new BigInteger("42"));\r
-        data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow));\r
-\r
-        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>> actionsOptional =\r
-                convertorManager.convert(salActions, data);\r
-\r
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actions = actionsOptional.orElse(Collections.emptyList());\r
-        \r
-        Assert.assertEquals("Wrong number of actions", 12, actions.size());\r
-        \r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action action = actions.get(0);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetVlanPcpCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetVlanPcpCase setVlanPcpCase = (SetVlanPcpCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong vlan pcp", 7, setVlanPcpCase.getSetVlanPcpAction().getVlanPcp().intValue());\r
-        \r
-        action = actions.get(1);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());\r
-        \r
-        action = actions.get(2);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetDlDstCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetDlDstCase setDlDstCase = (SetDlDstCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong dl dst", "00:00:00:00:00:06", setDlDstCase.getSetDlDstAction().getDlDstAddress().getValue());\r
-        \r
-        action = actions.get(3);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetDlSrcCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetDlSrcCase setDlSrcCase = (SetDlSrcCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong dl src", "00:00:00:00:00:05", setDlSrcCase.getSetDlSrcAction().getDlSrcAddress().getValue());\r
-        \r
-        action = actions.get(4);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetNwSrcCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetNwSrcCase setNwSrcCase = (SetNwSrcCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong nw src", "10.0.0.0", setNwSrcCase.getSetNwSrcAction().getIpAddress().getValue());\r
-        \r
-        action = actions.get(5);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetNwDstCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetNwDstCase setNwDstCase = (SetNwDstCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong nw dst", "10.0.0.2", setNwDstCase.getSetNwDstAction().getIpAddress().getValue());\r
-        \r
-        action = actions.get(6);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetTpSrcCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetTpSrcCase setTpSrcCase = (SetTpSrcCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong tp src", 54, setTpSrcCase.getSetTpSrcAction().getPort().getValue().intValue());\r
-        \r
-        action = actions.get(7);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetTpDstCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetTpDstCase setTpDstCase = (SetTpDstCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong tp dst", 45, setTpDstCase.getSetTpDstAction().getPort().getValue().intValue());\r
-        \r
-        action = actions.get(8);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetNwTosCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetNwTosCase setNwTosCase = (SetNwTosCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong nw tos", 18, setNwTosCase.getSetNwTosAction().getNwTos().intValue());\r
-        \r
-        action = actions.get(9);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());\r
-        SetVlanVidCase setVlanVidCase = (SetVlanVidCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());\r
-\r
-        action = actions.get(10);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());\r
-\r
-        action = actions.get(11);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());\r
-        setVlanVidCase = (SetVlanVidCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());\r
-    }\r
-\r
-    /**\r
-     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionResponseConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData)}}\r
-     */\r
-    @Test\r
-    public void testToMDSalActions() {\r
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actions = new ArrayList<>();\r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder actionbuilder = \r
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder();\r
-\r
-        OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();\r
-        OutputActionBuilder outputBuilder = new OutputActionBuilder();\r
-        outputBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber(14L));\r
-        outputBuilder.setMaxLength(555);\r
-        caseBuilder.setOutputAction(outputBuilder.build());\r
-        actionbuilder.setActionChoice(caseBuilder.build());\r
-        actions.add(actionbuilder.build());\r
-\r
-        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_0);\r
-        data.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);\r
-\r
-        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action\r
-        .Action>> mdSalActionsOptional =\r
-                convertorManager.convert(\r
-                        actions, data);\r
-\r
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action\r
-                .Action> mdSalActions = mdSalActionsOptional.orElse(Collections.emptyList());\r
-\r
-        Assert.assertEquals("Wrong number of output actions", 1, mdSalActions.size());\r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action = mdSalActions.get(0);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.OutputActionCase", action.getImplementedInterface().getName());\r
-        OutputActionCase outputAction = (OutputActionCase) action;\r
-        Assert.assertEquals("Wrong output port", "14", outputAction.getOutputAction().getOutputNodeConnector().getValue());\r
-        Assert.assertEquals("Wrong max length", 555, outputAction.getOutputAction().getMaxLength().intValue());\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertorUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpVersion;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopVlanActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.StripVlanActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTosCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetTpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetVlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+
+/**
+ * @author michal.polkorab
+ *
+ */
+public class ActionConvertorV10Test {
+    private ConvertorManager convertorManager;
+
+    @Before
+    public void setUp() {
+        convertorManager = ConvertorManagerFactory.createDefaultManager();
+    }
+
+    /**
+     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)}}
+     */
+    @Test
+    public void testGetActions() {
+        List<Action> salActions = new ArrayList<>();
+        ActionBuilder actionBuilder = new ActionBuilder();
+        SetVlanPcpActionCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpActionCaseBuilder();
+        SetVlanPcpActionBuilder pcpBuilder = new SetVlanPcpActionBuilder();
+        pcpBuilder.setVlanPcp(new VlanPcp((short) 7));
+        vlanPcpCaseBuilder.setSetVlanPcpAction(pcpBuilder.build());
+        actionBuilder.setAction(vlanPcpCaseBuilder.build());
+        actionBuilder.setOrder(0);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        StripVlanActionCaseBuilder stripCaseBuilder = new StripVlanActionCaseBuilder();
+        StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder();
+        stripCaseBuilder.setStripVlanAction(stripBuilder.build());
+        actionBuilder.setAction(stripCaseBuilder.build());
+        actionBuilder.setOrder(1);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetDlDstActionCaseBuilder dlDstCaseBuilder = new SetDlDstActionCaseBuilder();
+        SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();
+        dlDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));
+        dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());
+        actionBuilder.setAction(dlDstCaseBuilder.build());
+        actionBuilder.setOrder(2);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetDlSrcActionCaseBuilder dlSrcCaseBuilder = new SetDlSrcActionCaseBuilder();
+        SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();
+        dlSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));
+        dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());
+        actionBuilder.setAction(dlSrcCaseBuilder.build());
+        actionBuilder.setOrder(3);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetNwSrcActionCaseBuilder nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();
+        SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();
+        Ipv4Builder ipv4Builder = new Ipv4Builder();
+        /* Use prefix which is correct in canonical representation in test */
+        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.0/24"));
+        nwSrcBuilder.setAddress(ipv4Builder.build());
+        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());
+        actionBuilder.setAction(nwSrcCaseBuilder.build());
+        actionBuilder.setOrder(4);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetNwDstActionCaseBuilder nwDstCaseBuilder = new SetNwDstActionCaseBuilder();
+        SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
+        ipv4Builder = new Ipv4Builder();
+        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.2/32"));
+        nwDstBuilder.setAddress(ipv4Builder.build());
+        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
+        actionBuilder.setAction(nwDstCaseBuilder.build());
+        actionBuilder.setOrder(5);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetTpSrcActionCaseBuilder tpSrcCaseBuilder = new SetTpSrcActionCaseBuilder();
+        SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
+        tpSrcBuilder.setPort(new PortNumber(54));
+        tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
+        actionBuilder.setAction(tpSrcCaseBuilder.build());
+        actionBuilder.setOrder(6);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetTpDstActionCaseBuilder tpDstCaseBuilder = new SetTpDstActionCaseBuilder();
+        SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();
+        tpDstBuilder.setPort(new PortNumber(45));
+        tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());
+        actionBuilder.setAction(tpDstCaseBuilder.build());
+        actionBuilder.setOrder(7);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetNwTosActionCaseBuilder tosCaseBuilder = new SetNwTosActionCaseBuilder();
+        SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
+        tosBuilder.setTos(18);
+        tosCaseBuilder.setSetNwTosAction(tosBuilder.build());
+        actionBuilder.setAction(tosCaseBuilder.build());
+        actionBuilder.setOrder(8);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetVlanIdActionCaseBuilder vlanIdCaseBuilder = new SetVlanIdActionCaseBuilder();
+        SetVlanIdActionBuilder vlanIdBuilder = new SetVlanIdActionBuilder();
+        vlanIdBuilder.setVlanId(new VlanId(22));
+        vlanIdCaseBuilder.setSetVlanIdAction(vlanIdBuilder.build());
+        actionBuilder.setAction(vlanIdCaseBuilder.build());
+        actionBuilder.setOrder(9);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        PopVlanActionCaseBuilder popVlanActionCaseBuilder = new PopVlanActionCaseBuilder();
+        actionBuilder.setAction(popVlanActionCaseBuilder.build());
+        actionBuilder.setOrder(10);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
+        SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
+        VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
+        vlanMatchBuilder.setVlanId(new VlanIdBuilder().setVlanId(new VlanId(22)).build());
+        setFieldBuilder.setVlanMatch(vlanMatchBuilder.build());
+        setFieldCaseBuilder.setSetField(setFieldBuilder.build());
+        actionBuilder.setAction(setFieldCaseBuilder.build());
+        actionBuilder.setOrder(11);
+        salActions.add(actionBuilder.build());
+
+        IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProto(IpVersion.Ipv4);
+        MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());
+        FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());
+        Flow flow = flowBld.build();
+
+        ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_0);
+        data.setDatapathId(new BigInteger("42"));
+        data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow));
+
+        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>> actionsOptional =
+                convertorManager.convert(salActions, data);
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actions = actionsOptional.orElse(Collections.emptyList());
+
+        Assert.assertEquals("Wrong number of actions", 12, actions.size());
+
+        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action action = actions.get(0);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetVlanPcpCase", action.getActionChoice().getImplementedInterface().getName());
+        SetVlanPcpCase setVlanPcpCase = (SetVlanPcpCase) action.getActionChoice();
+        Assert.assertEquals("Wrong vlan pcp", 7, setVlanPcpCase.getSetVlanPcpAction().getVlanPcp().intValue());
+
+        action = actions.get(1);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());
+
+        action = actions.get(2);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetDlDstCase", action.getActionChoice().getImplementedInterface().getName());
+        SetDlDstCase setDlDstCase = (SetDlDstCase) action.getActionChoice();
+        Assert.assertEquals("Wrong dl dst", "00:00:00:00:00:06", setDlDstCase.getSetDlDstAction().getDlDstAddress().getValue());
+
+        action = actions.get(3);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetDlSrcCase", action.getActionChoice().getImplementedInterface().getName());
+        SetDlSrcCase setDlSrcCase = (SetDlSrcCase) action.getActionChoice();
+        Assert.assertEquals("Wrong dl src", "00:00:00:00:00:05", setDlSrcCase.getSetDlSrcAction().getDlSrcAddress().getValue());
+
+        action = actions.get(4);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetNwSrcCase", action.getActionChoice().getImplementedInterface().getName());
+        SetNwSrcCase setNwSrcCase = (SetNwSrcCase) action.getActionChoice();
+        Assert.assertEquals("Wrong nw src", "10.0.0.0", setNwSrcCase.getSetNwSrcAction().getIpAddress().getValue());
+
+        action = actions.get(5);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetNwDstCase", action.getActionChoice().getImplementedInterface().getName());
+        SetNwDstCase setNwDstCase = (SetNwDstCase) action.getActionChoice();
+        Assert.assertEquals("Wrong nw dst", "10.0.0.2", setNwDstCase.getSetNwDstAction().getIpAddress().getValue());
+
+        action = actions.get(6);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetTpSrcCase", action.getActionChoice().getImplementedInterface().getName());
+        SetTpSrcCase setTpSrcCase = (SetTpSrcCase) action.getActionChoice();
+        Assert.assertEquals("Wrong tp src", 54, setTpSrcCase.getSetTpSrcAction().getPort().getValue().intValue());
+
+        action = actions.get(7);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetTpDstCase", action.getActionChoice().getImplementedInterface().getName());
+        SetTpDstCase setTpDstCase = (SetTpDstCase) action.getActionChoice();
+        Assert.assertEquals("Wrong tp dst", 45, setTpDstCase.getSetTpDstAction().getPort().getValue().intValue());
+
+        action = actions.get(8);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetNwTosCase", action.getActionChoice().getImplementedInterface().getName());
+        SetNwTosCase setNwTosCase = (SetNwTosCase) action.getActionChoice();
+        Assert.assertEquals("Wrong nw tos", 18, setNwTosCase.getSetNwTosAction().getNwTos().intValue());
+
+        action = actions.get(9);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());
+        SetVlanVidCase setVlanVidCase = (SetVlanVidCase) action.getActionChoice();
+        Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());
+
+        action = actions.get(10);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());
+
+        action = actions.get(11);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());
+        setVlanVidCase = (SetVlanVidCase) action.getActionChoice();
+        Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());
+    }
+
+    /**
+     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionResponseConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData)}}
+     */
+    @Test
+    public void testToMDSalActions() {
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actions = new ArrayList<>();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder actionbuilder =
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder();
+
+        OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+        OutputActionBuilder outputBuilder = new OutputActionBuilder();
+        outputBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber(14L));
+        outputBuilder.setMaxLength(555);
+        caseBuilder.setOutputAction(outputBuilder.build());
+        actionbuilder.setActionChoice(caseBuilder.build());
+        actions.add(actionbuilder.build());
+
+        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_0);
+        data.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
+
+        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+        .Action>> mdSalActionsOptional =
+                convertorManager.convert(
+                        actions, data);
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+                .Action> mdSalActions = mdSalActionsOptional.orElse(Collections.emptyList());
+
+        Assert.assertEquals("Wrong number of output actions", 1, mdSalActions.size());
+        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action = mdSalActions.get(0);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.OutputActionCase", action.getImplementedInterface().getName());
+        OutputActionCase outputAction = (OutputActionCase) action;
+        Assert.assertEquals("Wrong output port", "14", outputAction.getOutputAction().getOutputNodeConnector().getValue());
+        Assert.assertEquals("Wrong max length", 555, outputAction.getOutputAction().getMaxLength().intValue());
+    }
+}
index d915e4d3ddecdefa8bff3ddd49205788a09a70dc..3c24df218ca3fec03675b4259458cb45bdd12c40 100644 (file)
-/*\r
- * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-\r
-package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action;\r
-\r
-import java.math.BigInteger;\r
-import java.util.ArrayList;\r
-import java.util.Collections;\r
-import java.util.List;\r
-import java.util.Optional;\r
-import org.junit.Assert;\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.openflowplugin.api.OFConstants;\r
-import org.opendaylight.openflowplugin.extension.api.path.ActionPath;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData;\r
-import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertorUtil;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;\r
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.StripVlanActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopMplsCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.pop.mpls._case.PopMplsActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.mpls._case.PushMplsActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.ttl._case.SetNwTtlActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.queue._case.SetQueueActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;\r
-\r
-/**\r
- * @author michal.polkorab\r
- */\r
-public class ActionConvertorV13Test {\r
-    private ConvertorManager convertorManager;\r
-\r
-    @Before\r
-    public void setUp() {\r
-        convertorManager = ConvertorManagerFactory.createDefaultManager();\r
-    }\r
-\r
-    /**\r
-     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionResponseConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData)}}\r
-     */\r
-    @Test\r
-    public void testToMDSalActions() {\r
-        List<Action> actions = new ArrayList<>();\r
-        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_3);\r
-        data.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);\r
-\r
-        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action\r
-                .Action>> mdSalActions = convertorManager.convert(actions, data);\r
-\r
-        Assert.assertEquals("Wrong number of output actions", 0, mdSalActions.orElse(Collections.emptyList()).size());\r
-    }\r
-\r
-    /**\r
-     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)}}\r
-     */\r
-    //@Test\r
-    public void testToMDSalActions2() {\r
-        List<Action> actions = new ArrayList<>();\r
-\r
-        ActionBuilder actionBuilder = new ActionBuilder();\r
-        OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();\r
-        OutputActionBuilder outputBuilder = new OutputActionBuilder();\r
-        outputBuilder.setPort(new PortNumber(42L));\r
-        outputBuilder.setMaxLength(52);\r
-        caseBuilder.setOutputAction(outputBuilder.build());\r
-        actionBuilder.setActionChoice(caseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new CopyTtlInCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();\r
-        SetMplsTtlActionBuilder setMplsTtlBuilder = new SetMplsTtlActionBuilder();\r
-        setMplsTtlBuilder.setMplsTtl((short) 4);\r
-        setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlBuilder.build());\r
-        actionBuilder.setActionChoice(setMplsTtlCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new DecMplsTtlCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();\r
-        PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();\r
-        pushVlanBuilder.setEthertype(new EtherType(new EtherType(16)));\r
-        pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());\r
-        actionBuilder.setActionChoice(pushVlanCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        PushMplsCaseBuilder pushMplsCaseBuilder = new PushMplsCaseBuilder();\r
-        PushMplsActionBuilder pushMplsBuilder = new PushMplsActionBuilder();\r
-        pushMplsBuilder.setEthertype(new EtherType(new EtherType(17)));\r
-        pushMplsCaseBuilder.setPushMplsAction(pushMplsBuilder.build());\r
-        actionBuilder.setActionChoice(pushMplsCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();\r
-        PopMplsActionBuilder popMplsBuilder = new PopMplsActionBuilder();\r
-        popMplsBuilder.setEthertype(new EtherType(new EtherType(18)));\r
-        popMplsCaseBuilder.setPopMplsAction(popMplsBuilder.build());\r
-        actionBuilder.setActionChoice(popMplsCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetQueueCaseBuilder setQueueCaseBuilder = new SetQueueCaseBuilder();\r
-        SetQueueActionBuilder setQueueBuilder = new SetQueueActionBuilder();\r
-        setQueueBuilder.setQueueId(1234L);\r
-        setQueueCaseBuilder.setSetQueueAction(setQueueBuilder.build());\r
-        actionBuilder.setActionChoice(setQueueCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();\r
-        GroupActionBuilder groupActionBuilder = new GroupActionBuilder();\r
-        groupActionBuilder.setGroupId(555L);\r
-        groupCaseBuilder.setGroupAction(groupActionBuilder.build());\r
-        actionBuilder.setActionChoice(groupCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetNwTtlCaseBuilder nwTtlCaseBuilder = new SetNwTtlCaseBuilder();\r
-        SetNwTtlActionBuilder nwTtlBuilder = new SetNwTtlActionBuilder();\r
-        nwTtlBuilder.setNwTtl((short) 8);\r
-        nwTtlCaseBuilder.setSetNwTtlAction(nwTtlBuilder.build());\r
-        actionBuilder.setActionChoice(nwTtlCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();\r
-        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();\r
-        List<MatchEntry> entries = new ArrayList<>();\r
-        MatchEntryBuilder matchBuilder = new MatchEntryBuilder();\r
-        matchBuilder.setOxmClass(OpenflowBasicClass.class);\r
-        matchBuilder.setOxmMatchField(InPort.class);\r
-        matchBuilder.setHasMask(false);\r
-        InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();\r
-        InPortBuilder inPortBuilder = new InPortBuilder();\r
-        inPortBuilder.setPortNumber(new PortNumber(1L));\r
-        inPortCaseBuilder.setInPort(inPortBuilder.build());\r
-        matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());\r
-        entries.add(matchBuilder.build());\r
-        setFieldBuilder.setMatchEntry(entries);\r
-        setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());\r
-        actionBuilder.setActionChoice(setFieldCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();\r
-        PushPbbActionBuilder pushPbbBuilder = new PushPbbActionBuilder();\r
-        pushPbbBuilder.setEthertype(new EtherType(new EtherType(19)));\r
-        pushPbbCaseBuilder.setPushPbbAction(pushPbbBuilder.build());\r
-        actionBuilder.setActionChoice(pushPbbCaseBuilder.build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        // Add some unsupported actions and check if they are missing from results\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new SetNwDstCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new ActionBuilder();\r
-        actionBuilder.setActionChoice(new StripVlanCaseBuilder().build());\r
-        actions.add(actionBuilder.build());\r
-\r
-        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_3);\r
-        data.setActionPath(ActionPath.FLOWSSTATISTICSUPDATE_FLOWANDSTATISTICSMAPLIST_INSTRUCTIONS_INSTRUCTION_INSTRUCTION_APPLYACTIONSCASE_APPLYACTIONS_ACTION_ACTION);\r
-\r
-        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action\r
-                .Action>> mdSalActionsOptional = convertorManager.convert(actions, data);\r
-\r
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action\r
-                .Action> mdSalActions = mdSalActionsOptional.orElse(Collections.emptyList());\r
-\r
-        Assert.assertEquals("Wrong number of output actions", 16, mdSalActions.size());\r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action = mdSalActions.get(0);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.OutputActionCase", action.getImplementedInterface().getName());\r
-        OutputActionCase output = (OutputActionCase) action;\r
-        Assert.assertEquals("Wrong output port", "42", output.getOutputAction().getOutputNodeConnector().getValue());\r
-        Assert.assertEquals("Wrong max length", 52, output.getOutputAction().getMaxLength().intValue());\r
-        action = mdSalActions.get(1);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.CopyTtlOutCase", action.getImplementedInterface().getName());\r
-        action = mdSalActions.get(2);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.CopyTtlInCase", action.getImplementedInterface().getName());\r
-        action = mdSalActions.get(3);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.SetMplsTtlActionCase", action.getImplementedInterface().getName());\r
-        SetMplsTtlActionCase setMplsTtl = (SetMplsTtlActionCase) action;\r
-        Assert.assertEquals("Wrong mpls ttl", 4, setMplsTtl.getSetMplsTtlAction().getMplsTtl().intValue());\r
-        action = mdSalActions.get(4);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.DecMplsTtlCase", action.getImplementedInterface().getName());\r
-        action = mdSalActions.get(5);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PushVlanActionCase", action.getImplementedInterface().getName());\r
-        PushVlanActionCase pushVlan = (PushVlanActionCase) action;\r
-        Assert.assertEquals("Wrong ethertype", 16, pushVlan.getPushVlanAction().getEthernetType().intValue());\r
-        action = mdSalActions.get(6);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PopVlanActionCase", action.getImplementedInterface().getName());\r
-        action = mdSalActions.get(7);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PushMplsActionCase", action.getImplementedInterface().getName());\r
-        PushMplsActionCase pushMpls = (PushMplsActionCase) action;\r
-        Assert.assertEquals("Wrong ethertype", 17, pushMpls.getPushMplsAction().getEthernetType().intValue());\r
-        action = mdSalActions.get(8);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PopMplsActionCase", action.getImplementedInterface().getName());\r
-        PopMplsActionCase popMpls = (PopMplsActionCase) action;\r
-        Assert.assertEquals("Wrong ethertype", 18, popMpls.getPopMplsAction().getEthernetType().intValue());\r
-        action = mdSalActions.get(9);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.SetQueueActionCase", action.getImplementedInterface().getName());\r
-        SetQueueActionCase setQueue = (SetQueueActionCase) action;\r
-        Assert.assertEquals("Wrong queue-id", 1234, setQueue.getSetQueueAction().getQueueId().intValue());\r
-        action = mdSalActions.get(10);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.GroupActionCase", action.getImplementedInterface().getName());\r
-        GroupActionCase groupAction = (GroupActionCase) action;\r
-        Assert.assertEquals("Wrong group-id", 555, groupAction.getGroupAction().getGroupId().intValue());\r
-        action = mdSalActions.get(11);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.SetNwTtlActionCase", action.getImplementedInterface().getName());\r
-        SetNwTtlActionCase setNwTtl = (SetNwTtlActionCase) action;\r
-        Assert.assertEquals("Wrong nw ttl", 8, setNwTtl.getSetNwTtlAction().getNwTtl().intValue());\r
-        action = mdSalActions.get(12);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.DecNwTtlCase", action.getImplementedInterface().getName());\r
-        action = mdSalActions.get(13);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.SetFieldCase", action.getImplementedInterface().getName());\r
-        SetFieldCase setField = (SetFieldCase) action;\r
-        Assert.assertEquals("Wrong in port", "openflow:null:1", setField.getSetField().getInPort().getValue());\r
-        action = mdSalActions.get(14);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PushPbbActionCase", action.getImplementedInterface().getName());\r
-        PushPbbActionCase pushPbb = (PushPbbActionCase) action;\r
-        Assert.assertEquals("Wrong ethertype", 19, pushPbb.getPushPbbAction().getEthernetType().intValue());\r
-        action = mdSalActions.get(15);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"\r
-                + ".rev131112.action.action.PopPbbActionCase", action.getImplementedInterface().getName());\r
-    }\r
-\r
-    /**\r
-     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)} }\r
-     */\r
-    @Test\r
-    public void testGetActions() {\r
-        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list\r
-                .Action> salActions = new ArrayList<>();\r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list\r
-                .ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-\r
-        SetVlanPcpActionCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpActionCaseBuilder();\r
-        SetVlanPcpActionBuilder pcpBuilder = new SetVlanPcpActionBuilder();\r
-        pcpBuilder.setVlanPcp(new VlanPcp((short) 7));\r
-        vlanPcpCaseBuilder.setSetVlanPcpAction(pcpBuilder.build());\r
-        actionBuilder.setAction(vlanPcpCaseBuilder.build());\r
-        actionBuilder.setOrder(0);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        StripVlanActionCaseBuilder stripCaseBuilder = new StripVlanActionCaseBuilder();\r
-        StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder();\r
-        stripCaseBuilder.setStripVlanAction(stripBuilder.build());\r
-        actionBuilder.setAction(stripCaseBuilder.build());\r
-        actionBuilder.setOrder(1);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetDlDstActionCaseBuilder dlDstCaseBuilder = new SetDlDstActionCaseBuilder();\r
-        SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();\r
-        dlDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));\r
-        dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());\r
-        actionBuilder.setAction(dlDstCaseBuilder.build());\r
-        actionBuilder.setOrder(2);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetDlSrcActionCaseBuilder dlSrcCaseBuilder = new SetDlSrcActionCaseBuilder();\r
-        SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();\r
-        dlSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));\r
-        dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());\r
-        actionBuilder.setAction(dlSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(3);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetNwSrcActionCaseBuilder nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();\r
-        SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();\r
-        Ipv4Builder ipv4Builder = new Ipv4Builder();\r
-        /* Correct canonical form for v4 prefix!!! */\r
-        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.0/24"));\r
-        nwSrcBuilder.setAddress(ipv4Builder.build());\r
-        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());\r
-        actionBuilder.setAction(nwSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(4);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetNwDstActionCaseBuilder nwDstCaseBuilder = new SetNwDstActionCaseBuilder();\r
-        SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();\r
-        ipv4Builder = new Ipv4Builder();\r
-        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.2/32"));\r
-        nwDstBuilder.setAddress(ipv4Builder.build());\r
-        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());\r
-        actionBuilder.setAction(nwDstCaseBuilder.build());\r
-        actionBuilder.setOrder(5);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetTpSrcActionCaseBuilder tpSrcCaseBuilder = new SetTpSrcActionCaseBuilder();\r
-        SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();\r
-        tpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types\r
-                .rev130715.PortNumber(54));\r
-        tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());\r
-        actionBuilder.setAction(tpSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(6);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetTpDstActionCaseBuilder tpDstCaseBuilder = new SetTpDstActionCaseBuilder();\r
-        SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();\r
-        tpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types\r
-                .rev130715.PortNumber(45));\r
-        tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());\r
-        actionBuilder.setAction(tpDstCaseBuilder.build());\r
-        actionBuilder.setOrder(7);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetNwTosActionCaseBuilder tosCaseBuilder = new SetNwTosActionCaseBuilder();\r
-        SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();\r
-        tosBuilder.setTos(16);\r
-        tosCaseBuilder.setSetNwTosAction(tosBuilder.build());\r
-        actionBuilder.setAction(tosCaseBuilder.build());\r
-        actionBuilder.setOrder(8);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        SetVlanIdActionCaseBuilder vlanIdCaseBuilder = new SetVlanIdActionCaseBuilder();\r
-        SetVlanIdActionBuilder vlanIdBuilder = new SetVlanIdActionBuilder();\r
-        vlanIdBuilder.setVlanId(new VlanId(22));\r
-        vlanIdCaseBuilder.setSetVlanIdAction(vlanIdBuilder.build());\r
-        actionBuilder.setAction(vlanIdCaseBuilder.build());\r
-        actionBuilder.setOrder(9);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();\r
-        nwSrcBuilder = new SetNwSrcActionBuilder();\r
-        Ipv6Builder ipv6Builder = new Ipv6Builder();\r
-        /* Use canonical form, 00:00:0000 is not a valid v6 notation */\r
-        ipv6Builder.setIpv6Address(new Ipv6Prefix("::5/128"));\r
-        nwSrcBuilder.setAddress(ipv6Builder.build());\r
-        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());\r
-        actionBuilder.setAction(nwSrcCaseBuilder.build());\r
-        actionBuilder.setOrder(10);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112\r
-                .action.list.ActionBuilder();\r
-        nwDstCaseBuilder = new SetNwDstActionCaseBuilder();\r
-        nwDstBuilder = new SetNwDstActionBuilder();\r
-        ipv6Builder = new Ipv6Builder();\r
-        /* Use canonical form, 00:00:0006/64 is not a valid v6 notation - this equates to ::/64 */\r
-        ipv6Builder.setIpv6Address(new Ipv6Prefix("::/64"));\r
-        nwDstBuilder.setAddress(ipv6Builder.build());\r
-        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());\r
-        actionBuilder.setAction(nwDstCaseBuilder.build());\r
-        actionBuilder.setOrder(11);\r
-        salActions.add(actionBuilder.build());\r
-\r
-        IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProtocol((short) 6);\r
-        MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());\r
-        FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());\r
-        Flow flow = flowBld.build();\r
-\r
-        ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_3);\r
-        data.setDatapathId(new BigInteger("42"));\r
-        data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow));\r
-\r
-        Optional<List<Action>> actionsOptional = convertorManager.convert(salActions, data);\r
-        List<Action> actions = actionsOptional.orElse(Collections.emptyList());\r
-\r
-        Assert.assertEquals("Wrong number of actions", 12, actions.size());\r
-        Action action = actions.get(0);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        MatchEntry entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);;\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp.class, false);\r
-        Assert.assertEquals("Wrong vlan pcp", 7, ((VlanPcpCase) entry.getMatchEntryValue()).getVlanPcp().getVlanPcp()\r
-                .intValue());\r
-\r
-        action = actions.get(1);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        setFieldCase =\r
-          (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid.class, false);\r
-        Assert.assertEquals("Wrong vlan vid", 0, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getVlanVid()\r
-                .intValue());\r
-        Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().isCfiBit());\r
-\r
-        action = actions.get(2);\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst.class, false);\r
-        Assert.assertEquals("Wrong dl dst", "00:00:00:00:00:06", ((EthDstCase) entry.getMatchEntryValue()).getEthDst()\r
-                .getMacAddress().getValue());\r
-\r
-        action = actions.get(3);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc.class, false);\r
-        Assert.assertEquals("Wrong dl src", "00:00:00:00:00:05", ((EthSrcCase) entry.getMatchEntryValue()).getEthSrc()\r
-                .getMacAddress().getValue());\r
-\r
-        action = actions.get(4);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src.class, false);\r
-        Assert.assertEquals("Wrong ipv4 src", "10.0.0.0", ((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src()\r
-                .getIpv4Address().getValue());\r
-\r
-        action = actions.get(5);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst.class, false);\r
-        Assert.assertEquals("Wrong ipv4 dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst()\r
-                .getIpv4Address().getValue());\r
-\r
-        action = actions.get(6);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc.class, false);\r
-        Assert.assertEquals("Wrong tcp src", 54, ((TcpSrcCase) entry.getMatchEntryValue()).getTcpSrc()\r
-                .getPort().getValue().intValue());\r
-\r
-        action = actions.get(7);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);;\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst.class, false);\r
-        Assert.assertEquals("Wrong tcp dst", 45, ((TcpDstCase) entry.getMatchEntryValue()).getTcpDst()\r
-                .getPort().getValue().intValue());\r
-\r
-        action = actions.get(8);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp.class, false);\r
-        Assert.assertEquals("Wrong ip dscp", 4, ((IpDscpCase) entry.getMatchEntryValue()).getIpDscp()\r
-                .getDscp().getValue().intValue());\r
-\r
-        action = actions.get(9);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid.class, false);\r
-        Assert.assertEquals("Wrong vlan id", 22, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()\r
-                .getVlanVid().intValue());\r
-        Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()\r
-                .isCfiBit());\r
-\r
-        action = actions.get(10);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src.class, false);\r
-        Assert.assertEquals("Wrong ipv6 src", "::5",\r
-                ((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address().getValue());\r
-\r
-        action = actions.get(11);\r
-        setFieldCase =\r
-                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();\r
-        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"\r
-                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());\r
-        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);\r
-        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst.class, false);\r
-        Assert.assertEquals("Wrong ipv6 dst", "::",\r
-                ((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getIpv6Address().getValue());\r
-    }\r
-\r
-    private static void checkEntryHeader(MatchEntry entry, Class<? extends MatchField> field, boolean hasMask) {\r
-        Assert.assertEquals("Wrong oxm class", OpenflowBasicClass.class, entry.getOxmClass());\r
-        Assert.assertEquals("Wrong oxm field", field, entry.getOxmMatchField());\r
-        Assert.assertEquals("Wrong hasMask", hasMask, entry.isHasMask());\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.openflowplugin.api.OFConstants;
+import org.opendaylight.openflowplugin.extension.api.path.ActionPath;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertorUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushMplsActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushPbbActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PushVlanActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetDlSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetMplsTtlActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTosActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwTtlActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetQueueActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpDstActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetTpSrcActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanIdActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetVlanPcpActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.StripVlanActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.dst.action._case.SetDlDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.tos.action._case.SetNwTosActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.dst.action._case.SetTpDstActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.tp.src.action._case.SetTpSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.id.action._case.SetVlanIdActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.vlan.pcp.action._case.SetVlanPcpActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.strip.vlan.action._case.StripVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv6Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlInCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.CopyTtlOutCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.DecNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.GroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.OutputActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PopVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushMplsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushPbbCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.PushVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetMplsTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwDstCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetNwTtlCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetQueueCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.StripVlanCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.group._case.GroupActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.output.action._case.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.pop.mpls._case.PopMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.mpls._case.PushMplsActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.pbb._case.PushPbbActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.push.vlan._case.PushVlanActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.mpls.ttl._case.SetMplsTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.nw.ttl._case.SetNwTtlActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.queue._case.SetQueueActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.IpDscpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4DstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv4SrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6DstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Ipv6SrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpDstCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TcpSrcCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanPcpCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder;
+
+/**
+ * @author michal.polkorab
+ */
+public class ActionConvertorV13Test {
+    private ConvertorManager convertorManager;
+
+    @Before
+    public void setUp() {
+        convertorManager = ConvertorManagerFactory.createDefaultManager();
+    }
+
+    /**
+     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionResponseConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionResponseConvertorData)}}
+     */
+    @Test
+    public void testToMDSalActions() {
+        List<Action> actions = new ArrayList<>();
+        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_3);
+        data.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
+
+        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+                .Action>> mdSalActions = convertorManager.convert(actions, data);
+
+        Assert.assertEquals("Wrong number of output actions", 0, mdSalActions.orElse(Collections.emptyList()).size());
+    }
+
+    /**
+     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)}}
+     */
+    //@Test
+    public void testToMDSalActions2() {
+        List<Action> actions = new ArrayList<>();
+
+        ActionBuilder actionBuilder = new ActionBuilder();
+        OutputActionCaseBuilder caseBuilder = new OutputActionCaseBuilder();
+        OutputActionBuilder outputBuilder = new OutputActionBuilder();
+        outputBuilder.setPort(new PortNumber(42L));
+        outputBuilder.setMaxLength(52);
+        caseBuilder.setOutputAction(outputBuilder.build());
+        actionBuilder.setActionChoice(caseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new CopyTtlOutCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new CopyTtlInCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetMplsTtlCaseBuilder setMplsTtlCaseBuilder = new SetMplsTtlCaseBuilder();
+        SetMplsTtlActionBuilder setMplsTtlBuilder = new SetMplsTtlActionBuilder();
+        setMplsTtlBuilder.setMplsTtl((short) 4);
+        setMplsTtlCaseBuilder.setSetMplsTtlAction(setMplsTtlBuilder.build());
+        actionBuilder.setActionChoice(setMplsTtlCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new DecMplsTtlCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
+        PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
+        pushVlanBuilder.setEthertype(new EtherType(new EtherType(16)));
+        pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
+        actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        PushMplsCaseBuilder pushMplsCaseBuilder = new PushMplsCaseBuilder();
+        PushMplsActionBuilder pushMplsBuilder = new PushMplsActionBuilder();
+        pushMplsBuilder.setEthertype(new EtherType(new EtherType(17)));
+        pushMplsCaseBuilder.setPushMplsAction(pushMplsBuilder.build());
+        actionBuilder.setActionChoice(pushMplsCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        PopMplsCaseBuilder popMplsCaseBuilder = new PopMplsCaseBuilder();
+        PopMplsActionBuilder popMplsBuilder = new PopMplsActionBuilder();
+        popMplsBuilder.setEthertype(new EtherType(new EtherType(18)));
+        popMplsCaseBuilder.setPopMplsAction(popMplsBuilder.build());
+        actionBuilder.setActionChoice(popMplsCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetQueueCaseBuilder setQueueCaseBuilder = new SetQueueCaseBuilder();
+        SetQueueActionBuilder setQueueBuilder = new SetQueueActionBuilder();
+        setQueueBuilder.setQueueId(1234L);
+        setQueueCaseBuilder.setSetQueueAction(setQueueBuilder.build());
+        actionBuilder.setActionChoice(setQueueCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        GroupCaseBuilder groupCaseBuilder = new GroupCaseBuilder();
+        GroupActionBuilder groupActionBuilder = new GroupActionBuilder();
+        groupActionBuilder.setGroupId(555L);
+        groupCaseBuilder.setGroupAction(groupActionBuilder.build());
+        actionBuilder.setActionChoice(groupCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetNwTtlCaseBuilder nwTtlCaseBuilder = new SetNwTtlCaseBuilder();
+        SetNwTtlActionBuilder nwTtlBuilder = new SetNwTtlActionBuilder();
+        nwTtlBuilder.setNwTtl((short) 8);
+        nwTtlCaseBuilder.setSetNwTtlAction(nwTtlBuilder.build());
+        actionBuilder.setActionChoice(nwTtlCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new DecNwTtlCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
+        SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
+        List<MatchEntry> entries = new ArrayList<>();
+        MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
+        matchBuilder.setOxmClass(OpenflowBasicClass.class);
+        matchBuilder.setOxmMatchField(InPort.class);
+        matchBuilder.setHasMask(false);
+        InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
+        InPortBuilder inPortBuilder = new InPortBuilder();
+        inPortBuilder.setPortNumber(new PortNumber(1L));
+        inPortCaseBuilder.setInPort(inPortBuilder.build());
+        matchBuilder.setMatchEntryValue(inPortCaseBuilder.build());
+        entries.add(matchBuilder.build());
+        setFieldBuilder.setMatchEntry(entries);
+        setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
+        actionBuilder.setActionChoice(setFieldCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        PushPbbCaseBuilder pushPbbCaseBuilder = new PushPbbCaseBuilder();
+        PushPbbActionBuilder pushPbbBuilder = new PushPbbActionBuilder();
+        pushPbbBuilder.setEthertype(new EtherType(new EtherType(19)));
+        pushPbbCaseBuilder.setPushPbbAction(pushPbbBuilder.build());
+        actionBuilder.setActionChoice(pushPbbCaseBuilder.build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new PopPbbCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        // Add some unsupported actions and check if they are missing from results
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new SetNwDstCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        actionBuilder = new ActionBuilder();
+        actionBuilder.setActionChoice(new StripVlanCaseBuilder().build());
+        actions.add(actionBuilder.build());
+
+        ActionResponseConvertorData data = new ActionResponseConvertorData(OFConstants.OFP_VERSION_1_3);
+        data.setActionPath(ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS);
+
+        Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+                .Action>> mdSalActionsOptional = convertorManager.convert(actions, data);
+
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
+                .Action> mdSalActions = mdSalActionsOptional.orElse(Collections.emptyList());
+
+        Assert.assertEquals("Wrong number of output actions", 16, mdSalActions.size());
+        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action = mdSalActions.get(0);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.OutputActionCase", action.getImplementedInterface().getName());
+        OutputActionCase output = (OutputActionCase) action;
+        Assert.assertEquals("Wrong output port", "42", output.getOutputAction().getOutputNodeConnector().getValue());
+        Assert.assertEquals("Wrong max length", 52, output.getOutputAction().getMaxLength().intValue());
+        action = mdSalActions.get(1);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.CopyTtlOutCase", action.getImplementedInterface().getName());
+        action = mdSalActions.get(2);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.CopyTtlInCase", action.getImplementedInterface().getName());
+        action = mdSalActions.get(3);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.SetMplsTtlActionCase", action.getImplementedInterface().getName());
+        SetMplsTtlActionCase setMplsTtl = (SetMplsTtlActionCase) action;
+        Assert.assertEquals("Wrong mpls ttl", 4, setMplsTtl.getSetMplsTtlAction().getMplsTtl().intValue());
+        action = mdSalActions.get(4);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.DecMplsTtlCase", action.getImplementedInterface().getName());
+        action = mdSalActions.get(5);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PushVlanActionCase", action.getImplementedInterface().getName());
+        PushVlanActionCase pushVlan = (PushVlanActionCase) action;
+        Assert.assertEquals("Wrong ethertype", 16, pushVlan.getPushVlanAction().getEthernetType().intValue());
+        action = mdSalActions.get(6);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PopVlanActionCase", action.getImplementedInterface().getName());
+        action = mdSalActions.get(7);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PushMplsActionCase", action.getImplementedInterface().getName());
+        PushMplsActionCase pushMpls = (PushMplsActionCase) action;
+        Assert.assertEquals("Wrong ethertype", 17, pushMpls.getPushMplsAction().getEthernetType().intValue());
+        action = mdSalActions.get(8);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PopMplsActionCase", action.getImplementedInterface().getName());
+        PopMplsActionCase popMpls = (PopMplsActionCase) action;
+        Assert.assertEquals("Wrong ethertype", 18, popMpls.getPopMplsAction().getEthernetType().intValue());
+        action = mdSalActions.get(9);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.SetQueueActionCase", action.getImplementedInterface().getName());
+        SetQueueActionCase setQueue = (SetQueueActionCase) action;
+        Assert.assertEquals("Wrong queue-id", 1234, setQueue.getSetQueueAction().getQueueId().intValue());
+        action = mdSalActions.get(10);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.GroupActionCase", action.getImplementedInterface().getName());
+        GroupActionCase groupAction = (GroupActionCase) action;
+        Assert.assertEquals("Wrong group-id", 555, groupAction.getGroupAction().getGroupId().intValue());
+        action = mdSalActions.get(11);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.SetNwTtlActionCase", action.getImplementedInterface().getName());
+        SetNwTtlActionCase setNwTtl = (SetNwTtlActionCase) action;
+        Assert.assertEquals("Wrong nw ttl", 8, setNwTtl.getSetNwTtlAction().getNwTtl().intValue());
+        action = mdSalActions.get(12);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.DecNwTtlCase", action.getImplementedInterface().getName());
+        action = mdSalActions.get(13);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.SetFieldCase", action.getImplementedInterface().getName());
+        SetFieldCase setField = (SetFieldCase) action;
+        Assert.assertEquals("Wrong in port", "openflow:null:1", setField.getSetField().getInPort().getValue());
+        action = mdSalActions.get(14);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PushPbbActionCase", action.getImplementedInterface().getName());
+        PushPbbActionCase pushPbb = (PushPbbActionCase) action;
+        Assert.assertEquals("Wrong ethertype", 19, pushPbb.getPushPbbAction().getEthernetType().intValue());
+        action = mdSalActions.get(15);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.action.types"
+                + ".rev131112.action.action.PopPbbActionCase", action.getImplementedInterface().getName());
+    }
+
+    /**
+     * Test {@link org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.ActionConvertor#convert(java.util.List, org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData)} }
+     */
+    @Test
+    public void testGetActions() {
+        List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list
+                .Action> salActions = new ArrayList<>();
+        org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list
+                .ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+
+        SetVlanPcpActionCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpActionCaseBuilder();
+        SetVlanPcpActionBuilder pcpBuilder = new SetVlanPcpActionBuilder();
+        pcpBuilder.setVlanPcp(new VlanPcp((short) 7));
+        vlanPcpCaseBuilder.setSetVlanPcpAction(pcpBuilder.build());
+        actionBuilder.setAction(vlanPcpCaseBuilder.build());
+        actionBuilder.setOrder(0);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        StripVlanActionCaseBuilder stripCaseBuilder = new StripVlanActionCaseBuilder();
+        StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder();
+        stripCaseBuilder.setStripVlanAction(stripBuilder.build());
+        actionBuilder.setAction(stripCaseBuilder.build());
+        actionBuilder.setOrder(1);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetDlDstActionCaseBuilder dlDstCaseBuilder = new SetDlDstActionCaseBuilder();
+        SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();
+        dlDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));
+        dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());
+        actionBuilder.setAction(dlDstCaseBuilder.build());
+        actionBuilder.setOrder(2);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetDlSrcActionCaseBuilder dlSrcCaseBuilder = new SetDlSrcActionCaseBuilder();
+        SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();
+        dlSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));
+        dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());
+        actionBuilder.setAction(dlSrcCaseBuilder.build());
+        actionBuilder.setOrder(3);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetNwSrcActionCaseBuilder nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();
+        SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();
+        Ipv4Builder ipv4Builder = new Ipv4Builder();
+        /* Correct canonical form for v4 prefix!!! */
+        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.0/24"));
+        nwSrcBuilder.setAddress(ipv4Builder.build());
+        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());
+        actionBuilder.setAction(nwSrcCaseBuilder.build());
+        actionBuilder.setOrder(4);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetNwDstActionCaseBuilder nwDstCaseBuilder = new SetNwDstActionCaseBuilder();
+        SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
+        ipv4Builder = new Ipv4Builder();
+        ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.2/32"));
+        nwDstBuilder.setAddress(ipv4Builder.build());
+        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
+        actionBuilder.setAction(nwDstCaseBuilder.build());
+        actionBuilder.setOrder(5);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetTpSrcActionCaseBuilder tpSrcCaseBuilder = new SetTpSrcActionCaseBuilder();
+        SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
+        tpSrcBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types
+                .rev130715.PortNumber(54));
+        tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
+        actionBuilder.setAction(tpSrcCaseBuilder.build());
+        actionBuilder.setOrder(6);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetTpDstActionCaseBuilder tpDstCaseBuilder = new SetTpDstActionCaseBuilder();
+        SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();
+        tpDstBuilder.setPort(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types
+                .rev130715.PortNumber(45));
+        tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());
+        actionBuilder.setAction(tpDstCaseBuilder.build());
+        actionBuilder.setOrder(7);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetNwTosActionCaseBuilder tosCaseBuilder = new SetNwTosActionCaseBuilder();
+        SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
+        tosBuilder.setTos(16);
+        tosCaseBuilder.setSetNwTosAction(tosBuilder.build());
+        actionBuilder.setAction(tosCaseBuilder.build());
+        actionBuilder.setOrder(8);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        SetVlanIdActionCaseBuilder vlanIdCaseBuilder = new SetVlanIdActionCaseBuilder();
+        SetVlanIdActionBuilder vlanIdBuilder = new SetVlanIdActionBuilder();
+        vlanIdBuilder.setVlanId(new VlanId(22));
+        vlanIdCaseBuilder.setSetVlanIdAction(vlanIdBuilder.build());
+        actionBuilder.setAction(vlanIdCaseBuilder.build());
+        actionBuilder.setOrder(9);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();
+        nwSrcBuilder = new SetNwSrcActionBuilder();
+        Ipv6Builder ipv6Builder = new Ipv6Builder();
+        /* Use canonical form, 00:00:0000 is not a valid v6 notation */
+        ipv6Builder.setIpv6Address(new Ipv6Prefix("::5/128"));
+        nwSrcBuilder.setAddress(ipv6Builder.build());
+        nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());
+        actionBuilder.setAction(nwSrcCaseBuilder.build());
+        actionBuilder.setOrder(10);
+        salActions.add(actionBuilder.build());
+
+        actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112
+                .action.list.ActionBuilder();
+        nwDstCaseBuilder = new SetNwDstActionCaseBuilder();
+        nwDstBuilder = new SetNwDstActionBuilder();
+        ipv6Builder = new Ipv6Builder();
+        /* Use canonical form, 00:00:0006/64 is not a valid v6 notation - this equates to ::/64 */
+        ipv6Builder.setIpv6Address(new Ipv6Prefix("::/64"));
+        nwDstBuilder.setAddress(ipv6Builder.build());
+        nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
+        actionBuilder.setAction(nwDstCaseBuilder.build());
+        actionBuilder.setOrder(11);
+        salActions.add(actionBuilder.build());
+
+        IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProtocol((short) 6);
+        MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());
+        FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());
+        Flow flow = flowBld.build();
+
+        ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_3);
+        data.setDatapathId(new BigInteger("42"));
+        data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow));
+
+        Optional<List<Action>> actionsOptional = convertorManager.convert(salActions, data);
+        List<Action> actions = actionsOptional.orElse(Collections.emptyList());
+
+        Assert.assertEquals("Wrong number of actions", 12, actions.size());
+        Action action = actions.get(0);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        MatchEntry entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);;
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanPcp.class, false);
+        Assert.assertEquals("Wrong vlan pcp", 7, ((VlanPcpCase) entry.getMatchEntryValue()).getVlanPcp().getVlanPcp()
+                .intValue());
+
+        action = actions.get(1);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        setFieldCase =
+          (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid.class, false);
+        Assert.assertEquals("Wrong vlan vid", 0, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().getVlanVid()
+                .intValue());
+        Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid().isCfiBit());
+
+        action = actions.get(2);
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthDst.class, false);
+        Assert.assertEquals("Wrong dl dst", "00:00:00:00:00:06", ((EthDstCase) entry.getMatchEntryValue()).getEthDst()
+                .getMacAddress().getValue());
+
+        action = actions.get(3);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.EthSrc.class, false);
+        Assert.assertEquals("Wrong dl src", "00:00:00:00:00:05", ((EthSrcCase) entry.getMatchEntryValue()).getEthSrc()
+                .getMacAddress().getValue());
+
+        action = actions.get(4);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Src.class, false);
+        Assert.assertEquals("Wrong ipv4 src", "10.0.0.0", ((Ipv4SrcCase) entry.getMatchEntryValue()).getIpv4Src()
+                .getIpv4Address().getValue());
+
+        action = actions.get(5);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv4Dst.class, false);
+        Assert.assertEquals("Wrong ipv4 dst", "10.0.0.2", ((Ipv4DstCase) entry.getMatchEntryValue()).getIpv4Dst()
+                .getIpv4Address().getValue());
+
+        action = actions.get(6);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpSrc.class, false);
+        Assert.assertEquals("Wrong tcp src", 54, ((TcpSrcCase) entry.getMatchEntryValue()).getTcpSrc()
+                .getPort().getValue().intValue());
+
+        action = actions.get(7);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);;
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.TcpDst.class, false);
+        Assert.assertEquals("Wrong tcp dst", 45, ((TcpDstCase) entry.getMatchEntryValue()).getTcpDst()
+                .getPort().getValue().intValue());
+
+        action = actions.get(8);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.IpDscp.class, false);
+        Assert.assertEquals("Wrong ip dscp", 4, ((IpDscpCase) entry.getMatchEntryValue()).getIpDscp()
+                .getDscp().getValue().intValue());
+
+        action = actions.get(9);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.VlanVid.class, false);
+        Assert.assertEquals("Wrong vlan id", 22, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
+                .getVlanVid().intValue());
+        Assert.assertEquals("Wrong cfi bit", true, ((VlanVidCase) entry.getMatchEntryValue()).getVlanVid()
+                .isCfiBit());
+
+        action = actions.get(10);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Src.class, false);
+        Assert.assertEquals("Wrong ipv6 src", "::5",
+                ((Ipv6SrcCase) entry.getMatchEntryValue()).getIpv6Src().getIpv6Address().getValue());
+
+        action = actions.get(11);
+        setFieldCase =
+                (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCase) action.getActionChoice();
+        Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common"
+                + ".action.rev150203.action.grouping.action.choice.SetFieldCase", action.getActionChoice().getImplementedInterface().getName());
+        entry = setFieldCase.getSetFieldAction().getMatchEntry().get(0);
+        checkEntryHeader(entry, org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Ipv6Dst.class, false);
+        Assert.assertEquals("Wrong ipv6 dst", "::",
+                ((Ipv6DstCase) entry.getMatchEntryValue()).getIpv6Dst().getIpv6Address().getValue());
+    }
+
+    private static void checkEntryHeader(MatchEntry entry, Class<? extends MatchField> field, boolean hasMask) {
+        Assert.assertEquals("Wrong oxm class", OpenflowBasicClass.class, entry.getOxmClass());
+        Assert.assertEquals("Wrong oxm field", field, entry.getOxmMatchField());
+        Assert.assertEquals("Wrong hasMask", hasMask, entry.isHasMask());
+    }
+}