Remove deprecated PreLithium Tx context classes and related code
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / SingleCommitCohortProxy.java
index e340859321c6ae7231fcc52b7b4e6ab80a9efd30..0823c902ae4947ede13b3807a70a04cc46546704 100644 (file)
@@ -7,10 +7,7 @@
  */
 package org.opendaylight.controller.cluster.datastore;
 
-import akka.actor.ActorSelection;
-import akka.dispatch.Futures;
 import akka.dispatch.OnComplete;
-import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Arrays;
@@ -63,11 +60,6 @@ class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort<Object> {
 
                 operationCallbackRef.get().success();
 
-                if(cohortResponse instanceof ActorSelection) {
-                    handlePreLithiumActorCohort((ActorSelection)cohortResponse, returnFuture);
-                    return;
-                }
-
                 LOG.debug("Tx {} successfully completed direct commit", transactionId);
 
                 // The Future was the result of a direct commit to the shard, essentially eliding the
@@ -101,22 +93,4 @@ class SingleCommitCohortProxy extends AbstractThreePhaseCommitCohort<Object> {
     List<Future<Object>> getCohortFutures() {
         return Arrays.asList(cohortFuture);
     }
-
-    private void handlePreLithiumActorCohort(ActorSelection actorSelection, final SettableFuture<Boolean> returnFuture) {
-        // Handle backwards compatibility. An ActorSelection response would be returned from a
-        // pre-Lithium version. In this case delegate to a ThreePhaseCommitCohortProxy.
-        delegateCohort = new ThreePhaseCommitCohortProxy(actorContext,
-                Arrays.asList(Futures.successful(actorSelection)), transactionId);
-        com.google.common.util.concurrent.Futures.addCallback(delegateCohort.canCommit(), new FutureCallback<Boolean>() {
-            @Override
-            public void onSuccess(Boolean canCommit) {
-                returnFuture.set(canCommit);
-            }
-
-            @Override
-            public void onFailure(Throwable t) {
-                returnFuture.setException(t);
-            }
-        });
-    }
 }