import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collections;
import java.util.List;
-
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
private boolean finished = false;
private final EventIdentifier doneEventIdentifier;
private final TxFacade txFacade;
- private final DeviceState deviceState;
public MultipartRequestOnTheFlyCallback(final RequestContext<List<MultipartReply>> context,
final EventIdentifier eventIdentifier,
final DeviceInfo deviceInfo,
final DeviceFlowRegistry registry,
- final TxFacade txFacade,
- final DeviceState deviceState) {
+ final TxFacade txFacade) {
super(context, requestType, messageSpy, eventIdentifier);
this.deviceInfo = deviceInfo;
this.registry = registry;
this.txFacade = txFacade;
- this.deviceState = deviceState;
//TODO: this is focused on flow stats only - need more general approach if used for more than flow stats
doneEventIdentifier = new EventIdentifier(MultipartType.OFPMPFLOW.name(), deviceInfo.getNodeId().toString());
//TODO: following part is focused on flow stats only - need more general approach if used for more than flow stats
ListenableFuture<Void> future;
if (virgin) {
- future = StatisticsGatheringUtils.deleteAllKnownFlows(deviceInfo, registry, txFacade, deviceState);
+ future = StatisticsGatheringUtils.deleteAllKnownFlows(deviceInfo, registry, txFacade);
virgin = false;
} else {
future = Futures.immediateFuture(null);
EventsTimeCounter.markEnd(getEventIdentifier());
final RpcResult<List<MultipartReply>> rpcResult = RpcResultBuilder.success(Collections.<MultipartReply>emptyList()).build();
spyMessage(MessageSpy.STATISTIC_GROUP.FROM_SWITCH_TRANSLATE_OUT_SUCCESS);
- setResult(rpcResult);
txFacade.submitTransaction();
+ setResult(rpcResult);
finished = true;
}
}