Bug 5596 Created lifecycle service
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / statistics / StatisticsContext.java
index 9bc2cda8293d1d403459345922d1de590057ec22..d681cfde8fe36601b14b516127793cc83ef667c4 100644 (file)
@@ -8,20 +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.device.DeviceContext;
+import java.util.Optional;
+import org.opendaylight.openflowplugin.api.openflow.OFPContext;
+import org.opendaylight.openflowplugin.api.openflow.OFPManager;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack;
 import org.opendaylight.openflowplugin.api.openflow.rpc.listener.ItemLifecycleListener;
 
 /**
- * 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 {
 
+    /**
+     * Gather data from device
+     * @return true if gathering was successful
+     */
     ListenableFuture<Boolean> gatherDynamicData();
 
+    /**
+     * Initial data gathering
+     * @return true if gathering was successful
+     */
+    ListenableFuture<Boolean> initialGatherDynamicData();
+
     /**
      * Method has to be called from DeviceInitialization Method, otherwise
      * we are not able to poll anything. Statistics Context normally initialize
@@ -47,12 +59,6 @@ public interface StatisticsContext extends RequestContextStack, AutoCloseable {
      */
     ItemLifecycleListener getItemLifeCycleListener();
 
-    /**
-     * Statistics Context has to be able to return own DeviceCtx
-     * @return {@link DeviceContext}
-     */
-    DeviceContext getDeviceContext();
-
     @Override
     void close();