Revert "WIP: Bump upstreams" 30/109930/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 14:52:59 +0000 (15:52 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 14:53:28 +0000 (15:53 +0100)
This reverts commit 93fa4f844b0712c35a01f16ec321693557496202. This got
somehow pushed -- that should not have been possible.

Change-Id: I2eacd3a68fc0f3553bb74a75d5d02836b42eaeae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
82 files changed:
applications/arbitratorreconciliation/pom.xml
applications/bulk-o-matic/src/main/java/org/opendaylight/openflowplugin/applications/bulk/o/matic/FlowWriterSequential.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/AbstractListeningCommiter.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/FlowForwarder.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/GroupForwarder.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/ListenerRegistrationHelper.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/MeterForwarder.java
applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/impl/TableForwarder.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java
applications/pom.xml
applications/reconciliation-framework/src/main/java/org/opendaylight/openflowplugin/applications/reconciliation/cli/GetRegisteredServices.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/ReconciliationServiceImpl.java
applications/southbound-cli/src/main/java/org/opendaylight/openflowplugin/applications/southboundcli/cli/Reconciliation.java
applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java
artifacts/pom.xml
distribution/karaf/pom.xml
extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-eric-extensions/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml
extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml
extension/features-extension-aggregator/pom.xml
extension/pom.xml
features-aggregator/features-openflowplugin/pom.xml
features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml
features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml
features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml
features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml
features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml
features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml
features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml
features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml
features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml
features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml
features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml
features-aggregator/odl-openflowplugin-app-topology/pom.xml
features-aggregator/odl-openflowplugin-drop-test/pom.xml
features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml
features-aggregator/odl-openflowplugin-flow-services/pom.xml
features-aggregator/odl-openflowplugin-libraries/pom.xml
features-aggregator/odl-openflowplugin-nsf-model/pom.xml
features-aggregator/odl-openflowplugin-southbound/pom.xml
features-aggregator/pom.xml
libraries/liblldp/src/main/java/org/opendaylight/openflowplugin/libraries/liblldp/Packet.java
libraries/pom.xml
model/pom.xml
openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml
openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml
openflowjava/features-openflowjava-aggregator/pom.xml
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketDecoder.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFDatagramPacketEncoder.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/ServerFacade.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpConnectionInitializer.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/TcpHandler.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/UdpHandler.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/MeterModInputMessageFactory.java
openflowjava/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF13MatchSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/match/MatchDeserializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/deserialization/multipart/MultipartReplyExperimenterDeserializer.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/serialization/match/MatchSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/messages/MeterMessageSerializer.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java
parent/pom.xml
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/LearningSwitchManagerSimpleImpl.java
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/WakeupOnNode.java
samples/learning-switch/src/main/java/org/opendaylight/openflowplugin/learningswitch/multi/LearningSwitchManagerMultiImpl.java
samples/pom.xml
samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/CallableClient.java
samples/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SendEvent.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkGroupTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowPluginBulkTransactionProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestCommandProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java

index 9f090762420389d045711c6731622b75ab5b5588..7dd9e094ea987b957c50b19cc70ce7e10080843b 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index e5694e3f3213db05893ca34e89e84bbdc764a93d..d09d8d0c20279c7df0bd998c4d1a65bfebf79e72 100644 (file)
@@ -23,23 +23,24 @@ import org.slf4j.LoggerFactory;
 
 public class FlowWriterSequential implements FlowCounterMBean {
     private static final Logger LOG = LoggerFactory.getLogger(FlowWriterSequential.class);
-
     private final DataBroker dataBroker;
     private final ExecutorService flowPusher;
+    protected int dpnCount;
     private long startTime;
     private final AtomicInteger writeOpStatus = new AtomicInteger(FlowCounter.OperationStatus.INIT.status());
     private final AtomicInteger countDpnWriteCompletion = new AtomicInteger();
     private final AtomicLong taskCompletionTime = new AtomicLong();
 
-    public FlowWriterSequential(final DataBroker dataBroker, final ExecutorService flowPusher) {
+    public FlowWriterSequential(final DataBroker dataBroker, ExecutorService flowPusher) {
         this.dataBroker = dataBroker;
         this.flowPusher = flowPusher;
         LOG.info("Using Sequential implementation of Flow Writer.");
     }
 
-    public void addFlows(final Integer count, final Integer flowsPerDPN, final int batchSize, final int sleepMillis,
-            final short startTableId, final short endTableId, final boolean isCreateParents) {
+    public void addFlows(Integer count, Integer flowsPerDPN, int batchSize, int sleepMillis, short startTableId,
+            short endTableId, boolean isCreateParents) {
         LOG.info("Using Sequential implementation of Flow Writer.");
+        this.dpnCount = count;
         countDpnWriteCompletion.set(count);
         startTime = System.nanoTime();
         for (int i = 1; i <= count; i++) {
@@ -49,8 +50,8 @@ public class FlowWriterSequential implements FlowCounterMBean {
         }
     }
 
-    public void deleteFlows(final Integer count, final Integer flowsPerDPN, final int batchSize,
-            final short startTableId, final short endTableId) {
+    public void deleteFlows(Integer count, Integer flowsPerDPN, int batchSize, short startTableId,
+            short endTableId) {
         LOG.info("Using Sequential implementation of Flow Writer.");
         countDpnWriteCompletion.set(count);
         for (int i = 1; i <= count; i++) {
@@ -70,7 +71,7 @@ public class FlowWriterSequential implements FlowCounterMBean {
         return taskCompletionTime.get();
     }
 
-    private final class FlowHandlerTask implements Runnable {
+    private class FlowHandlerTask implements Runnable {
         private final String dpId;
         private final int flowsPerDpn;
         private final boolean add;
@@ -84,7 +85,7 @@ public class FlowWriterSequential implements FlowCounterMBean {
                         final int flowsPerDpn,
                         final boolean add,
                         final int batchSize,
-                        final int sleepMillis,
+                        int sleepMillis,
                         final short startTableId,
                         final short endTableId,
                         final boolean isCreateParents) {
@@ -135,8 +136,8 @@ public class FlowWriterSequential implements FlowCounterMBean {
                     MoreExecutors.directExecutor());
         }
 
-        private void addFlowToTx(final WriteTransaction writeTransaction, final String flowId,
-                final InstanceIdentifier<Flow> flowIid, final Flow flow) {
+        private void addFlowToTx(WriteTransaction writeTransaction, String flowId, InstanceIdentifier<Flow> flowIid,
+                Flow flow) {
             if (add) {
                 LOG.trace("Adding flow for flowId: {}, flowIid: {}", flowId, flowIid);
                 if (isCreateParents) {
@@ -156,7 +157,7 @@ public class FlowWriterSequential implements FlowCounterMBean {
 
             private int sourceIp;
 
-            DsCallBack(final String dpId, final int sourceIp, final short tableId) {
+            DsCallBack(String dpId, int sourceIp, short tableId) {
                 this.dpId = dpId;
                 this.sourceIp = sourceIp;
                 short numberA = 1;
@@ -165,7 +166,7 @@ public class FlowWriterSequential implements FlowCounterMBean {
             }
 
             @Override
-            public void onSuccess(final Object notUsed) {
+            public void onSuccess(Object notUsed) {
                 if (sourceIp > flowsPerDpn) {
                     long dur = System.nanoTime() - startTime;
                     LOG.info("Completed all flows installation for: dpid: {}, tableId: {}, sourceIp: {} in {}ns", dpId,
@@ -213,7 +214,7 @@ public class FlowWriterSequential implements FlowCounterMBean {
             }
 
             @Override
-            public void onFailure(final Throwable error) {
+            public void onFailure(Throwable error) {
                 LOG.error("Error: {} in Datastore write operation: dpid: {}, tableId: {}, sourceIp: {}", error, dpId,
                         tableId, sourceIp);
                 writeOpStatus.set(FlowCounter.OperationStatus.FAILURE.status());
index e638febbbca40553f86e0fc45b5c60285ac7ae79..731232da9a71f552e1fa6ffca14518d5cafc4b88 100644 (file)
@@ -14,6 +14,7 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Collection;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
@@ -36,19 +37,19 @@ import org.slf4j.LoggerFactory;
  */
 public abstract class AbstractListeningCommiter<T extends DataObject>
         implements ForwardingRulesCommiter<T>, RecoverableListener {
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractListeningCommiter.class);
 
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractListeningCommiter.class);
     final ForwardingRulesManager provider;
     NodeConfigurator nodeConfigurator;
     protected final DataBroker dataBroker;
-    private final ListenerRegistrationHelper registrationHelper;
-    private ListenerRegistration<AbstractListeningCommiter> listenerRegistration;
+    protected final ListenerRegistrationHelper registrationHelper;
+    protected ListenerRegistration<AbstractListeningCommiter> listenerRegistration;
 
     @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "See FIXME below")
     protected AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker,
                                      final ListenerRegistrationHelper registrationHelper) {
         this.provider = requireNonNull(provider, "ForwardingRulesManager can not be null!");
-        nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!");
+        this.nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!");
         this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!");
         this.registrationHelper = requireNonNull(registrationHelper, "registrationHelper can not be null!");
 
@@ -88,22 +89,24 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
                                     IllegalArgumentException("Unhandled modification type "
                                     + mod.getModificationType());
                     }
-                } else if (provider.isStaleMarkingEnabled()) {
-                    LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities",
-                            nodeIdent.toString());
-                    // Switch is NOT connected
-                    switch (mod.getModificationType()) {
-                        case DELETE:
-                            createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent);
-                            break;
-                        case SUBTREE_MODIFIED:
-                            break;
-                        case WRITE:
-                            break;
-                        default:
-                            throw new
-                                    IllegalArgumentException("Unhandled modification type "
-                                    + mod.getModificationType());
+                } else {
+                    if (provider.isStaleMarkingEnabled()) {
+                        LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities",
+                                nodeIdent.toString());
+                        // Switch is NOT connected
+                        switch (mod.getModificationType()) {
+                            case DELETE:
+                                createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent);
+                                break;
+                            case SUBTREE_MODIFIED:
+                                break;
+                            case WRITE:
+                                break;
+                            default:
+                                throw new
+                                        IllegalArgumentException("Unhandled modification type "
+                                        + mod.getModificationType());
+                        }
                     }
                 }
             } catch (RuntimeException e) {
@@ -114,33 +117,22 @@ public abstract class AbstractListeningCommiter<T extends DataObject>
 
     @Override
     public final void registerListener() {
-        Futures.addCallback(registrationHelper.checkedRegisterListener(
-            DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()), this),
-            new FutureCallback<ListenerRegistration<AbstractListeningCommiter>>() {
-                @Override
-                public void onSuccess(final ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
-                    LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
-                    listenerRegistration = flowListenerRegistration;
-                }
-
-                @Override
-                public void onFailure(final Throwable throwable) {
-                    LOG.error("Registration failed ", throwable);
-                }
-            }, MoreExecutors.directExecutor());
-    }
-
-    @Override
-    public void deregisterListener() {
-        close();
-    }
+        final DataTreeIdentifier<T> treeId =
+                DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath());
+        Futures.addCallback(registrationHelper.checkedRegisterListener(treeId, this),
+                new FutureCallback<ListenerRegistration<AbstractListeningCommiter>>() {
+                    @Override
+                    public void onSuccess(
+                            @Nullable final ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
+                        LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
+                        listenerRegistration = flowListenerRegistration;
+                    }
 
-    @Override
-    public void close() {
-        if (listenerRegistration != null) {
-            listenerRegistration.close();
-            listenerRegistration = null;
-        }
+                    @Override
+                    public void onFailure(final Throwable throwable) {
+                        LOG.error("Registration failed ", throwable);
+                    }
+                }, MoreExecutors.directExecutor());
     }
 
     /**
index 6ff32f3089242bcef2f60886aa850a0f4d5dd90a..6b237623548778bde0c2fce9b364725f3cf95f07 100644 (file)
@@ -60,6 +60,7 @@ 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.openflowplugin.extension.onf.rev170124.BundleId;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -76,12 +77,32 @@ import org.slf4j.LoggerFactory;
  * {@link org.opendaylight.mdsal.binding.api.DataTreeModification}.
  */
 public class FlowForwarder extends AbstractListeningCommiter<Flow> {
+
     private static final Logger LOG = LoggerFactory.getLogger(FlowForwarder.class);
+
     private static final String GROUP_EXISTS_IN_DEVICE_ERROR = "GROUPEXISTS";
 
+    private ListenerRegistration<FlowForwarder> listenerRegistration;
+
+    private final BundleFlowForwarder bundleFlowForwarder;
+
     public FlowForwarder(final ForwardingRulesManager manager, final DataBroker db,
                          final ListenerRegistrationHelper registrationHelper) {
         super(manager, db, registrationHelper);
+        bundleFlowForwarder = new BundleFlowForwarder(manager);
+    }
+
+    @Override
+    public  void deregisterListener() {
+        close();
+    }
+
+    @Override
+    public void close() {
+        if (listenerRegistration != null) {
+            listenerRegistration.close();
+            listenerRegistration = null;
+        }
     }
 
     @Override
index 7fe5f8fc932e814f3fd0e6a106aa1e8b98e9f578..9b65c0374ba471d13623aad372380d95399f5bd0 100644 (file)
@@ -44,6 +44,7 @@ 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.openflowplugin.extension.onf.rev170124.BundleId;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -58,11 +59,29 @@ import org.slf4j.LoggerFactory;
  * {@link org.opendaylight.mdsal.binding.api.DataTreeModification}.
  */
 public class GroupForwarder extends AbstractListeningCommiter<Group> {
+
     private static final Logger LOG = LoggerFactory.getLogger(GroupForwarder.class);
+    private ListenerRegistration<GroupForwarder> listenerRegistration;
+
+    private final BundleGroupForwarder bundleGroupForwarder;
 
     public GroupForwarder(final ForwardingRulesManager manager, final DataBroker db,
                           final ListenerRegistrationHelper registrationHelper) {
         super(manager, db, registrationHelper);
+        this.bundleGroupForwarder = new BundleGroupForwarder(manager);
+    }
+
+    @Override
+    public  void deregisterListener() {
+        close();
+    }
+
+    @Override
+    public void close() {
+        if (listenerRegistration != null) {
+            listenerRegistration.close();
+            listenerRegistration = null;
+        }
     }
 
     @Override
@@ -90,7 +109,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
                         .build();
 
                 final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture =
-                    provider.getSalGroupService()
+                    this.provider.getSalGroupService()
                             .removeGroup(removeGroup);
                 Futures.addCallback(resultFuture,
                     new RemoveGroupCallBack(removeDataObj.getGroupId().getValue(), nodeId),
@@ -112,7 +131,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
         builder.setGroupRef(new GroupRef(identifier));
         builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        return provider.getSalGroupService().removeGroup(builder.build());
+        return this.provider.getSalGroupService().removeGroup(builder.build());
     }
 
     @Override
@@ -133,7 +152,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
                 builder.setUpdatedGroup(new UpdatedGroupBuilder(updatedGroup).build());
                 builder.setOriginalGroup(new OriginalGroupBuilder(originalGroup).build());
                 UpdateGroupInput updateGroupInput = builder.build();
-                final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture = provider.getSalGroupService()
+                final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture = this.provider.getSalGroupService()
                         .updateGroup(updateGroupInput);
                 LoggingFutures.addErrorLogging(resultFuture, LOG, "updateGroup");
                 Futures.addCallback(resultFuture,
@@ -161,7 +180,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
                         builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
                         AddGroupInput addGroupInput = builder.build();
                         final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture;
-                        resultFuture = provider.getSalGroupService().addGroup(addGroupInput);
+                        resultFuture = this.provider.getSalGroupService().addGroup(addGroupInput);
                         Futures.addCallback(resultFuture,
                                 new AddGroupCallBack(addGroupInput.getGroupId().getValue(), nodeId),
                                 MoreExecutors.directExecutor());
@@ -171,21 +190,21 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
     }
 
     @Override
-    public void createStaleMarkEntity(final InstanceIdentifier<Group> identifier, final Group del,
-            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    public void createStaleMarkEntity(InstanceIdentifier<Group> identifier, Group del,
+            InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.debug("Creating Stale-Mark entry for the switch {} for Group {} ", nodeIdent, del);
         StaleGroup staleGroup = makeStaleGroup(identifier, del, nodeIdent);
         persistStaleGroup(staleGroup, nodeIdent);
 
     }
 
-    private static StaleGroup makeStaleGroup(final InstanceIdentifier<Group> identifier, final Group del,
-            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    private static StaleGroup makeStaleGroup(InstanceIdentifier<Group> identifier, Group del,
+            InstanceIdentifier<FlowCapableNode> nodeIdent) {
         StaleGroupBuilder staleGroupBuilder = new StaleGroupBuilder(del);
         return staleGroupBuilder.setGroupId(del.getGroupId()).build();
     }
 
-    private void persistStaleGroup(final StaleGroup staleGroup, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    private void persistStaleGroup(StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleGroupInstanceIdentifier(staleGroup, nodeIdent),
                 staleGroup);
@@ -194,15 +213,15 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         handleStaleGroupResultFuture(submitFuture);
     }
 
-    private static void handleStaleGroupResultFuture(final FluentFuture<?> submitFuture) {
+    private static void handleStaleGroupResultFuture(FluentFuture<?> submitFuture) {
         submitFuture.addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(final Object result) {
+            public void onSuccess(Object result) {
                 LOG.debug("Stale Group creation success");
             }
 
             @Override
-            public void onFailure(final Throwable throwable) {
+            public void onFailure(Throwable throwable) {
                 LOG.error("Stale Group creation failed", throwable);
             }
         }, MoreExecutors.directExecutor());
@@ -210,7 +229,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group
         .types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(
-            final StaleGroup staleGroup, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId())));
     }
 
@@ -224,7 +243,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(final RpcResult<AddGroupOutput> result) {
+        public void onSuccess(RpcResult<AddGroupOutput> result) {
             if (result.isSuccessful()) {
                 provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 LOG.debug("Group add with id {} finished without error for node {}", groupId, nodeId);
@@ -235,7 +254,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onFailure(final Throwable throwable) {
+        public void onFailure(Throwable throwable) {
             LOG.error("Service call for adding group {} failed for node with error {}", groupId, nodeId, throwable);
         }
     }
@@ -250,7 +269,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(final RpcResult<UpdateGroupOutput> result) {
+        public void onSuccess(RpcResult<UpdateGroupOutput> result) {
             if (result.isSuccessful()) {
                 provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
                 LOG.debug("Group update with id {} finished without error for node {}", groupId, nodeId);
@@ -261,7 +280,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onFailure(final Throwable throwable) {
+        public void onFailure(Throwable throwable) {
             LOG.error("Service call for updating group {} failed for node {} with", groupId, nodeId,
                     throwable);
         }
@@ -277,7 +296,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onSuccess(final RpcResult<RemoveGroupOutput> result) {
+        public void onSuccess(RpcResult<RemoveGroupOutput> result) {
             if (result.isSuccessful()) {
                 LOG.debug("Group remove with id {} finished without error for node {}", groupId, nodeId);
                 provider.getDevicesGroupRegistry().removeGroup(nodeId, groupId);
@@ -288,7 +307,7 @@ public class GroupForwarder extends AbstractListeningCommiter<Group> {
         }
 
         @Override
-        public void onFailure(final Throwable throwable) {
+        public void onFailure(Throwable throwable) {
             LOG.error("Service call for removing group {} failed for node with error {}", groupId, nodeId, throwable);
         }
     }
index 9410feae01261884371fc849b5ecbf80a1cfb4d2..e01c3cd43492bf5c543d24b9c20c8ccceff2d2c8 100644 (file)
@@ -30,6 +30,7 @@ public class ListenerRegistrationHelper {
     private static final Logger LOG = LoggerFactory.getLogger(ListenerRegistrationHelper.class);
     private static final long INVENTORY_CHECK_TIMER = 1;
 
+    private final String operational = "OPERATIONAL";
     private final ListeningExecutorService listeningExecutorService;
     private final DataBroker dataBroker;
 
@@ -46,9 +47,9 @@ public class ListenerRegistrationHelper {
 
     public <T extends DataObject, L extends ClusteredDataTreeChangeListener<T>>
             ListenableFuture<ListenerRegistration<L>> checkedRegisterListener(
-                final DataTreeIdentifier<T> treeId, final L listener) {
+                DataTreeIdentifier<T> treeId, L listener) {
         return listeningExecutorService.submit(() -> {
-            while (!getInventoryConfigDataStoreStatus().equals("OPERATIONAL")) {
+            while (!getInventoryConfigDataStoreStatus().equals(operational)) {
                 try {
                     LOG.debug("Retrying for datastore to become operational for listener {}", listener);
                     Thread.sleep(INVENTORY_CHECK_TIMER * 1000);
index 9c437f7f3f0d64eac9918a97c51545b1cddc90c0..ecf18514a3dffe0e706f3c583ef49c8921a80109 100644 (file)
@@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory;
  *
  */
 public class MeterForwarder extends AbstractListeningCommiter<Meter> {
+
     private static final Logger LOG = LoggerFactory.getLogger(MeterForwarder.class);
 
     public MeterForwarder(final ForwardingRulesManager manager, final DataBroker db,
@@ -55,6 +56,19 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         super(manager, db, listenerRegistrationHelper);
     }
 
+    @Override
+    public void deregisterListener() {
+        close();
+    }
+
+    @Override
+    public void close() {
+        if (listenerRegistration != null) {
+            listenerRegistration.close();
+            listenerRegistration = null;
+        }
+    }
+
     @Override
     protected InstanceIdentifier<Meter> getWildCardPath() {
         return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
@@ -71,7 +85,7 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         builder.setMeterRef(new MeterRef(identifier));
         builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
 
-        LoggingFutures.addErrorLogging(provider.getSalMeterService().removeMeter(builder.build()), LOG,
+        LoggingFutures.addErrorLogging(this.provider.getSalMeterService().removeMeter(builder.build()), LOG,
             "removeMeter");
     }
 
@@ -84,7 +98,7 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
         builder.setMeterRef(new MeterRef(identifier));
         builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        return provider.getSalMeterService().removeMeter(builder.build());
+        return this.provider.getSalMeterService().removeMeter(builder.build());
     }
 
     @Override
@@ -99,7 +113,7 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         builder.setUpdatedMeter(new UpdatedMeterBuilder(update).build());
         builder.setOriginalMeter(new OriginalMeterBuilder(original).build());
 
-        LoggingFutures.addErrorLogging(provider.getSalMeterService().updateMeter(builder.build()), LOG,
+        LoggingFutures.addErrorLogging(this.provider.getSalMeterService().updateMeter(builder.build()), LOG,
             "updateMeter");
     }
 
@@ -112,23 +126,23 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
         builder.setMeterRef(new MeterRef(identifier));
         builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
-        return provider.getSalMeterService().addMeter(builder.build());
+        return this.provider.getSalMeterService().addMeter(builder.build());
     }
 
     @Override
-    public void createStaleMarkEntity(final InstanceIdentifier<Meter> identifier, final Meter del,
-            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    public void createStaleMarkEntity(InstanceIdentifier<Meter> identifier, Meter del,
+            InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.debug("Creating Stale-Mark entry for the switch {} for meter {} ", nodeIdent, del);
         StaleMeter staleMeter = makeStaleMeter(del);
         persistStaleMeter(staleMeter, nodeIdent);
     }
 
-    private static StaleMeter makeStaleMeter(final Meter del) {
+    private static StaleMeter makeStaleMeter(Meter del) {
         StaleMeterBuilder staleMeterBuilder = new StaleMeterBuilder(del);
         return staleMeterBuilder.setMeterId(del.getMeterId()).build();
     }
 
-    private void persistStaleMeter(final StaleMeter staleMeter, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    private void persistStaleMeter(StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
         WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
         writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleMeterInstanceIdentifier(staleMeter, nodeIdent),
                 staleMeter);
@@ -137,15 +151,15 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
         handleStaleMeterResultFuture(submitFuture);
     }
 
-    private static void handleStaleMeterResultFuture(final FluentFuture<?> submitFuture) {
+    private static void handleStaleMeterResultFuture(FluentFuture<?> submitFuture) {
         submitFuture.addCallback(new FutureCallback<Object>() {
             @Override
-            public void onSuccess(final Object result) {
+            public void onSuccess(Object result) {
                 LOG.debug("Stale Meter creation success");
             }
 
             @Override
-            public void onFailure(final Throwable throwable) {
+            public void onFailure(Throwable throwable) {
                 LOG.error("Stale Meter creation failed", throwable);
             }
         }, MoreExecutors.directExecutor());
@@ -153,7 +167,7 @@ public class MeterForwarder extends AbstractListeningCommiter<Meter> {
 
     private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819
         .meters.StaleMeter> getStaleMeterInstanceIdentifier(
-            final StaleMeter staleMeter, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+            StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
     }
 }
index b2ff5f0ac5e0d700e82a84690a6a90192bc0ffa2..ebfb2ae744c6f7c1b385ba1be65d33f1cab9c257 100644 (file)
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class TableForwarder extends AbstractListeningCommiter<TableFeatures> {
+
     private static final Logger LOG = LoggerFactory.getLogger(TableForwarder.class);
 
     public TableForwarder(final ForwardingRulesManager manager, final DataBroker db,
@@ -36,6 +37,19 @@ public class TableForwarder extends AbstractListeningCommiter<TableFeatures> {
         super(manager, db, registrationHelper);
     }
 
+    @Override
+    public  void deregisterListener() {
+        close();
+    }
+
+    @Override
+    public void close() {
+        if (listenerRegistration != null) {
+            listenerRegistration.close();
+            listenerRegistration = null;
+        }
+    }
+
     @Override
     protected InstanceIdentifier<TableFeatures> getWildCardPath() {
         return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
@@ -80,11 +94,11 @@ public class TableForwarder extends AbstractListeningCommiter<TableFeatures> {
             .build());
         LOG.debug("Invoking SalTableService ");
 
-        if (provider.getSalTableService() != null) {
-            LOG.debug(" Handle to SalTableServices {}", provider.getSalTableService());
+        if (this.provider.getSalTableService() != null) {
+            LOG.debug(" Handle to SalTableServices {}", this.provider.getSalTableService());
         }
 
-        LoggingFutures.addErrorLogging(provider.getSalTableService().updateTable(builder.build()), LOG,
+        LoggingFutures.addErrorLogging(this.provider.getSalTableService().updateTable(builder.build()), LOG,
             "updateTable");
     }
 
@@ -95,14 +109,14 @@ public class TableForwarder extends AbstractListeningCommiter<TableFeatures> {
     }
 
     @Override
-    public void createStaleMarkEntity(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures del,
-            final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    public void createStaleMarkEntity(InstanceIdentifier<TableFeatures> identifier, TableFeatures del,
+            InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.debug("NO-OP");
     }
 
     @Override
-    public Future<? extends RpcResult<?>> removeWithResult(final InstanceIdentifier<TableFeatures> identifier,
-            final TableFeatures del, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
+    public Future<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<TableFeatures> identifier,
+            TableFeatures del, InstanceIdentifier<FlowCapableNode> nodeIdent) {
         return null;
     }
 }
index 7e7e0d90b0c57c218852b2296a6a5b716d166318..d954cf2129263e86fbb59c2183036dfb45c49413 100644 (file)
@@ -100,9 +100,11 @@ import org.slf4j.LoggerFactory;
  * Execute CRUD API for flow + group + meter involving flat-batch strategy.
  */
 public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy {
+
     private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyFlatBatchImpl.class);
 
-    private SalFlatBatchService flatBatchService = null;
+    private SalFlatBatchService flatBatchService;
+    private TableForwarder tableForwarder;
 
     @Override
     public ListenableFuture<RpcResult<Void>> executeSyncStrategy(ListenableFuture<RpcResult<Void>> resultVehicle,
@@ -480,8 +482,8 @@ public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy {
         return this;
     }
 
-    @Deprecated(since = "0.17.2", forRemoval = true)
     public SyncPlanPushStrategyFlatBatchImpl setTableForwarder(final TableForwarder tableForwarder) {
+        this.tableForwarder = tableForwarder;
         return this;
     }
 }
index 8299322df7f54e659b3a09c5d70f1762a254f48a..da2117120f17711f16eee157436f27bfaa3e8c1d 100644 (file)
@@ -55,11 +55,13 @@ import org.slf4j.LoggerFactory;
  * Execute CRUD API for flow + group + meter involving one-by-one (incremental) strategy.
  */
 public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy {
+
     private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyIncrementalImpl.class);
 
     private FlowForwarder flowForwarder;
     private MeterForwarder meterForwarder;
     private GroupForwarder groupForwarder;
+    private TableForwarder tableForwarder;
     private FlowCapableTransactionService transactionService;
 
     @Override
@@ -73,37 +75,59 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
         // TODO enable table-update when ready
         //resultVehicle = updateTableFeatures(nodeIdent, configTree);
 
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters),
-            MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+                //final ListenableFuture<RpcResult<Void>> singleVoidUpdateResult = Futures.transform(
+                //        Futures.asList Arrays.asList(input, output),
+                //        ReconcileUtil.<UpdateFlowOutput>createRpcResultCondenser("TODO"));
+            // }
+            return addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingGroups"),
-            MoreExecutors.directExecutor());
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+            // }
+            return addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingMeters"),
-            MoreExecutors.directExecutor());
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+            // }
+            return addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingFlows"),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
+
 
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters),
-            MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+            // }
+            return removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantFlows"),
-            MoreExecutors.directExecutor());
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+            // }
+            return removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantMeters"),
-            MoreExecutors.directExecutor());
-        resultVehicle = Futures.transformAsync(resultVehicle,
-            input -> removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
+        resultVehicle = Futures.transformAsync(resultVehicle, input -> {
+            // if (!input.isSuccessful()) {
+                //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
+            // }
+            return removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters);
+        }, MoreExecutors.directExecutor());
         Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantGroups"),
-            MoreExecutors.directExecutor());
+                MoreExecutors.directExecutor());
         return resultVehicle;
     }
 
@@ -459,8 +483,8 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
         return this;
     }
 
-    @Deprecated(since = "0.17.2", forRemoval = true)
     public SyncPlanPushStrategyIncrementalImpl setTableForwarder(final TableForwarder tableForwarder) {
+        this.tableForwarder = tableForwarder;
         return this;
     }
 
@@ -479,4 +503,5 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
         this.transactionService = transactionService;
         return this;
     }
+
 }
index 25661a3b7ddc88461bb58c6df2b94f8885ebc9a4..43281973e9aa6e6713b95027ab3f7f9c74355394 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 07f4a6c0b727eb350fa5d9411e0e820aa071ad13..ae0161edc553ad0df90f01376bb3aa340381bc64 100644 (file)
@@ -17,17 +17,17 @@ import org.opendaylight.openflowplugin.applications.reconciliation.Reconciliatio
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@Command(scope = "reconciliation", name = "getRegisteredServices", description = "displaying services registered to "
+        + "Reconciliation Framework")
 /*
- * CLI to display the service priority, service name and service status
- * FIXME: service status
+ * CLI to display the service priority, service name and service status TODO
+ * service status
  */
-@Command(scope = "reconciliation", name = "getRegisteredServices",
-    description = "displaying services registered to Reconciliation Framework")
 public class GetRegisteredServices extends OsgiCommandSupport {
     private static final Logger LOG = LoggerFactory.getLogger(GetRegisteredServices.class);
     private static final String CLI_FORMAT = "%d %-20s ";
 
-    private ReconciliationManager reconciliationManager = null;
+    private ReconciliationManager reconciliationManager;
 
     public void setReconciliationManager(final ReconciliationManager reconciliationManager) {
         this.reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager can not be null!");
index 6a9118eb6a23c43d39df2686fb315364bbb8d2fd..fb00d4e0842dae27a56982655620e080ec5d7c22 100644 (file)
@@ -70,9 +70,10 @@ public class ReconciliationServiceImpl implements ReconciliationService, AutoClo
     private final FrmReconciliationService frmReconciliationService;
     private final AlarmAgent alarmAgent;
     private final NodeListener nodeListener;
+    private final int threadPoolSize = 10;
     private final Map<String, ReconciliationState> reconciliationStates;
 
-    private ExecutorService executor = Executors.newWorkStealingPool(10);
+    private ExecutorService executor = Executors.newWorkStealingPool(threadPoolSize);
 
     public ReconciliationServiceImpl(final DataBroker broker, final FrmReconciliationService frmReconciliationService,
                                      final AlarmAgent alarmAgent, final NodeListener nodeListener,
index de09ed3635939ef20efc45f95a9dcc62e790e991..5a9cf4a21feacdbecc7d7e0d456ce37f0eabf879 100644 (file)
@@ -28,9 +28,9 @@ import org.slf4j.LoggerFactory;
 
 @Command(scope = "openflow", name = "reconcile", description = "Launch reconciliation for openflow nodes")
 public class Reconciliation extends OsgiCommandSupport {
-    private static final Logger LOG = LoggerFactory.getLogger(Reconciliation.class);
 
-    private ReconciliationService reconciliationService = null;
+    private static final Logger LOG = LoggerFactory.getLogger(Reconciliation.class);
+    private ReconciliationService reconciliationService;
 
     public void setReconciliationService(final ReconciliationService reconciliationService) {
         this.reconciliationService = reconciliationService;
index 35bdd55f8d40380d3d5ad0dc91450c20f5572b91..b0594925e54bf7673fe5c136def48369d246921e 100644 (file)
@@ -43,9 +43,8 @@ public class FlowCapableTopologyProvider implements ClusterSingletonService, Aut
     private final NotificationService notificationService;
     private final OperationProcessor processor;
     private final ClusterSingletonServiceProvider clusterSingletonServiceProvider;
-
     private InstanceIdentifier<Topology> topologyPathIID;
-    private TransactionChainManager transactionChainManager = null;
+    private TransactionChainManager transactionChainManager;
     private Registration listenerRegistration;
     private ClusterSingletonServiceRegistration singletonServiceRegistration;
 
index 198717a4989cfacb5b102eba79d86486b3788d4b..6cd9de214212de3b32ef8b6b18e8b3a212dc4923 100644 (file)
@@ -13,7 +13,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
     <relativePath/>
   </parent>
 
index fb73dcafe689281c54b87a073e5f560cd5724e0c..df9f4b70acf452001fcf949a50e34aea8ead224c 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
   </parent>
   <groupId>org.opendaylight.openflowplugin</groupId>
   <artifactId>openflowplugin-karaf</artifactId>
index 1418697767b72b9d5a97fb67accd8c71b7b2ffaf..438a6d75c9514a14544938b1cc02da0abceccede 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index e1561fe1b68cc4d51cc098c18b6bff6b3a8df8bf..1881641148d86e292da8181d5d004c391cea6003 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 93f8ee3983048dc61a2742dff8427a452c129fe3..be346b9a0360a596cd1cc5faa1728d68f73f8b8c 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index d9cad742a4675943709d2fa2a2eaaa9e1220f086..a4973e80204ad8bae2c83561ad48cfcfe8b9a8a4 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index d7c6c05cb1af5dd05509d4fdfe45824da104bb35..e38569f7a740f5ea3aeb0e25ab66a05a423544c3 100644 (file)
@@ -3,7 +3,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
     <modelVersion>4.0.0</modelVersion>
index 2b5828f8e7fd4ad183c19803d10f0c787ff99078..27cfc01925391ae5c0cde8bc673928e69fce69ce 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 872fe47be84384992f68bbcd0667a5dd5f4e75a8..fa3212ee1aa027aad98b410de4f8fcc31bd6ffa7 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 8244e3cf541587a0b08601d85e8852c1664bf739..18a1cc87a5edb1484ccce600196e9fa00f6d2f35 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 1a8f8d836080d71cfb44fe7c7a05aa3145b70e46..0314f1f368b2037467667ba08da153e34fb96d7e 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index a32746e730aff6ab9b2617bf61826cbfa8a5d111..7c6f6460ec29aa4fd6396ea6871ba5912a031dab 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 8f780eb55d093e4d49ecfa8665764ac809033bf6..752cf3432dcdfd106b3535418bc946fee6c35d48 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 7bfc17d876ae4c16c72699775436badbc96bcdec..2e2eedf0da8921162065ac8818ffcd7c2be90db9 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 6adef19ac58913db3789a2bf22a1d2638abef197..f6fe877fee2700bf484345d4b987476724a6e1a4 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index b60d133bc4df6eb2da9be743b1447588b2cf06bf..7a40042c206505e385ef0d107d0acddd922d1b46 100644 (file)
@@ -4,7 +4,7 @@
 <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
     <relativePath/>
 </parent>
 
index 587e0489a1ed42a31696086e510a18c25d6f73ae..452d9ba81bd1835c339656a788e1145c5fccdc10 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index d2c6cbf276a9a998ab5bcac5dfb347b205c2972a..ca2641ee1618a7a22b0796181e9c3c546fcc9e8d 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 6a322cc7a6d1648e07d325e54bf485d0bea25923..038c771c37b296fde59d07fdfddb1df253594ea4 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index c17311638ce49ff9a986ed2342829b9321c50eb9..69fe489daa3775cc3ddb5d10043bf6e828427e17 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 39763300c607b7a80d12969c2cd1bb136c6064ef..6e5a0531d9117a9a4915046990cb92b00299e98e 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index f704bbf7cd2a7560ac77ba7e91cc02918f5fbba9..49c3bc043c69b195267bd6070f330b4b4a0afaab 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 49f5518fae68903553b889a72f80bafc382b5f36..4724d0ba57702803f2bb8999c43bd267f0b67d53 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
@@ -21,7 +21,7 @@
             <dependency>
                 <groupId>org.opendaylight.netconf</groupId>
                 <artifactId>netconf-artifacts</artifactId>
-                <version>6.0.6-SNAPSHOT</version>
+                <version>6.0.5</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 5cecf01b06c3b674bdf2190416c5bb796dd58183..2ec32bbd3243f26f2a645f306088cf75d9d58825 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 22b43252dc0b21771f64a13730ce3327f20df65e..52eef7226b3c276bd33ce7265b1b37724312aa2a 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index c060fcd04886996241f351306266b13c661b5812..b0bba32570b0cda50c920a8c4689f3c598b03e83 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
@@ -21,7 +21,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>12.0.4</version>
+                <version>12.0.3</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -30,7 +30,7 @@
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>8.0.3</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 6ba07905058e054f37a3636f4adeeedbfd9431da..f036369bbb3f075d934d53b080d05f6e10080c3d 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>8.0.3</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>6.0.5</version>
+                <version>6.0.4</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 9c8ac8bbbd4c49ebd680cb6c2cd68de8a6a09802..eb7b9b374b4bc128d12b4070a4a6b552db5b8a79 100644 (file)
@@ -4,7 +4,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index e17d955dc7c495c3b48dc1148423176090e67d93..2822b2736f1d765ec0310a60d58df4f98022099a 100644 (file)
@@ -22,10 +22,11 @@ import org.slf4j.LoggerFactory;
  * deserialize.
  */
 public abstract class Packet {
+
     private static final Logger LOG = LoggerFactory.getLogger(Packet.class);
 
     // Access level granted to this packet
-    protected final boolean writeAccess;
+    protected boolean writeAccess;
 
     // When deserialized from wire, packet could result corrupted
     protected boolean corrupted;
@@ -98,8 +99,8 @@ public abstract class Packet {
         for (Entry<String, Pair<Integer, Integer>> pairs : hdrFieldCoordMap
                 .entrySet()) {
             String hdrField = pairs.getKey();
-            startOffset = bitOffset + getfieldOffset(hdrField);
-            numBits = getfieldnumBits(hdrField);
+            startOffset = bitOffset + this.getfieldOffset(hdrField);
+            numBits = this.getfieldnumBits(hdrField);
 
             byte[] hdrFieldBytes;
             try {
@@ -113,7 +114,7 @@ public abstract class Packet {
              * Store the raw read value, checks the payload type and set the
              * payloadClass accordingly
              */
-            setHeaderField(hdrField, hdrFieldBytes);
+            this.setHeaderField(hdrField, hdrFieldBytes);
 
             if (LOG.isTraceEnabled()) {
                 LOG.trace("{}: {}: {} (offset {} bitsize {})", this.getClass().getSimpleName(), hdrField,
@@ -164,7 +165,7 @@ public abstract class Packet {
         int payloadSize = payloadBytes == null ? 0 : payloadBytes.length;
 
         // Allocate the buffer to contain the full (header + payload) packet
-        int headerSize = getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE;
+        int headerSize = this.getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE;
         byte[] packetBytes = new byte[headerSize + payloadSize];
         if (payloadBytes != null) {
             System.arraycopy(payloadBytes, 0, packetBytes, headerSize, payloadSize);
@@ -302,7 +303,7 @@ public abstract class Packet {
      * @param bytes The raw payload as byte array
      */
     public void setRawPayload(final byte[] bytes) {
-        rawPayload = Arrays.copyOf(bytes, bytes.length);
+        this.rawPayload = Arrays.copyOf(bytes, bytes.length);
     }
 
     /**
@@ -325,7 +326,7 @@ public abstract class Packet {
         final int prime = 31;
         int result = super.hashCode();
         result = prime * result
-                + (hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode());
+                + (this.hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode());
         return result;
     }
 
index b4c4f6c3540837a0de63bfaf040ec70b4f9fce36..9919ea106e902de73978625bea0ed10568a3f805 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index 7aaed7278dbe41948ada5a71f4d15dd4f84455a7..e7b992ec9f7efa6548e88b23e652e542fa4fbf2d 100644 (file)
@@ -6,7 +6,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
     <relativePath/>
   </parent>
 
index 7d5223366bc5d5ffc64229cb2807fe04618b7bff..d740ce8d763333bf51287754286643355932c70d 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
     <relativePath/>
   </parent>
 
index 2dd8540260cda017a256accb64f0e7eb51f0b85d..e7c77248fae59f0d0aed760427ead010b580f21b 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
@@ -33,7 +33,7 @@
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>6.0.5</version>
+                <version>6.0.4</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -42,7 +42,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>11.0.5</version>
+                <version>11.0.4</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
@@ -51,7 +51,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>12.0.4</version>
+                <version>12.0.3</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index 6e274bb4ce01b4ec98faf094fe54fb8302038474..5f31add01247eb02868ff3581fc89e3e572237ea 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>13.0.10</version>
+    <version>13.0.7</version>
     <relativePath/>
   </parent>
 
index fd2086b0edcef5a2848788fcdce5fd50f4b60809..3fa1ef506e390d32237aac31b374ba9e5f6fd6a8 100644 (file)
@@ -23,9 +23,9 @@ import org.slf4j.LoggerFactory;
  * @author michal.polkorab
  */
 public class OFDatagramPacketDecoder extends SimpleChannelInboundHandler<VersionMessageUdpWrapper> {
-    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketDecoder.class);
 
-    private DeserializationFactory deserializationFactory = null;
+    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketDecoder.class);
+    private DeserializationFactory deserializationFactory;
 
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
index 573973cfce4c68d8af0197b2458b3cdb881c3778..f4f7f97dfa54d737adf657e0d95ffd2bcbe621c4 100644 (file)
@@ -26,9 +26,9 @@ import org.slf4j.LoggerFactory;
  * @author michal.polkorab
  */
 public class OFDatagramPacketEncoder extends MessageToMessageEncoder<UdpMessageListenerWrapper> {
-    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketEncoder.class);
 
-    private SerializationFactory serializationFactory = null;
+    private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketEncoder.class);
+    private SerializationFactory serializationFactory;
 
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
index 67bb0a3d32ea7c0ea9f56df5625c40ef914e384e..18c80e34c268feb57dda1be68e6b576572a14073 100644 (file)
@@ -5,6 +5,8 @@
  * 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.openflowjava.protocol.impl.core;
 
 import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
@@ -15,11 +17,11 @@ import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration
  * @author mirehak
  */
 public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable {
+
     /**
      * Sets thread configuration.
      *
      * @param threadConfig desired thread configuration
      */
-    @Deprecated(since = "0.17.2", forRemoval = true)
     void setThreadConfig(ThreadConfiguration threadConfig);
 }
index 9e8d1fa9bebabb132b2cd811aa55f586a5f241c1..2c0f711f4e3972882eb14ee4296771a0227b2ac8 100644 (file)
@@ -40,7 +40,7 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial
      *
      * @param workerGroup - shared worker group
      */
-    public TcpConnectionInitializer(final EventLoopGroup workerGroup, final boolean isEpollEnabled) {
+    public TcpConnectionInitializer(EventLoopGroup workerGroup, boolean isEpollEnabled) {
         this.workerGroup = requireNonNull(workerGroup, "WorkerGroup can't be null");
         this.isEpollEnabled = isEpollEnabled;
     }
@@ -69,13 +69,12 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial
     }
 
     @Override
-    @Deprecated(since = "0.17.2", forRemoval = true)
-    public void setThreadConfig(final ThreadConfiguration threadConfig) {
+    public void setThreadConfig(ThreadConfiguration threadConfig) {
         // IGNORE
     }
 
     @Override
-    public void initiateConnection(final String host, final int port) {
+    public void initiateConnection(String host, int port) {
         try {
             bootstrap.connect(host, port).sync();
         } catch (InterruptedException e) {
@@ -83,7 +82,7 @@ public class TcpConnectionInitializer implements ServerFacade, ConnectionInitial
         }
     }
 
-    public void setChannelInitializer(final TcpChannelInitializer channelInitializer) {
+    public void setChannelInitializer(TcpChannelInitializer channelInitializer) {
         this.channelInitializer = channelInitializer;
     }
 }
index 25789dcc1dfb12fad1167c615209e319718293b2..9ca513ae0ece53c2f19c018cf1575f0e44e330b1 100644 (file)
@@ -55,6 +55,7 @@ public class TcpHandler implements ServerFacade {
     private EventLoopGroup workerGroup;
     private EventLoopGroup bossGroup;
     private final SettableFuture<Boolean> isOnlineFuture = SettableFuture.create();
+    private ThreadConfiguration threadConfig;
 
     private TcpChannelInitializer channelInitializer;
 
@@ -65,7 +66,7 @@ public class TcpHandler implements ServerFacade {
      *
      * @param port listening port of TCPHandler server
      */
-    public TcpHandler(final int port, final Runnable readyRunnable) {
+    public TcpHandler(final int port, Runnable readyRunnable) {
         this(null, port, readyRunnable);
     }
 
@@ -74,9 +75,9 @@ public class TcpHandler implements ServerFacade {
      * @param address listening address of TCPHandler server
      * @param port listening port of TCPHandler server
      */
-    public TcpHandler(final InetAddress address, final int port, final Runnable readyRunnable) {
+    public TcpHandler(final InetAddress address, final int port, Runnable readyRunnable) {
         this.port = port;
-        startupAddress = address;
+        this.startupAddress = address;
         this.readyRunnable = readyRunnable;
     }
 
@@ -131,7 +132,7 @@ public class TcpHandler implements ServerFacade {
             address = isa.getHostString();
 
             // Update port, as it may have been specified as 0
-            port = isa.getPort();
+            this.port = isa.getPort();
 
             LOG.debug("address from tcphandler: {}", address);
             LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port);
@@ -186,14 +187,13 @@ public class TcpHandler implements ServerFacade {
         return address;
     }
 
-    public void setChannelInitializer(final TcpChannelInitializer channelInitializer) {
+    public void setChannelInitializer(TcpChannelInitializer channelInitializer) {
         this.channelInitializer = channelInitializer;
     }
 
     @Override
-    @Deprecated(since = "0.17.2", forRemoval = true)
-    public void setThreadConfig(final ThreadConfiguration threadConfig) {
-        // No-op
+    public void setThreadConfig(ThreadConfiguration threadConfig) {
+        this.threadConfig = threadConfig;
     }
 
     /**
@@ -201,7 +201,7 @@ public class TcpHandler implements ServerFacade {
      *
      * @param threadConfiguration number of threads to be created, if not specified in threadConfig
      */
-    public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) {
+    public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) {
         if (isEpollEnabled) {
             initiateEpollEventLoopGroups(threadConfiguration);
         } else {
@@ -214,7 +214,7 @@ public class TcpHandler implements ServerFacade {
      *
      * @param threadConfiguration number of threads to be created, if not specified in threadConfig
      */
-    public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) {
+    public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) {
         socketChannelClass = NioServerSocketChannel.class;
         if (threadConfiguration != null) {
             bossGroup = new NioEventLoopGroup(threadConfiguration.getBossThreadCount());
@@ -232,7 +232,7 @@ public class TcpHandler implements ServerFacade {
      * @param threadConfiguration the ThreadConfiguration
      */
     @SuppressWarnings("checkstyle:IllegalCatch")
-    protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) {
+    protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) {
         try {
             socketChannelClass = EpollServerSocketChannel.class;
             if (threadConfiguration != null) {
index f4ad4b2e4ae033b4121a99593baed1b13c490a90..3a373c96b0e817882d9925e7acf4935e92d99725 100644 (file)
@@ -39,8 +39,8 @@ public final class UdpHandler implements ServerFacade {
     private final InetAddress startupAddress;
     private final Runnable readyRunnable;
     private final SettableFuture<Boolean> isOnlineFuture = SettableFuture.create();
-
     private UdpChannelInitializer channelInitializer;
+    private ThreadConfiguration threadConfig;
     private Class<? extends DatagramChannel> datagramChannelClass;
 
     /**
@@ -48,7 +48,7 @@ public final class UdpHandler implements ServerFacade {
      *
      * @param port listening port of UdpHandler server
      */
-    public UdpHandler(final int port, final Runnable readyRunnable) {
+    public UdpHandler(final int port, Runnable readyRunnable) {
         this(null, port, readyRunnable);
     }
 
@@ -57,9 +57,9 @@ public final class UdpHandler implements ServerFacade {
      * @param address listening address of UdpHandler server
      * @param port listening port of UdpHandler server
      */
-    public UdpHandler(final InetAddress address, final int port, final Runnable readyRunnable) {
+    public UdpHandler(final InetAddress address, final int port, Runnable readyRunnable) {
         this.port = port;
-        startupAddress = address;
+        this.startupAddress = address;
         this.readyRunnable = readyRunnable;
     }
 
@@ -91,7 +91,7 @@ public final class UdpHandler implements ServerFacade {
             String address = isa.getHostString();
 
             // Update port, as it may have been specified as 0
-            port = isa.getPort();
+            this.port = isa.getPort();
 
             LOG.debug("Address from udpHandler: {}", address);
             LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port);
@@ -128,14 +128,13 @@ public final class UdpHandler implements ServerFacade {
         return port;
     }
 
-    public void setChannelInitializer(final UdpChannelInitializer channelInitializer) {
+    public void setChannelInitializer(UdpChannelInitializer channelInitializer) {
         this.channelInitializer = channelInitializer;
     }
 
     @Override
-    @Deprecated(since = "0.17.2", forRemoval = true)
-    public void setThreadConfig(final ThreadConfiguration threadConfig) {
-        // No-op
+    public void setThreadConfig(ThreadConfiguration threadConfig) {
+        this.threadConfig = threadConfig;
     }
 
     /**
@@ -143,7 +142,7 @@ public final class UdpHandler implements ServerFacade {
      *
      * @param threadConfiguration number of threads to be created, if not specified in threadConfig
      */
-    public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) {
+    public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) {
         if (isEpollEnabled) {
             initiateEpollEventLoopGroups(threadConfiguration);
         } else {
@@ -156,7 +155,7 @@ public final class UdpHandler implements ServerFacade {
      *
      * @param threadConfiguration number of threads to be created, if not specified in threadConfig
      */
-    public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) {
+    public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) {
         datagramChannelClass = NioDatagramChannel.class;
         if (threadConfiguration != null) {
             group = new NioEventLoopGroup(threadConfiguration.getWorkerThreadCount());
@@ -171,7 +170,7 @@ public final class UdpHandler implements ServerFacade {
      * @param threadConfiguration the ThreadConfiguration
      */
     @SuppressWarnings("checkstyle:IllegalCatch")
-    protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) {
+    protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) {
         try {
             datagramChannelClass = EpollDatagramChannel.class;
             if (threadConfiguration != null) {
index c9a43575521c52b950f9cdb0da002f568685f1b9..4ab309a272041e368bde833922b8859ed15f0e09 100755 (executable)
@@ -38,15 +38,16 @@ import org.slf4j.LoggerFactory;
  * @author timotej.kubas
  * @author michal.polkorab
  */
-public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>, SerializerRegistryInjector {
-    private static final Logger LOG = LoggerFactory .getLogger(MeterModInputMessageFactory.class);
+public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
+        SerializerRegistryInjector {
 
+    private static final Logger LOG = LoggerFactory
+            .getLogger(MeterModInputMessageFactory.class);
     private static final byte MESSAGE_TYPE = 29;
     private static final short LENGTH_OF_METER_BANDS = 16;
     private static final short PADDING_IN_METER_BAND_DROP = 4;
     private static final short PADDING_IN_METER_BAND_DSCP_REMARK = 3;
-
-    private SerializerRegistry registry = null;
+    private SerializerRegistry registry;
 
     @Override
     public void serialize(final MeterModInput message, final ByteBuf outBuffer) {
@@ -70,16 +71,19 @@ public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
         if (bands != null) {
             for (Bands currentBand : bands) {
                 MeterBand meterBand = currentBand.getMeterBand();
-                if (meterBand instanceof MeterBandDropCase dropBandCase) {
+                if (meterBand instanceof MeterBandDropCase) {
+                    MeterBandDropCase dropBandCase = (MeterBandDropCase) meterBand;
                     MeterBandDrop dropBand = dropBandCase.getMeterBandDrop();
                     writeBandCommonFields(dropBand, outBuffer);
                     outBuffer.writeZero(PADDING_IN_METER_BAND_DROP);
-                } else if (meterBand instanceof MeterBandDscpRemarkCase dscpRemarkBandCase) {
+                } else if (meterBand instanceof MeterBandDscpRemarkCase) {
+                    MeterBandDscpRemarkCase dscpRemarkBandCase = (MeterBandDscpRemarkCase) meterBand;
                     MeterBandDscpRemark dscpRemarkBand = dscpRemarkBandCase.getMeterBandDscpRemark();
                     writeBandCommonFields(dscpRemarkBand, outBuffer);
                     outBuffer.writeByte(dscpRemarkBand.getPrecLevel().toJava());
                     outBuffer.writeZero(PADDING_IN_METER_BAND_DSCP_REMARK);
-                } else if (meterBand instanceof MeterBandExperimenterCase experimenterBandCase) {
+                } else if (meterBand instanceof MeterBandExperimenterCase) {
+                    MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand;
                     MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter();
                     ExperimenterIdMeterBand expIdMeterBand =
                             experimenterBand.augmentation(ExperimenterIdMeterBand.class);
index 0da56924fe97bd190655fd03ced1392982ffbc3a..b208e9e449fd7a6a513f1bf4f9794fb8e751dc1f 100644 (file)
@@ -34,8 +34,7 @@ public class OF13MatchSerializer implements OFSerializer<Match>, SerializerRegis
     private static final Logger LOG = LoggerFactory.getLogger(OF13MatchSerializer.class);
     private static final byte STANDARD_MATCH_TYPE_CODE = 0;
     private static final byte OXM_MATCH_TYPE_CODE = 1;
-
-    private SerializerRegistry registry = null;
+    private SerializerRegistry registry;
 
     @Override
     public void serialize(final Match match, final ByteBuf outBuffer) {
index e4834f2ad869ef37b697057f41ff80c64d9250a6..a4fa77a4e8086b07bc242946ee44a9e9e69875ff 100644 (file)
@@ -40,17 +40,17 @@ import org.slf4j.LoggerFactory;
 public class ConnectionContextImpl implements ConnectionContext {
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionContextImpl.class);
 
-    private final List<PortStatusMessage> portStatusMessages = new ArrayList<>();
     private final ConnectionAdapter connectionAdapter;
-
     private volatile CONNECTION_STATE connectionState;
-    private FeaturesReply featuresReply = null;
+    private FeaturesReply featuresReply;
     private NodeId nodeId;
     private DeviceDisconnectedHandler deviceDisconnectedHandler;
     private OutboundQueueProvider outboundQueueProvider;
     private OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration;
-    private HandshakeContext handshakeContext = null;
-    private DeviceInfo deviceInfo = null;
+    private HandshakeContext handshakeContext;
+    private DeviceInfo deviceInfo;
+    private final List<PortStatusMessage> portStatusMessages = new ArrayList<>();
+    private final DeviceConnectionStatusProvider deviceConnectionStatusProvider;
 
     /**
      * Constructor.
@@ -60,6 +60,7 @@ public class ConnectionContextImpl implements ConnectionContext {
     public ConnectionContextImpl(final ConnectionAdapter connectionAdapter,
                                  final DeviceConnectionStatusProvider deviceConnectionStatusProvider) {
         this.connectionAdapter = connectionAdapter;
+        this.deviceConnectionStatusProvider = deviceConnectionStatusProvider;
     }
 
     @Override
index db894575883b8dde4a41fbe65eaa8ac7d0e45f27..f087f27440b11acc96f05395a9d9e891d96354bd 100644 (file)
@@ -29,13 +29,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class HandshakeListenerImpl implements HandshakeListener {
+
     private static final Logger LOG = LoggerFactory.getLogger(HandshakeListenerImpl.class);
     private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
 
     private final ConnectionContext connectionContext;
     private final DeviceConnectedHandler deviceConnectedHandler;
-
-    private HandshakeContext handshakeContext = null;
+    private HandshakeContext handshakeContext;
 
     /**
      * Constructor.
@@ -55,7 +55,7 @@ public class HandshakeListenerImpl implements HandshakeListener {
             LOG.debug("handshake succeeded: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
         }
         OF_EVENT_LOG.debug("Connect, Node: {}", featureOutput.getDatapathId());
-        handshakeContext.close();
+        this.handshakeContext.close();
         connectionContext.changeStateToWorking();
         connectionContext.setFeatures(featureOutput);
         connectionContext.setNodeId(InventoryDataServiceUtil.nodeIdFromDatapathId(featureOutput.getDatapathId()));
@@ -104,16 +104,16 @@ public class HandshakeListenerImpl implements HandshakeListener {
                 .setXid(xid)
                 .setVersion(version)
                 .build();
-        return connectionContext.getConnectionAdapter().barrier(barrierInput);
+        return this.connectionContext.getConnectionAdapter().barrier(barrierInput);
     }
 
     @Override
     public void onHandshakeFailure() {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("handshake failed: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
+            LOG.debug("handshake failed: {}", this.connectionContext.getConnectionAdapter().getRemoteAddress());
         }
-        handshakeContext.close();
-        connectionContext.closeConnection(false);
+        this.handshakeContext.close();
+        this.connectionContext.closeConnection(false);
     }
 
     @Override
index d655953c69625a364c616a392b086463f7f27614..47ee1a6c77c8a55f7267468c0b70d975f7b0701c 100644 (file)
@@ -29,12 +29,11 @@ import org.slf4j.LoggerFactory;
 
 public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeserializer<Match>,
         MatchEntryDeserializerRegistry, MatchEntryDeserializer, DeserializerRegistryInjector {
-    private static final Logger LOG = LoggerFactory.getLogger(MatchDeserializer.class);
 
+    private static final Logger LOG = LoggerFactory.getLogger(MatchDeserializer.class);
     private final Map<MatchEntryDeserializerKey, MatchEntryDeserializer> entryRegistry = new HashMap<>();
     private final MatchPath matchPath;
-
-    private DeserializerRegistry registry = null;
+    private DeserializerRegistry registry;
 
     public MatchDeserializer(final MatchPath matchPath) {
         this.matchPath = matchPath;
index 47ab7112023bad766fe6172c7867d40f07b0dbf1..514fae0b79a985bf3feb32455937c48e29cab2ae 100644 (file)
@@ -25,10 +25,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.reply.multipart.reply.body.MultipartReplyExperimenterBuilder;
 import org.opendaylight.yangtools.yang.common.Uint32;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class MultipartReplyExperimenterDeserializer implements OFDeserializer<MultipartReplyBody>,
         DeserializerRegistryInjector {
-    private DeserializerRegistry registry = null;
+    private static final Logger LOG = LoggerFactory.getLogger(MultipartReplyExperimenterDeserializer.class);
+    private DeserializerRegistry registry;
 
     @Override
     @SuppressWarnings("unchecked")
index 9b11140fbde2069fe2c0ff17ad6e99598aba8000..954796c48e6df05998e88a0236c7776b9656e735 100644 (file)
@@ -78,7 +78,7 @@ public class MultipartReplyTableFeaturesDeserializer implements OFDeserializer<M
     private static final TableFeaturesMatchFieldDeserializer MATCH_FIELD_DESERIALIZER =
             new TableFeaturesMatchFieldDeserializer();
 
-    private DeserializerRegistry registry = null;
+    private DeserializerRegistry registry;
 
     @Override
     public MultipartReplyBody deserialize(final ByteBuf message) {
index c9565dbaa62fa641dfaa2258ae449f1d4b2c6a23..46ecfead402a7d6a96d5d3ef879c2d4b225c0843 100644 (file)
@@ -37,12 +37,13 @@ import org.slf4j.LoggerFactory;
 
 public class MatchSerializer implements OFSerializer<Match>, HeaderSerializer<Match>,
         MatchEntrySerializerRegistry, SerializerRegistryInjector {
+
     private static final Logger LOG = LoggerFactory.getLogger(MatchSerializer.class);
     private static final byte OXM_MATCH_TYPE_CODE = 1;
 
     private final Map<org.opendaylight.openflowplugin.api.openflow.protocol.serialization.MatchEntrySerializerKey,
             MatchEntrySerializer> entryRegistry = new LinkedHashMap<>();
-    private SerializerRegistry registry = null;
+    private SerializerRegistry registry;
 
     @Override
     public void serialize(final Match match, final ByteBuf outBuffer) {
index c7069887fa4e760d5f64f6dc4b26ba84c0cc0597..6241e383871d1ac51cd9af4de80bcc5ddd44a869 100644 (file)
@@ -40,7 +40,7 @@ public class MeterMessageSerializer extends AbstractMessageSerializer<MeterMessa
     private static final short PADDING_IN_METER_BAND_DSCP_REMARK = 3;
     private static final int DEFAULT_METER_FLAGS = createMeterFlagsBitMask(new MeterFlags(false, false, true, false));
 
-    private SerializerRegistry registry = null;
+    private SerializerRegistry registry;
 
     @Override
     public void serialize(final MeterMessage message, final ByteBuf outBuffer) {
index 44805d3dc15979875e2c922018c9fd165f1a1fea..286219fc32c5d2a289660eaa92e5565965db33d8 100644 (file)
@@ -47,15 +47,15 @@ public class RoleContextImpl implements RoleContext {
     // Timeout  after what we will give up on propagating role
     private static final long SET_ROLE_TIMEOUT = 10000;
 
-    private final AtomicReference<ListenableFuture<RpcResult<SetRoleOutput>>> lastRoleFuture = new AtomicReference<>();
-    private final Collection<RequestContext<?>> requestContexts = new HashSet<>();
     private final DeviceInfo deviceInfo;
     private final HashedWheelTimer timer;
+    private final AtomicReference<ListenableFuture<RpcResult<SetRoleOutput>>> lastRoleFuture = new AtomicReference<>();
+    private final Collection<RequestContext<?>> requestContexts = new HashSet<>();
     private final Timeout slaveTask;
     private final OpenflowProviderConfig config;
     private final ExecutorService executorService;
     private ContextChainMastershipWatcher contextChainMastershipWatcher;
-    private SalRoleService roleService = null;
+    private SalRoleService roleService;
 
     RoleContextImpl(@NonNull final DeviceInfo deviceInfo,
                     @NonNull final HashedWheelTimer timer,
@@ -68,7 +68,8 @@ public class RoleContextImpl implements RoleContext {
         this.executorService = executorService;
         slaveTask = timer.newTimeout(timerTask -> makeDeviceSlave(), checkRoleMasterTimeout, TimeUnit.MILLISECONDS);
 
-        LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.", deviceInfo,
+        LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.",
+                deviceInfo,
                 checkRoleMasterTimeout / 1000L);
     }
 
@@ -84,7 +85,7 @@ public class RoleContextImpl implements RoleContext {
 
     @Override
     public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) {
-        contextChainMastershipWatcher = newWatcher;
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
index 2911a89b161f2a31e9f328b8424216d5cf12000f..3ac23e840cd720070dbf5f4cb6d10291ea9de22b 100644 (file)
@@ -57,8 +57,7 @@ class RpcContextImpl implements RpcContext {
     private final ExtensionConverterProvider extensionConverterProvider;
     private final ConvertorExecutor convertorExecutor;
     private final NotificationPublishService notificationPublishService;
-
-    private ContextChainMastershipWatcher contextChainMastershipWatcher = null;
+    private ContextChainMastershipWatcher contextChainMastershipWatcher;
 
     RpcContextImpl(@NonNull final RpcProviderService rpcProviderRegistry,
                    final int maxRequests,
@@ -68,15 +67,15 @@ class RpcContextImpl implements RpcContext {
                    @NonNull final NotificationPublishService notificationPublishService,
                    final boolean statisticsRpcEnabled) {
         this.deviceContext = deviceContext;
-        deviceInfo = deviceContext.getDeviceInfo();
-        nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier();
-        messageSpy = deviceContext.getMessageSpy();
+        this.deviceInfo = deviceContext.getDeviceInfo();
+        this.nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier();
+        this.messageSpy = deviceContext.getMessageSpy();
         this.rpcProviderRegistry = rpcProviderRegistry;
         this.extensionConverterProvider = extensionConverterProvider;
         this.notificationPublishService = notificationPublishService;
         this.convertorExecutor = convertorExecutor;
-        isStatisticsRpcEnabled = statisticsRpcEnabled;
-        tracker = new Semaphore(maxRequests, true);
+        this.isStatisticsRpcEnabled = statisticsRpcEnabled;
+        this.tracker = new Semaphore(maxRequests, true);
     }
 
     @Override
@@ -162,17 +161,17 @@ class RpcContextImpl implements RpcContext {
 
     @VisibleForTesting
     boolean isEmptyRpcRegistrations() {
-        return rpcRegistrations.isEmpty();
+        return this.rpcRegistrations.isEmpty();
     }
 
     @Override
     public DeviceInfo getDeviceInfo() {
-        return deviceInfo;
+        return this.deviceInfo;
     }
 
     @Override
     public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) {
-        contextChainMastershipWatcher = newWatcher;
+        this.contextChainMastershipWatcher = newWatcher;
     }
 
     @Override
index 4dec25895ab3c6ae8698ca9c87fe175d78d6f896..8da330554c37ab3ee9beb1c2caa1abe4e003a5ca 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>binding-parent</artifactId>
-        <version>12.0.4</version>
+        <version>12.0.3</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.controller</groupId>
                 <artifactId>controller-artifacts</artifactId>
-                <version>8.0.4</version>
+                <version>8.0.3</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.infrautils</groupId>
                 <artifactId>infrautils-artifacts</artifactId>
-                <version>6.0.5</version>
+                <version>6.0.4</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 26c582bbc65706e46e646aefb2f4e56deb8954c7..d624643a45057ae9007f80c7202960bf5e37e88f 100644 (file)
@@ -35,13 +35,13 @@ import org.slf4j.LoggerFactory;
  */
 public class LearningSwitchManagerSimpleImpl
         implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager {
-    private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerSimpleImpl.class);
 
-    private NotificationService notificationService = null;
+    private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerSimpleImpl.class);
+    private NotificationService notificationService;
     private PacketProcessingService packetProcessingService;
-    private DataBroker data = null;
-    private Registration packetInRegistration = null;
-    private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration = null;
+    private DataBroker data;
+    private Registration packetInRegistration;
+    private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
 
     /**
      * Sets the NotificationService.
@@ -49,7 +49,7 @@ public class LearningSwitchManagerSimpleImpl
      * @param notificationService the notificationService to set
      */
     @Override
-    public void setNotificationService(final NotificationService notificationService) {
+    public void setNotificationService(NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
@@ -60,7 +60,7 @@ public class LearningSwitchManagerSimpleImpl
      */
     @Override
     public void setPacketProcessingService(
-            final PacketProcessingService packetProcessingService) {
+            PacketProcessingService packetProcessingService) {
         this.packetProcessingService = packetProcessingService;
     }
 
@@ -68,7 +68,7 @@ public class LearningSwitchManagerSimpleImpl
      * Sets the DataBroker.
      */
     @Override
-    public void setDataBroker(final DataBroker broker) {
+    public void setDataBroker(DataBroker broker) {
         data = broker;
     }
 
index c355cc4f4f4e4ade3ed5016e13f212d02a01237e..32b72cf7d4fd88ff5ec7f68cf766c15f149c19d8 100644 (file)
@@ -8,31 +8,38 @@
 package org.opendaylight.openflowplugin.learningswitch;
 
 import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class WakeupOnNode implements DataTreeChangeListener<Table> {
-    private static final Logger LOG = LoggerFactory.getLogger(WakeupOnNode.class);
 
-    private LearningSwitchHandler learningSwitchHandler = null;
+    private static final Logger LOG = LoggerFactory.getLogger(WakeupOnNode.class);
+    private LearningSwitchHandler learningSwitchHandler;
 
     @Override
-    public void onDataTreeChanged(final Collection<DataTreeModification<Table>> modifications) {
+    public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Table>> modifications) {
         Uint8 requiredTableId = Uint8.ZERO;
         // TODO add flow
 
-        for (var modification : modifications) {
+        for (DataTreeModification<Table> modification : modifications) {
             if (modification.getRootNode().getModificationType() == ModificationType.SUBTREE_MODIFIED) {
-                var table = modification.getRootNode().getDataAfter();
-                if (table != null) {
+                DataObject table = modification.getRootNode().getDataAfter();
+                if (table instanceof Table) {
+                    Table tableSure = (Table) table;
                     LOG.trace("table: {}", table);
-                    if (requiredTableId.equals(table.getId())) {
-                        learningSwitchHandler.onSwitchAppeared(modification.getRootPath().getRootIdentifier());
+
+                    if (requiredTableId.equals(tableSure.getId())) {
+                        InstanceIdentifier<Table> tablePath =
+                                modification.getRootPath().getRootIdentifier();
+                        learningSwitchHandler.onSwitchAppeared(tablePath);
                     }
                 }
             }
@@ -44,7 +51,8 @@ public class WakeupOnNode implements DataTreeChangeListener<Table> {
      *
      * @param learningSwitchHandler the learningSwitchHandler to set
      */
-    public void setLearningSwitchHandler(final LearningSwitchHandler learningSwitchHandler) {
+    public void setLearningSwitchHandler(
+            LearningSwitchHandler learningSwitchHandler) {
         this.learningSwitchHandler = learningSwitchHandler;
     }
 }
index 7ad5bcea9257c8ec1293b7c6653884f426216793..9a8a03d874952acb2c33cbada789846b1eb23b10 100644 (file)
@@ -39,13 +39,13 @@ import org.slf4j.LoggerFactory;
  * </ul>
  */
 public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager {
-    private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerMultiImpl.class);
 
-    private NotificationService notificationService = null;
+    private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerMultiImpl.class);
+    private NotificationService notificationService;
     private PacketProcessingService packetProcessingService;
-    private DataBroker data = null;
-    private Registration packetInRegistration = null;
-    private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration = null;
+    private DataBroker data;
+    private Registration packetInRegistration;
+    private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
 
     /**
      * Sets the NotificationService.
@@ -53,7 +53,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg
      * @param notificationService the notificationService to set
      */
     @Override
-    public void setNotificationService(final NotificationService notificationService) {
+    public void setNotificationService(NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 
@@ -64,7 +64,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg
      */
     @Override
     public void setPacketProcessingService(
-            final PacketProcessingService packetProcessingService) {
+            PacketProcessingService packetProcessingService) {
         this.packetProcessingService = packetProcessingService;
     }
 
@@ -74,7 +74,7 @@ public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerReg
      * @param broker the data to set
      */
     @Override
-    public void setDataBroker(final DataBroker broker) {
+    public void setDataBroker(DataBroker broker) {
         data = broker;
     }
 
index 330f63081f4f86d006d018921b4770791ae85f18..253c588f2af8d6ce55f116669629282757e04069 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>13.0.10</version>
+        <version>13.0.7</version>
         <relativePath/>
     </parent>
 
index d1c5ca2402439bf90f1a78fb74e2bf2ceef67631..fc70a14f354c18f110f5211d2d88f01f2bbe8fb8 100644 (file)
@@ -15,7 +15,6 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.channel.socket.nio.NioSocketChannel;
 import java.net.InetAddress;
 import java.util.concurrent.Callable;
-import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
@@ -25,7 +24,8 @@ import org.slf4j.LoggerFactory;
  * @author Jozef Bacigal
  */
 public class CallableClient implements Callable<Boolean>, OFClient {
-    private static final Logger LOG = LoggerFactory.getLogger(CallableClient.class);
+
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(CallableClient.class);
 
     private int port = 6653;
     private boolean securedClient = false;
@@ -33,8 +33,8 @@ public class CallableClient implements Callable<Boolean>, OFClient {
     private String name = "Empty name";
 
     private final EventLoopGroup workerGroup;
-    private final SettableFuture<Boolean> isOnlineFuture = null;
-    private final SettableFuture<Boolean> scenarioDone = null;
+    private SettableFuture<Boolean> isOnlineFuture;
+    private SettableFuture<Boolean> scenarioDone;
     private ScenarioHandler scenarioHandler = null;
     private Bootstrap bootstrap = null;
 
@@ -49,7 +49,7 @@ public class CallableClient implements Callable<Boolean>, OFClient {
         this.port = port;
         this.securedClient = securedClient;
         this.ipAddress = requireNonNull(ipAddress, "IP address cannot be null");
-        workerGroup = eventExecutors;
+        this.workerGroup = eventExecutors;
         this.bootstrap = bootstrap;
         this.name = name;
         this.scenarioHandler = requireNonNull(scenarioHandler, "Scenario handler cannot be null");
@@ -67,7 +67,7 @@ public class CallableClient implements Callable<Boolean>, OFClient {
 
     @Override
     public void setScenarioHandler(final ScenarioHandler scenario) {
-        scenarioHandler = scenario;
+        this.scenarioHandler = scenario;
     }
 
     @Override
@@ -81,7 +81,7 @@ public class CallableClient implements Callable<Boolean>, OFClient {
     public Boolean call() throws Exception {
         requireNonNull(bootstrap);
         requireNonNull(workerGroup);
-        LOG.info("Switch {} trying connect to controller", name);
+        LOG.info("Switch {} trying connect to controller", this.name);
         SimpleClientInitializer clientInitializer = new SimpleClientInitializer(isOnlineFuture, securedClient);
         clientInitializer.setScenario(scenarioHandler);
         try {
@@ -101,9 +101,9 @@ public class CallableClient implements Callable<Boolean>, OFClient {
             return false;
         }
         if (scenarioHandler.isFinishedOK()) {
-            LOG.info("Device {} finished scenario OK", name);
+            LOG.info("Device {} finished scenario OK", this.name);
         } else {
-            LOG.error("Device {} finished scenario with error", name);
+            LOG.error("Device {} finished scenario with error", this.name);
         }
         return scenarioHandler.isFinishedOK();
 
index f733b106408438f32d97d028d2466e01092781f7..fa4936a3b3e16410fb30380aabbcddb66f6c5d72 100644 (file)
@@ -20,17 +20,17 @@ import org.slf4j.LoggerFactory;
  * @author michal.polkorab
  */
 public class SendEvent implements ClientEvent {
-    private static final Logger LOG = LoggerFactory.getLogger(SendEvent.class);
 
+    private static final Logger LOG = LoggerFactory.getLogger(SendEvent.class);
     protected byte[] msgToSend;
-    protected ChannelHandlerContext ctx = null;
+    protected ChannelHandlerContext ctx;
 
     /**
      * Constructor.
      *
      * @param msgToSend message to be sent
      */
-    public SendEvent(final byte[] msgToSend) {
+    public SendEvent(byte[] msgToSend) {
         this.msgToSend = new byte[msgToSend.length];
         System.arraycopy(msgToSend, 0, this.msgToSend, 0, msgToSend.length);
     }
@@ -55,7 +55,8 @@ public class SendEvent implements ClientEvent {
      *
      * @param ctx context which will be used for sending messages (SendEvents)
      */
-    public void setCtx(final ChannelHandlerContext ctx) {
+    public void setCtx(ChannelHandlerContext ctx) {
         this.ctx = ctx;
     }
+
 }
index beb60d73855f42e5e00092ca8f8e150c0469e93e..6bb4d4ca2ca551d20aa64d7b7bcbe019917dcfed 100644 (file)
@@ -39,7 +39,10 @@ import org.slf4j.LoggerFactory;
 public class DropTestCommiter extends AbstractDropTest {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestCommiter.class);
     private static final TableKey ZERO_TABLE = new TableKey(Uint8.ZERO);
+    private DataBroker dataService;
+
     private static final AtomicLong ID_COUNTER = new AtomicLong();
+
     private static final ThreadLocal<FlowBuilder> BUILDER = ThreadLocal.withInitial(() -> {
         final var cookie = new FlowCookie(Uint64.TEN);
         return new FlowBuilder()
@@ -53,9 +56,9 @@ public class DropTestCommiter extends AbstractDropTest {
             .setFlags(new FlowModFlags(false, false, false, false, false));
     });
 
-    private NotificationService notificationService = null;
-    private Registration notificationRegistration = null;
-    private DataBroker dataService = null;
+    private NotificationService notificationService;
+
+    private Registration notificationRegistration;
 
     /**
      * start listening on packetIn.
index 8906f8bf38a89a18b230fd68b404aac519e4f480..885b1191676eda05a9b13596fa81e182bdb6b81c 100644 (file)
@@ -36,6 +36,13 @@ import org.slf4j.LoggerFactory;
  */
 public class DropTestRpcSender extends AbstractDropTest {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcSender.class);
+
+    private SalFlowService flowService;
+
+    public void setFlowService(final SalFlowService flowService) {
+        this.flowService = flowService;
+    }
+
     private static final ThreadLocal<AddFlowInputBuilder> BUILDER = ThreadLocal.withInitial(() -> {
         final var cookie = new FlowCookie(Uint64.TEN);
         return new AddFlowInputBuilder()
@@ -49,13 +56,9 @@ public class DropTestRpcSender extends AbstractDropTest {
             .setFlags(new FlowModFlags(false, false, false, false, false));
     });
 
-    private NotificationService notificationService = null;
-    private Registration notificationRegistration = null;
-    private SalFlowService flowService = null;
+    private NotificationService notificationService;
 
-    public void setFlowService(final SalFlowService flowService) {
-        this.flowService = flowService;
-    }
+    private Registration notificationRegistration;
 
     /**
      * Start listening on packetIn.
index 5c82d1d419cd94bff555af857d1b41ec4094d6d0..ce2880ef24300a27117beb69b54a194b4f255ee3 100644 (file)
@@ -98,12 +98,11 @@ import org.slf4j.LoggerFactory;
 
 public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class);
-    private static final String ORIGINAL_FLOW_NAME = "Foo";
-    private static final String ORIGINAL_GROUP_NAME = "Foo";
-
     private final DataBroker dataBroker;
     private final BundleContext ctx;
+    private final String originalFlowName = "Foo";
     private Node testNode12;
+    private final String originalGroupName = "Foo";
 
     public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) {
         this.dataBroker = dataBroker;
@@ -307,8 +306,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
                 .build()));
     }
 
-    private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg,
-            final String tableId) {
+    private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
 
         FlowBuilder flow = new FlowBuilder();
         long id = 123;
@@ -411,7 +409,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         flow.withKey(key);
         flow.setPriority(Uint16.TWO);
-        flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
+        flow.setFlowName(originalFlowName + "X" + flowType);
         return flow;
     }
 
@@ -631,7 +629,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
         }, MoreExecutors.directExecutor());
     }
 
-    private static GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod,
+    private GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod,
             final String strId) {
         // Sample data , committing to DataStore
 
@@ -714,7 +712,7 @@ public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvid
 
         return group.withKey(new GroupKey(new GroupId(Uint32.valueOf(strId))))
             // .group.setInstall(false)
-            .setGroupName(ORIGINAL_GROUP_NAME)
+            .setGroupName(originalGroupName)
             .setBarrier(false)
             .setBuckets(new BucketsBuilder().setBucket(BindingMap.of(bucket.build())).build());
     }
index 4d19dc7f64290d226e495a8f0185c7c988666f39..d7a97d4cc3311fffcc310b5b42e537b973babd6b 100644 (file)
@@ -104,10 +104,10 @@ import org.slf4j.LoggerFactory;
 
 public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class);
-    private static final String ORIGINAL_FLOW_NAME = "Foo";
 
     private final DataBroker dataBroker;
     private final BundleContext ctx;
+    private final String originalFlowName = "Foo";
 
     public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) {
         this.dataBroker = dataBroker;
@@ -131,8 +131,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         return "No help";
     }
 
-    private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg,
-            final String tableId) {
+    private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
 
         FlowBuilder flow = new FlowBuilder();
         long id = 123;
@@ -395,7 +394,7 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
         flow.withKey(key);
         flow.setPriority(Uint16.TWO);
-        flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
+        flow.setFlowName(originalFlowName + "X" + flowType);
         return flow;
     }
 
@@ -418,47 +417,49 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         FlowBuilder tf;
         FlowBuilder tf1;
         FlowBuilder tf2;
-        FlowBuilder tf3 = switch (flowcnt) {
-            case 1 -> {
+        FlowBuilder tf3;
+        switch (flowcnt) {
+            case 1:
                 tf = createTestFlow(tn, "f1", "10");
                 tf1 = createTestFlow(tn, "f2", "11");
                 tf2 = createTestFlow(tn, "f3", "12");
-                yield createTestFlow(tn, "f4", "13");
-            }
-            case 2 -> {
+                tf3 = createTestFlow(tn, "f4", "13");
+                break;
+            case 2:
                 tf = createTestFlow(tn, "f3", "3");
                 tf1 = createTestFlow(tn, "f4", "4");
                 tf2 = createTestFlow(tn, "f5", "5");
-                yield createTestFlow(tn, "f6", "6");
-            }
-            case 3 -> {
+                tf3 = createTestFlow(tn, "f6", "6");
+                break;
+            case 3:
                 tf = createTestFlow(tn, "f7", "7");
                 tf1 = createTestFlow(tn, "f8", "8");
                 tf2 = createTestFlow(tn, "f9", "9");
-                yield createTestFlow(tn, "f10", "10");
-            }
-            case 4 -> {
+                tf3 = createTestFlow(tn, "f10", "10");
+                break;
+            case 4:
                 // -ve scenario
                 tf = createTestFlow(tn, "f23", "3");
                 tf1 = createTestFlow(tn, "f34", "4");
                 tf2 = createTestFlow(tn, "f35", "5");
-                yield createTestFlow(tn, "f36", "6");
-            }
-            case 5 -> {
+                tf3 = createTestFlow(tn, "f36", "6");
+                break;
+            case 5:
                 // +ve scenario
                 // modify case 6 -ve
                 tf = createTestFlow(tn, "f230", "3");
                 tf1 = createTestFlow(tn, "f34", "4");
                 tf2 = createTestFlow(tn, "f35", "5");
-                yield createTestFlow(tn, "f36", "6");
-            }
-            default -> {
+                tf3 = createTestFlow(tn, "f36", "6");
+                break;
+
+            default:
                 tf = createTestFlow(tn, "f42", "42");
                 tf1 = createTestFlow(tn, "f43", "43");
                 tf2 = createTestFlow(tn, "f44", "44");
-                yield createTestFlow(tn, "f45", "45");
-            }
-        };
+                tf3 = createTestFlow(tn, "f45", "45");
+
+        }
         writeFlow(ci, tf, tf1, tf2, tf3, tn);
     }
 
@@ -474,47 +475,50 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         FlowBuilder tf;
         FlowBuilder tf1;
         FlowBuilder tf2;
-        FlowBuilder tf3 = switch (flowcnt) {
-            case 1 -> {
+        FlowBuilder tf3;
+        switch (flowcnt) {
+            case 1:
                 tf = createTestFlow(tn, "f82", "10");
                 tf1 = createTestFlow(tn, "f83", "11");
                 tf2 = createTestFlow(tn, "f84", "12");
-                yield createTestFlow(tn, "f85", "13");
-            }
-            case 2 -> {
+                tf3 = createTestFlow(tn, "f85", "13");
+                break;
+            case 2:
                 tf = createTestFlow(tn, "f700", "3");
                 tf1 = createTestFlow(tn, "f4", "4");
                 tf2 = createTestFlow(tn, "f900", "5");
-                yield createTestFlow(tn, "f86", "6");
-            }
-            case 3 -> {
+                tf3 = createTestFlow(tn, "f86", "6");
+                break;
+            case 3:
                 // +
                 tf = createTestFlow(tn, "f91", "7");
                 tf1 = createTestFlow(tn, "f92", "8");
                 tf2 = createTestFlow(tn, "f93", "9");
-                yield createTestFlow(tn, "f94", "10");
-            }
-            case 4 -> {
+                tf3 = createTestFlow(tn, "f94", "10");
+                break;
+            case 4:
                 // +ve scenario
                 tf = createTestFlow(tn, "f230", "3");
                 tf1 = createTestFlow(tn, "f99", "4");
                 tf2 = createTestFlow(tn, "f100", "5");
-                yield createTestFlow(tn, "f101", "6");
-            }
-            case 5 -> {
+                tf3 = createTestFlow(tn, "f101", "6");
+                break;
+            case 5:
                 // -
                 tf = createTestFlow(tn, "f23", "3");
                 tf1 = createTestFlow(tn, "f99", "4");
                 tf2 = createTestFlow(tn, "f100", "5");
-                yield createTestFlow(tn, "f101", "6");
-            }
-            default -> {
+                tf3 = createTestFlow(tn, "f101", "6");
+                break;
+
+            default:
                 tf = createTestFlow(tn, "f87", "12");
                 tf1 = createTestFlow(tn, "f88", "13");
                 tf2 = createTestFlow(tn, "f89", "14");
-                yield createTestFlow(tn, "f90", "15");
-            }
-        };
+                tf3 = createTestFlow(tn, "f90", "15");
+
+        }
+
         writeFlow(ci, tf, tf1, tf2, tf3, tn);
     }
 
@@ -528,73 +532,74 @@ public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
         FlowBuilder tf1 = null;
         FlowBuilder tf2 = null;
         FlowBuilder tf3 = null;
-        tf3 = switch (flowcnt) {
-            case 1 -> {
+        switch (flowcnt) {
+            case 1:
                 // add case 1
                 tf = createTestFlow(tn, "f1", "10");
                 tf1 = createTestFlow(tn, "f2", "11");
                 tf2 = createTestFlow(tn, "f3", "12");
-                yield createTestFlow(tn, "f4", "13");
-            }
-            case 2 -> {
+                tf3 = createTestFlow(tn, "f4", "13");
+                break;
+            case 2:
                 // modify case 1
                 tf = createTestFlow(tn, "f82", "10");
                 tf1 = createTestFlow(tn, "f83", "11");
                 tf2 = createTestFlow(tn, "f84", "12");
-                yield createTestFlow(tn, "f85", "13");
-            }
-            case 3 -> {
+                tf3 = createTestFlow(tn, "f85", "13");
+                break;
+            case 3:
                 // add case 2
                 tf = createTestFlow(tn, "f3", "3");
                 tf1 = createTestFlow(tn, "f4", "4");
                 tf2 = createTestFlow(tn, "f5", "5");
-                yield createTestFlow(tn, "f6", "6");
-            }
-            case 4 -> {
+                tf3 = createTestFlow(tn, "f6", "6");
+                break;
+            case 4:
                 // modify case 2
                 tf = createTestFlow(tn, "f700", "3");
                 tf1 = createTestFlow(tn, "f4", "4");
                 tf2 = createTestFlow(tn, "f900", "5");
-                yield createTestFlow(tn, "f86", "6");
-            }
-            case 5 -> {
+                tf3 = createTestFlow(tn, "f86", "6");
+                break;
+            case 5:
                 // add case 3
                 tf = createTestFlow(tn, "f7", "7");
                 tf1 = createTestFlow(tn, "f8", "8");
                 tf2 = createTestFlow(tn, "f9", "9");
-                yield createTestFlow(tn, "f10", "10");
-            }
-            case 6 -> {
+                tf3 = createTestFlow(tn, "f10", "10");
+                break;
+            case 6:
                 // modify case 3
                 tf = createTestFlow(tn, "f91", "7");
                 tf1 = createTestFlow(tn, "f92", "8");
                 tf2 = createTestFlow(tn, "f93", "9");
-                yield createTestFlow(tn, "f94", "10");
-            }
-            case 7 -> {
+                tf3 = createTestFlow(tn, "f94", "10");
+                break;
+            case 7:
                 // -ve scenario
                 tf = createTestFlow(tn, "f23", "3");
                 tf1 = createTestFlow(tn, "f34", "4");
                 tf2 = createTestFlow(tn, "f35", "5");
-                yield createTestFlow(tn, "f36", "6");
-            }
-            case 8 -> {
+                tf3 = createTestFlow(tn, "f36", "6");
+                break;
+            case 8:
                 // +ve scenario
                 // modify case 6 -ve
                 tf = createTestFlow(tn, "f23", "3");
                 tf1 = createTestFlow(tn, "f99", "4");
                 tf2 = createTestFlow(tn, "f100", "5");
-                yield createTestFlow(tn, "f101", "6");
-            }
-            case 9 -> {
+                tf3 = createTestFlow(tn, "f101", "6");
+                break;
+            case 9:
                 // modify case 6
                 tf = createTestFlow(tn, "f700", "7");
                 tf1 = createTestFlow(tn, "f230", "23");
                 tf2 = createTestFlow(tn, "f900", "9");
-                yield createTestFlow(tn, "f1000", "10");
-            }
-            default -> throw new IllegalArgumentException("Invalid flowtype: " + flowtype);
-        };
+                tf3 = createTestFlow(tn, "f1000", "10");
+                break;
+            default:
+                throw new IllegalArgumentException("Invalid flowtype: " + flowtype);
+        }
 
         InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
                 .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
index 202081bda33538a0efcf99ae59c636482aa68501..17a2e79bf502f975eb21cc7930a65953408ee325 100644 (file)
@@ -29,11 +29,13 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
-    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider.class);
+public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
+        SalGroupService {
 
-    private ObjectRegistration<SalGroupService> groupRegistration = null;
-    private NotificationPublishService notificationService = null;
+    private static final Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginGroupTestServiceProvider.class);
+    private ObjectRegistration<SalGroupService> groupRegistration;
+    private NotificationPublishService notificationService;
 
     /**
      * Get group registration.
@@ -68,7 +70,8 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, Sa
     }
 
     public void start() {
-        LOG.info("SalGroupServiceProvider Started.");
+        OpenflowpluginGroupTestServiceProvider.LOG
+                .info("SalGroupServiceProvider Started.");
     }
 
     /*
@@ -78,7 +81,8 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, Sa
      */
     @Override
     public void close() {
-        LOG.info("SalGroupServiceProvide stopped.");
+        OpenflowpluginGroupTestServiceProvider.LOG
+                .info("SalGroupServiceProvide stopped.");
         groupRegistration.close();
     }
 
@@ -93,7 +97,7 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, Sa
      */
     @Override
     public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
-        LOG.info("addGroup - {}", input);
+        OpenflowpluginGroupTestServiceProvider.LOG.info("addGroup - {}", input);
         return null;
     }
 
@@ -107,8 +111,9 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, Sa
      * .group.service.rev130918.RemoveGroupInput)
      */
     @Override
-    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
-        LOG.info("removeGroup - {}", input);
+    public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(
+            final RemoveGroupInput input) {
+        OpenflowpluginGroupTestServiceProvider.LOG.info("removeGroup - {}", input);
         return null;
     }
 
@@ -122,8 +127,9 @@ public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, Sa
      * .group.service.rev130918.UpdateGroupInput)
      */
     @Override
-    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
-        LOG.info("updateGroup - {}", input);
+    public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(
+            final UpdateGroupInput input) {
+        OpenflowpluginGroupTestServiceProvider.LOG.info("updateGroup - {}", input);
         return null;
     }
 
index 6c71f581f26c4e99e3fa170e5831a2f3e77469cc..c04e4084bb5135fc76a947715508fddf16b710c5 100644 (file)
@@ -37,10 +37,11 @@ import org.opendaylight.yangtools.yang.binding.util.BindingMap;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
-    private static final String ORIGINAL_METER_NAME = "Foo";
-    private static final String UPDATED_METER_NAME = "Bar";
+    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestCommandProvider.class);
 
     private final DataBroker dataBroker;
     private final BundleContext ctx;
@@ -48,6 +49,8 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
     private Meter testMeter1;
     private Meter testMeter2;
     private Node testNode;
+    private final String originalMeterName = "Foo";
+    private final String updatedMeterName = "Bar";
 
     public OpenflowpluginMeterTestCommandProvider(final DataBroker dataBroker, final BundleContext ctx) {
         this.dataBroker = dataBroker;
@@ -78,7 +81,7 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
             .setContainerName("abcd")
             .withKey(new MeterKey(new MeterId(Uint32.valueOf(12))))
             .setMeterId(new MeterId(Uint32.valueOf(9)))
-            .setMeterName(ORIGINAL_METER_NAME)
+            .setMeterName(originalMeterName)
             .setFlags(new MeterFlags(true, false, false, false))
             .setMeterBandHeaders(new MeterBandHeadersBuilder()
                 .setMeterBandHeader(BindingMap.of(new MeterBandHeaderBuilder()
@@ -116,10 +119,10 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
             .setBandId(new BandId(Uint32.ZERO));
 
         if (s2.equalsIgnoreCase("modify")) {
-            meter.setMeterName(UPDATED_METER_NAME);
+            meter.setMeterName(updatedMeterName);
             bandHeader.setBandRate(Uint32.valueOf(234));
         } else {
-            meter.setMeterName(ORIGINAL_METER_NAME);
+            meter.setMeterName(originalMeterName);
             bandHeader.setBandRate(Uint32.valueOf(123));
         }
 
@@ -372,9 +375,9 @@ public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
             createUserNode(nref);
         }
         MeterBuilder meter = createTestMeter();
-        meter.setMeterName(UPDATED_METER_NAME);
+        meter.setMeterName(updatedMeterName);
         writeMeter(ci, meter.build());
-        meter.setMeterName(ORIGINAL_METER_NAME);
+        meter.setMeterName(originalMeterName);
         writeMeter(ci, meter.build());
     }
 
index b70ebccc097d78d4011872cb02580cc3e6f540f7..3a54042e9c22a2619687838b3fbecf6762f8744f 100644 (file)
@@ -30,12 +30,13 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, SalMeterService {
-    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestServiceProvider.class);
-
-    private DataBroker dataService = null;
-    private ObjectRegistration<SalMeterService> meterRegistration = null;
-    private NotificationPublishService notificationService = null;
+public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
+        SalMeterService {
+    private static final Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginMeterTestServiceProvider.class);
+    private DataBroker dataService;
+    private ObjectRegistration<SalMeterService> meterRegistration;
+    private NotificationPublishService notificationService;
 
     /**
      * Gets the data service.
@@ -43,7 +44,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      * @return {@link #dataService}
      */
     public DataBroker getDataService() {
-        return dataService;
+        return this.dataService;
     }
 
     /**
@@ -59,7 +60,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      * @return {@link #meterRegistration}
      */
     public ObjectRegistration<SalMeterService> getMeterRegistration() {
-        return meterRegistration;
+        return this.meterRegistration;
     }
 
     /**
@@ -75,7 +76,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      * @return {@link #notificationService}
      */
     public NotificationPublishService getNotificationService() {
-        return notificationService;
+        return this.notificationService;
     }
 
     /**
@@ -86,7 +87,8 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
     }
 
     public void start() {
-        LOG.info("SalMeterServiceProvider Started.");
+        OpenflowpluginMeterTestServiceProvider.LOG
+                .info("SalMeterServiceProvider Started.");
     }
 
     /*
@@ -96,7 +98,8 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      */
     @Override
     public void close() {
-        LOG.info("SalMeterServiceProvide stopped.");
+        OpenflowpluginMeterTestServiceProvider.LOG
+                .info("SalMeterServiceProvide stopped.");
         meterRegistration.close();
     }
 
@@ -111,7 +114,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      */
     @Override
     public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
-        LOG.info("addMeter - {}", input);
+        OpenflowpluginMeterTestServiceProvider.LOG.info("addMeter - {}", input);
         return null;
     }
 
@@ -125,8 +128,9 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      * .meter.service.rev130918.RemoveMeterInput)
      */
     @Override
-    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(final RemoveMeterInput input) {
-        LOG.info("removeMeter - {}", input);
+    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(
+            final RemoveMeterInput input) {
+        OpenflowpluginMeterTestServiceProvider.LOG.info("removeMeter - {}", input);
         return null;
     }
 
@@ -140,8 +144,9 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, Sa
      * .meter.service.rev130918.UpdateMeterInput)
      */
     @Override
-    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(final UpdateMeterInput input) {
-        LOG.info("updateMeter - {}", input);
+    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(
+            final UpdateMeterInput input) {
+        OpenflowpluginMeterTestServiceProvider.LOG.info("updateMeter - {}", input);
         return null;
     }
 
index e618a7c8086e0431b0d7f7bbb849cb2bb6bff5ea..64836a6578d2d95d22f558a60176bb61d27af81c 100644 (file)
@@ -15,23 +15,22 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 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.table.service.rev131026.UpdateTable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutputBuilder;
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
-import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, UpdateTable {
-    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
+public class OpenflowpluginTableFeaturesTestServiceProvider implements
+        AutoCloseable, SalTableService {
 
-    private Registration tableRegistration = null;
+    private static final Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
+    private ObjectRegistration<SalTableService> tableRegistration;
     private NotificationPublishService notificationService;
 
     /**
@@ -39,14 +38,14 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoClose
      *
      * @return {@link #tableRegistration}
      */
-    public Registration getTableRegistration() {
-        return tableRegistration;
+    public ObjectRegistration<SalTableService> getTableRegistration() {
+        return this.tableRegistration;
     }
 
     /**
      * Set {@link #tableRegistration}.
      */
-    public void setTableRegistration(final Registration tableRegistration) {
+    public void setTableRegistration(final ObjectRegistration<SalTableService> tableRegistration) {
         this.tableRegistration = tableRegistration;
     }
 
@@ -56,7 +55,7 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoClose
      * @return {@link #notificationService}
      */
     public NotificationPublishService getNotificationService() {
-        return notificationService;
+        return this.notificationService;
     }
 
     /**
@@ -67,24 +66,41 @@ public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoClose
     }
 
     public void start() {
-        LOG.info("SalTableServiceProvider Started.");
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG
+                .info("SalTableServiceProvider Started.");
     }
 
+    /*
+     * (non-Javadoc)
+     *
+     * @see java.lang.AutoCloseable#close()
+     */
     @Override
     public void close() {
-        LOG.info("SalTableServiceProvider stopped.");
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG
+                .info("SalTableServiceProvider stopped.");
         tableRegistration.close();
     }
 
+    /*
+     * (non-Javadoc)
+     *
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026
+     * .SalTableService
+     * #updateTable(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .table.service.rev131026.UpdateTableInput)
+     */
     @Override
-    public ListenableFuture<RpcResult<UpdateTableOutput>> invoke(final UpdateTableInput input) {
-        LOG.info("updateTable - {}", input);
-        return RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture();
+    public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(
+            final UpdateTableInput input) {
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG.info("updateTable - {}", input);
+        return null;
     }
 
     public ObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
             final RpcProviderService rpcRegistry) {
-        setTableRegistration(rpcRegistry.registerRpcImplementation(this, ImmutableSet.of(
+        setTableRegistration(rpcRegistry.registerRpcImplementation(SalTableService.class, this, ImmutableSet.of(
             InstanceIdentifier.create(Nodes.class)
             .child(Node.class, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID))))));
 
index 00d76392440e6d1757d55720eafdbcb0ba22f9b9..521ce330e1321a8541a6dac912ea6d018a08555d 100644 (file)
@@ -30,14 +30,16 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OpenflowpluginTestServiceProvider implements AutoCloseable, SalFlowService {
-    private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestServiceProvider.class);
+public class OpenflowpluginTestServiceProvider implements AutoCloseable,
+        SalFlowService {
+
+    private static final Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginTestServiceProvider.class);
 
     private final DataBroker dataService;
+    private ObjectRegistration<SalFlowService> flowRegistration;
     private final NotificationPublishService notificationProviderService;
 
-    private ObjectRegistration<SalFlowService> flowRegistration = null;
-
     public OpenflowpluginTestServiceProvider(final DataBroker dataService,
             final NotificationPublishService notificationProviderService) {
         this.dataService = dataService;