package org.opendaylight.openflowplugin.impl.statistics;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.FutureCallback;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
import org.opendaylight.openflowplugin.api.openflow.device.RequestContext;
+import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext;
import org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext;
+import org.opendaylight.openflowplugin.impl.rpc.listener.ItemLifecycleListenerImpl;
import org.opendaylight.openflowplugin.impl.services.RequestContextUtil;
import org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringOnTheFlyService;
import org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringService;
private static final Logger LOG = LoggerFactory.getLogger(StatisticsContextImpl.class);
private static final String CONNECTION_CLOSED = "Connection closed.";
+
+ private final ItemLifecycleListener itemLifeCycleListener;
private final Collection<RequestContext<?>> requestContexts = new HashSet<>();
private final DeviceContext deviceContext;
private final DeviceState devState;
statListForCollecting.add(MultipartType.OFPMPQUEUE);
}
collectingStatType = ImmutableList.<MultipartType>copyOf(statListForCollecting);
+ itemLifeCycleListener = new ItemLifecycleListenerImpl(deviceContext);
}
@Override
this.pollTimeout = pollTimeout;
}
+ @Override
+ public Optional<Timeout> getPollTimeout() {
+ return Optional.fromNullable(pollTimeout);
+ }
+
void statChainFuture(final Iterator<MultipartType> iterator, final SettableFuture<Boolean> resultFuture) {
if ( ! iterator.hasNext()) {
resultFuture.set(Boolean.TRUE);
this.statisticsGatheringOnTheFlyService = statisticsGatheringOnTheFlyService;
}
+ @Override
+ public ItemLifecycleListener getItemLifeCycleListener() {
+ return itemLifeCycleListener;
+ }
}