2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.api.openflow.statistics;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import io.netty.util.Timeout;
13 import java.util.Optional;
14 import org.opendaylight.openflowplugin.api.openflow.OFPContext;
15 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
16 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
19 * Context for statistics
21 public interface StatisticsContext extends RequestContextStack, AutoCloseable, OFPContext {
24 * Gather data from device
25 * @return true if gathering was successful
27 ListenableFuture<Boolean> gatherDynamicData();
30 * Initial data gathering
31 * @return true if gathering was successful
33 ListenableFuture<Boolean> initialGatherDynamicData();
36 * Method has to be called from DeviceInitialization Method, otherwise
37 * we are not able to poll anything. Statistics Context normally initialize
38 * this part by initialization process but we don't have this information
39 * in initialization phase and we have to populate whole list after every
40 * device future collecting. Because device future collecting set DeviceState
41 * and we creating marks for the correct kind of stats from DeviceState.
43 void statListForCollectingInitialization();
46 * @param pollTimeout handle to nearest scheduled statistics poll
48 void setPollTimeout(Timeout pollTimeout);
51 * @return handle to currently scheduled statistics polling
53 Optional<Timeout> getPollTimeout();
56 * @return dedicated item life cycle change listener (per device)
58 ItemLifecycleListener getItemLifeCycleListener();
63 void setSchedulingEnabled(boolean schedulingEnabled);
64 boolean isSchedulingEnabled();