X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Fclustering-test-app%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fit%2Fprovider%2Fimpl%2FIdIntsDOMDataTreeLIstener.java;h=574952e70e6bf22b9bac74639cd1b5903c0234ab;hb=ae6c61499e2c7c76e0406ce397657cd31ddd4d3f;hp=f5b55fd0775eaf3f3442fcc98de9c06d8b467ba1;hpb=24b4558eb542c58a57071542b20dd058c65ee7e6;p=controller.git diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/IdIntsDOMDataTreeLIstener.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/IdIntsDOMDataTreeLIstener.java index f5b55fd077..574952e70e 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/IdIntsDOMDataTreeLIstener.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/IdIntsDOMDataTreeLIstener.java @@ -5,7 +5,6 @@ * 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.controller.clustering.it.provider.impl; import com.google.common.base.Preconditions; @@ -18,7 +17,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Nonnull; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.mdsal.dom.api.DOMDataTreeListener; import org.opendaylight.mdsal.dom.api.DOMDataTreeListeningException; @@ -33,13 +31,13 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener { private static final long SECOND_AS_NANO = 1000000000; private NormalizedNode localCopy = null; - private AtomicLong lastNotifTimestamp = new AtomicLong(0); + private final AtomicLong lastNotifTimestamp = new AtomicLong(0); private ScheduledFuture scheduledFuture; private ScheduledExecutorService executorService; @Override - public void onDataTreeChanged(@Nonnull final Collection changes, - @Nonnull final Map> subtrees) { + public void onDataTreeChanged(final Collection changes, + final Map> subtrees) { // There should only be one candidate reported Preconditions.checkState(changes.size() == 1); @@ -69,7 +67,7 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener { } @Override - public void onDataTreeFailed(@Nonnull Collection causes) { + public void onDataTreeFailed(Collection causes) { } @@ -81,7 +79,8 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener { executorService = Executors.newSingleThreadScheduledExecutor(); final SettableFuture settableFuture = SettableFuture.create(); - scheduledFuture = executorService.scheduleAtFixedRate(new CheckFinishedTask(settableFuture), 0, 1, TimeUnit.SECONDS); + scheduledFuture = executorService.scheduleAtFixedRate(new CheckFinishedTask(settableFuture), + 0, 1, TimeUnit.SECONDS); return settableFuture; } @@ -99,7 +98,7 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener { @Override public void run() { - if (System.nanoTime() - lastNotifTimestamp.get() > (SECOND_AS_NANO * 4)) { + if (System.nanoTime() - lastNotifTimestamp.get() > SECOND_AS_NANO * 4) { scheduledFuture.cancel(false); future.set(null); @@ -107,5 +106,4 @@ public class IdIntsDOMDataTreeLIstener implements DOMDataTreeListener { } } } - }