Merge "Bug 5916: He plugin: Wake up statistics collector thread if RPC fails."
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceState.java
index 09036fd364089a92fadeb0a7e63ba519ba3a8bfc..0ca7e2df60eb99d58c089dde12e859b1ff83e81d 100644 (file)
@@ -8,27 +8,10 @@
 
 package org.opendaylight.openflowplugin.api.openflow.device;
 
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
- * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
+ * Holder of device's structure
  */
-public interface DeviceState {
-
-    /**
-     * @return id of encapsulated node
-     */
-    NodeId getNodeId();
-
-    /**
-     * @return the features of corresponding switch
-     */
-    GetFeaturesOutput getFeatures();
+public interface DeviceState extends DeviceSynchronizeListener, DeviceValidListener {
 
     /**
      * @return true if this session is valid
@@ -36,78 +19,76 @@ public interface DeviceState {
     boolean isValid();
 
     /**
-     * @param valid the valid to set
+     * Return true if we have relevant meter information
+     * from device
+     *
+     * @return
      */
-    void setValid(boolean valid);
+    boolean isMetersAvailable();
 
     /**
-     * Returns a map containing all OFPhysicalPorts of this switch.
-     *
-     * @return The Map of OFPhysicalPort
+     * Set information about meter statistics availability.
      */
-    Map<Long, PortGrouping> getPhysicalPorts();
+    void setMeterAvailable(boolean available);
 
     /**
-     * Returns a map containing all bandwidths for all OFPorts of this switch.
+     * Return true if we have relevant group information
+     * from device
      *
-     * @return The Map of bandwidths for all OFPorts
+     * @return
      */
-    Map<Long, Boolean> getPortsBandwidth();
+    boolean isGroupAvailable();
 
     /**
-     * Returns a Set containing all port IDs of this switch.
-     *
-     * @return The Set of port ID
+     * Set information about group statistics availability.
      */
-    Set<Long> getPorts();
+    void setGroupAvailable(boolean available);
 
     /**
-     * Returns OFPhysicalPort of the specified portNumber of this switch.
+     * Method returns true if initial statistics data were collected and written to DS.
      *
-     * @param portNumber The port ID
-     * @return OFPhysicalPort for the specified PortNumber
+     * @return
      */
-    PortGrouping getPhysicalPort(Long portNumber);
+    boolean deviceSynchronized();
 
     /**
-     * Returns the bandwidth of the specified portNumber of this switch.
+     * Method returns true, if device capabilities provides flow statistics.
      *
-     * @param portNumber the port ID
-     * @return bandwidth
+     * @return
      */
-    Boolean getPortBandwidth(Long portNumber);
+    boolean isFlowStatisticsAvailable();
+
+    void setFlowStatisticsAvailable(boolean available);
 
     /**
-     * Returns True if the port is enabled,
+     * Method returns true, if device capabilities provides table statistics.
      *
-     * @param portNumber
-     * @return True if the port is enabled
+     * @return
      */
-    boolean isPortEnabled(long portNumber);
+    boolean isTableStatisticsAvailable();
+
+    void setTableStatisticsAvailable(boolean available);
 
     /**
-     * Returns True if the port is enabled.
+     * Method returns true, if device capabilities provides flow statistics.
      *
-     * @param port
-     * @return True if the port is enabled
+     * @return
      */
-    boolean isPortEnabled(PortGrouping port);
+    boolean isPortStatisticsAvailable();
+
+    void setPortStatisticsAvailable(boolean available);
 
     /**
-     * Returns a list containing all enabled ports of this switch.
+     * Method returns true, if device capabilities provides queue statistics.
      *
-     * @return List containing all enabled ports of this switch
+     * @return
      */
-    List<PortGrouping> getEnabledPorts();
+    boolean isQueueStatisticsAvailable();
 
-    /**
-     * @return the unique xid for this session
-     */
-    Long getNextXid();
+    void setQueueStatisticsAvailable(boolean available);
 
-    /**
-     * @return seed value for random operations
-     */
-    int getSeed();
+    boolean isStatisticsPollingEnabled();
+
+    void setStatisticsPollingEnabledProp(boolean statPollEnabled);
 
 }