X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fopenflow%2Fmd%2Fcore%2Fsal%2FOFRpcTaskUtil.java;h=73171cbfb508ffb15ebfa76dd077b26133785185;hb=ecb084d1839da3acf6ad6d9660abb7ca07ad4020;hp=58211395291518639a7d9efe428e19e289c83a1f;hpb=25fd0c6b562cfe8115fb18c3eab07a8ab5270b2d;p=openflowplugin.git diff --git a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskUtil.java b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskUtil.java index 5821139529..73171cbfb5 100644 --- a/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskUtil.java +++ b/openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskUtil.java @@ -18,10 +18,8 @@ import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher; import org.opendaylight.openflowplugin.api.openflow.md.core.sal.NotificationComposer; import org.opendaylight.openflowplugin.api.statistics.MessageSpy; -import org.opendaylight.openflowplugin.openflow.md.core.MessageFactory; -import org.opendaylight.openflowplugin.api.openflow.md.core.session.IMessageDispatchService; -import org.opendaylight.openflowplugin.api.openflow.md.core.session.SessionContext; import org.opendaylight.openflowplugin.openflow.md.util.RpcInputOutputTuple; +import org.opendaylight.openflowplugin.openflow.md.util.TaskUtil; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput; @@ -40,7 +38,6 @@ import com.google.common.collect.Lists; import com.google.common.util.concurrent.AsyncFunction; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.JdkFutureAdapters; import com.google.common.util.concurrent.ListenableFuture; /** @@ -63,7 +60,7 @@ public abstract class OFRpcTaskUtil { Collection errors = null; if (Objects.firstNonNull(isBarrier, Boolean.FALSE)) { RpcInputOutputTuple>> sendBarrierRpc = - sendBarrier(taskContext.getSession(), cookie, taskContext.getMessageService()); + TaskUtil.sendBarrier(taskContext.getSession(), cookie, taskContext.getMessageService()); Future> barrierFuture = sendBarrierRpc.getOutput(); try { RpcResult barrierResult = barrierFuture.get( @@ -90,22 +87,6 @@ public abstract class OFRpcTaskUtil { return errors; } - /** - * @param session - * @param cookie - * @param messageService - * @return barrier response - */ - protected static RpcInputOutputTuple>> sendBarrier(SessionContext session, - SwitchConnectionDistinguisher cookie, IMessageDispatchService messageService) { - BarrierInput barrierInput = MessageFactory.createBarrier( - session.getFeatures().getVersion(), session.getNextXid()); - Future> barrierResult = messageService.barrier(barrierInput, cookie); - ListenableFuture> output = JdkFutureAdapters.listenInPoolThread(barrierResult); - - return new RpcInputOutputTuple<>(barrierInput, output); - } - /** * @param task of rpc * @param originalResult @@ -170,7 +151,7 @@ public abstract class OFRpcTaskUtil { @Override public ListenableFuture> apply(final RpcResult input) throws Exception { if (input.isSuccessful()) { - RpcInputOutputTuple>> sendBarrierRpc = sendBarrier( + RpcInputOutputTuple>> sendBarrierRpc = TaskUtil.sendBarrier( task.getSession(), task.getCookie(), task.getMessageService()); ListenableFuture> barrierTxResult = Futures.transform( sendBarrierRpc.getOutput(),