Merge "Abstract service NodeId remove"
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / statistics / StatisticsContext.java
index e7c54940ff82a330e824b819c88f668a2defea27..ec598c98abbffd537121e26bc084d7511570c0dc 100644 (file)
@@ -8,19 +8,32 @@
 
 package org.opendaylight.openflowplugin.api.openflow.statistics;
 
-import com.google.common.base.Optional;
 import com.google.common.util.concurrent.ListenableFuture;
 import io.netty.util.Timeout;
+import org.opendaylight.openflowplugin.api.openflow.OFPContext;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
 
+import java.util.Optional;
+
 /**
- * Created by Martin Bobak <mbobak@cisco.com> on 27.2.2015.
+ * Context for statistics
  */
-public interface StatisticsContext extends RequestContextStack, AutoCloseable {
+public interface StatisticsContext extends RequestContextStack, AutoCloseable, OFPContext {
 
     ListenableFuture<Boolean> gatherDynamicData();
 
+    /**
+     * Method has to be called from DeviceInitialization Method, otherwise
+     * we are not able to poll anything. Statistics Context normally initialize
+     * this part by initialization process but we don't have this information
+     * in initialization phase and we have to populate whole list after every
+     * device future collecting. Because device future collecting set DeviceState
+     * and we creating marks for the correct kind of stats from DeviceState.
+     */
+    void statListForCollectingInitialization();
+
     /**
      * @param pollTimeout handle to nearest scheduled statistics poll
      */
@@ -35,4 +48,10 @@ public interface StatisticsContext extends RequestContextStack, AutoCloseable {
      * @return dedicated item life cycle change listener (per device)
      */
     ItemLifecycleListener getItemLifeCycleListener();
+
+    @Override
+    void close();
+
+    void setSchedulingEnabled(boolean schedulingEnabled);
+    boolean isSchedulingEnabled();
 }