import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import java.util.List;
+import java.util.concurrent.Future;
+import javax.annotation.Nullable;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
import org.opendaylight.openflowplugin.impl.services.RequestInputUtils;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.StoreStatsGrouping;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import javax.annotation.Nullable;
-import java.util.List;
-import java.util.concurrent.Future;
-
/**
* The abstract direct statistics service.
* This abstract service provides wrappers and tools for all other derived statistics services.
if (input.isSuccessful()) {
storeStatistics(input.getResult());
- getDeviceContext().submitTransaction(); // TODO: If submitTransaction will ever return future, chain it
+ getTxFacade().submitTransaction(); // TODO: If submitTransaction will ever return future, chain it
}
return Futures.immediateFuture(input);
};
private final MultipartType multipartType;
+ private final ConvertorExecutor convertorExecutor;
private final OpenflowVersion ofVersion = OpenflowVersion.get(getVersion());
-
/**
* Instantiates a new Abstract direct statistics service.
*
* @param multipartType the multipart type
* @param requestContextStack the request context stack
* @param deviceContext the device context
+ * @param convertorExecutor
*/
- protected AbstractDirectStatisticsService(MultipartType multipartType, RequestContextStack requestContextStack, DeviceContext deviceContext) {
+ protected AbstractDirectStatisticsService(MultipartType multipartType, RequestContextStack requestContextStack,
+ DeviceContext deviceContext, ConvertorExecutor convertorExecutor) {
super(requestContextStack, deviceContext);
this.multipartType = multipartType;
+ this.convertorExecutor = convertorExecutor;
+ }
+
+ protected ConvertorExecutor getConvertorExecutor() {
+ return convertorExecutor;
}
/**
final ListenableFuture<RpcResult<List<MultipartReply>>> rpcReply = handleServiceCall(input);
ListenableFuture<RpcResult<O>> rpcResult = Futures.transform(rpcReply, resultTransformFunction);
- if (input.isStoreStats()) {
+ if (Boolean.TRUE.equals(input.isStoreStats())) {
rpcResult = Futures.transform(rpcResult, resultStoreFunction);
}