- Plugin sends Barrier msg every 100 async msgs (configurable thru config.ini: of...
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / ISwitch.java
index a15c2e5c715c95d89203a15b25dc95ebc185506c..ee46ce2302a24fd9ce3b7160cafe965a3c4a07e8 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
  *
@@ -20,169 +19,205 @@ import org.openflow.protocol.OFStatisticsRequest;
 
 /**
  * This interface defines an abstraction of an Open Flow Switch.
- *
+ * 
  */
 public interface ISwitch {
-       /**
-        * Gets a unique XID.
-        * @return XID
-        */
-       public int getNextXid();
-
-       /**
-        * Returns the Switch's ID.
-        * @return the Switch's ID
-        */
-       public Long getId();
-
-       /**
-        * Returns the Switch's table numbers supported by datapath 
-        * @return the tables
-        */
-       public Byte getTables();
-
-       /**
-        * Returns the Switch's bitmap of supported ofp_action_type
-        * @return the actions
-        */
-       public Integer getActions();
-
-       /**
-        * Returns the Switch's bitmap of supported ofp_capabilities
-        * @return the capabilities
-        */
-       public Integer getCapabilities();
-
-       /**
-        * Returns the Switch's buffering capacity in Number of Pkts
-        * @return the buffers
-        */
-       public Integer getBuffers();
-
-       /**
-        * Returns the Date when the switch was connected.
-        * @return Date The date when the switch was connected
-        */
-       public Date getConnectedDate();
-
-       /**
-        * This method puts the message in an outgoing priority queue with normal
-        * priority. It will be served after high priority messages. The method
-        * should be used for non-critical messages such as statistics request,
-        * discovery packets, etc. An unique XID is generated automatically and
-        * inserted into the message.
-        * 
-        * @param msg The OF message to be sent
-        * @return The XID used
-        */
-       public Integer asyncSend(OFMessage msg);
-
-       /**
-        * This method puts the message in an outgoing priority queue with normal
-        * priority. It will be served after high priority messages. The method
-        * should be used for non-critical messages such as statistics request,
-        * discovery packets, etc. The specified XID is inserted into the message.
-        * 
-        * @param msg The OF message to be Sent
-        * @param xid The XID to be used in the message
-        * @return The XID used
-        */
-       public Integer asyncSend(OFMessage msg, int xid);
-
-       /**
-        * This method puts the message in an outgoing priority queue with high
-        * priority. It will be served first before normal priority messages. The
-        * method should be used for critical messages such as hello, echo reply
-        * etc. An unique XID is generated automatically and inserted into the
-        * message.
-        * 
-        * @param msg The OF message to be sent
-        * @return The XID used
-        */
-       public Integer asyncFastSend(OFMessage msg);
-
-       /**
-        * This method puts the message in an outgoing priority queue with high
-        * priority. It will be served first before normal priority messages. The
-        * method should be used for critical messages such as hello, echo reply
-        * etc. The specified XID is inserted into the message.
-        * 
-        * @param msg The OF message to be sent
-        * @return The XID used
-        */
-       public Integer asyncFastSend(OFMessage msg, int xid);
-
-       /**
-        * Sends the OF message followed by a Barrier Request with a unique XID which is automatically generated,
-        * and waits for a result from the switch.
-        * @param msg The message to be sent
-        * @return An Object which has one of the followings instances/values:
-        * Boolean with value true to indicate the message has been successfully processed and acknowledged by the switch;
-        * Boolean with value false to indicate the message has failed to be processed by the switch within a period of time or
-        * OFError to indicate that the message has been denied by the switch which responded with OFError.
-        */
-       public Object syncSend(OFMessage msg);
-
-       /**
-        * Returns a map containing all OFPhysicalPorts of this switch.
-        * @return The Map of OFPhysicalPort
-        */
-       public Map<Short, OFPhysicalPort> getPhysicalPorts();
-
-       /**
-        * Returns a Set containing all port IDs of this switch.
-        * @return The Set of port ID
-        */
-       public Set<Short> getPorts();
-
-       /**
-        * Returns OFPhysicalPort of the specified portNumber of this switch.
-        * @param portNumber The port ID
-        * @return OFPhysicalPort for the specified PortNumber
-        */
-       public OFPhysicalPort getPhysicalPort(Short portNumber);
-
-       /**
-        * Returns the bandwidth of the specified portNumber of this switch.
-        * @param portNumber the port ID
-        * @return bandwidth
-        */
-       public Integer getPortBandwidth(Short portNumber);
-
-       /**
-        * Returns True if the port is enabled,
-        * @param portNumber 
-        * @return True if the port is enabled
-        */
-       public boolean isPortEnabled(short portNumber);
-
-       /**
-        * Returns True if the port is enabled.
-        * @param port
-        * @return True if the port is enabled
-        */
-       public boolean isPortEnabled(OFPhysicalPort port);
-
-       /**
-        * Returns a list containing all enabled ports of this switch.
-        * @return: List containing all enabled ports of this switch
-        */
-       public List<OFPhysicalPort> getEnabledPorts();
-
-       /**
-        * Sends OFStatisticsRequest  with a unique XID generated automatically and waits for a result from the switch.
-        * @param req the OF Statistic Request to be sent
-        * @return Object has one of the following instances/values::
-        * List<OFStatistics>, a list  of statistics records received from the switch as response from the request;
-        *      OFError if the switch failed handle the request or
-        * NULL if timeout has occurred while waiting for the response.
-        */
-       public Object getStatistics(OFStatisticsRequest req);
-
-       /**
-        * Returns true if the switch has reached the operational state (has sent FEATURE_REPLY to the controller).
-        * @return true if the switch is operational
-        */
-       public boolean isOperational();
-
+    /**
+     * Gets a unique XID.
+     * 
+     * @return XID
+     */
+    public int getNextXid();
+
+    /**
+     * Returns the Switch's ID.
+     * 
+     * @return the Switch's ID
+     */
+    public Long getId();
+
+    /**
+     * Returns the Switch's table numbers supported by datapath
+     * 
+     * @return the tables
+     */
+    public Byte getTables();
+
+    /**
+     * Returns the Switch's bitmap of supported ofp_action_type
+     * 
+     * @return the actions
+     */
+    public Integer getActions();
+
+    /**
+     * Returns the Switch's bitmap of supported ofp_capabilities
+     * 
+     * @return the capabilities
+     */
+    public Integer getCapabilities();
+
+    /**
+     * Returns the Switch's buffering capacity in Number of Pkts
+     * 
+     * @return the buffers
+     */
+    public Integer getBuffers();
+
+    /**
+     * Returns the Date when the switch was connected.
+     * 
+     * @return Date The date when the switch was connected
+     */
+    public Date getConnectedDate();
+
+    /**
+     * This method puts the message in an outgoing priority queue with normal
+     * priority. It will be served after high priority messages. The method
+     * should be used for non-critical messages such as statistics request,
+     * discovery packets, etc. An unique XID is generated automatically and
+     * inserted into the message.
+     * 
+     * @param msg
+     *            The OF message to be sent
+     * @return The XID used
+     */
+    public Integer asyncSend(OFMessage msg);
+
+    /**
+     * This method puts the message in an outgoing priority queue with normal
+     * priority. It will be served after high priority messages. The method
+     * should be used for non-critical messages such as statistics request,
+     * discovery packets, etc. The specified XID is inserted into the message.
+     * 
+     * @param msg
+     *            The OF message to be Sent
+     * @param xid
+     *            The XID to be used in the message
+     * @return The XID used
+     */
+    public Integer asyncSend(OFMessage msg, int xid);
+
+    /**
+     * This method puts the message in an outgoing priority queue with high
+     * priority. It will be served first before normal priority messages. The
+     * method should be used for critical messages such as hello, echo reply
+     * etc. An unique XID is generated automatically and inserted into the
+     * message.
+     * 
+     * @param msg
+     *            The OF message to be sent
+     * @return The XID used
+     */
+    public Integer asyncFastSend(OFMessage msg);
+
+    /**
+     * This method puts the message in an outgoing priority queue with high
+     * priority. It will be served first before normal priority messages. The
+     * method should be used for critical messages such as hello, echo reply
+     * etc. The specified XID is inserted into the message.
+     * 
+     * @param msg
+     *            The OF message to be sent
+     * @return The XID used
+     */
+    public Integer asyncFastSend(OFMessage msg, int xid);
+
+    /**
+     * Sends the OF message followed by a Barrier Request with a unique XID
+     * which is automatically generated, and waits for a result from the switch.
+     * 
+     * @param msg
+     *            The message to be sent
+     * @return An Object which has one of the followings instances/values:
+     *         Boolean with value true to indicate the message has been
+     *         successfully processed and acknowledged by the switch; Boolean
+     *         with value false to indicate the message has failed to be
+     *         processed by the switch within a period of time or OFError to
+     *         indicate that the message has been denied by the switch which
+     *         responded with OFError.
+     */
+    public Object syncSend(OFMessage msg);
+
+    /**
+     * Returns a map containing all OFPhysicalPorts of this switch.
+     * 
+     * @return The Map of OFPhysicalPort
+     */
+    public Map<Short, OFPhysicalPort> getPhysicalPorts();
+
+    /**
+     * Returns a Set containing all port IDs of this switch.
+     * 
+     * @return The Set of port ID
+     */
+    public Set<Short> getPorts();
+
+    /**
+     * Returns OFPhysicalPort of the specified portNumber of this switch.
+     * 
+     * @param portNumber
+     *            The port ID
+     * @return OFPhysicalPort for the specified PortNumber
+     */
+    public OFPhysicalPort getPhysicalPort(Short portNumber);
+
+    /**
+     * Returns the bandwidth of the specified portNumber of this switch.
+     * 
+     * @param portNumber
+     *            the port ID
+     * @return bandwidth
+     */
+    public Integer getPortBandwidth(Short portNumber);
+
+    /**
+     * Returns True if the port is enabled,
+     * 
+     * @param portNumber
+     * @return True if the port is enabled
+     */
+    public boolean isPortEnabled(short portNumber);
+
+    /**
+     * Returns True if the port is enabled.
+     * 
+     * @param port
+     * @return True if the port is enabled
+     */
+    public boolean isPortEnabled(OFPhysicalPort port);
+
+    /**
+     * Returns a list containing all enabled ports of this switch.
+     * 
+     * @return: List containing all enabled ports of this switch
+     */
+    public List<OFPhysicalPort> getEnabledPorts();
+
+    /**
+     * Sends OFStatisticsRequest with a unique XID generated automatically and
+     * waits for a result from the switch.
+     * 
+     * @param req
+     *            the OF Statistic Request to be sent
+     * @return Object has one of the following instances/values::
+     *         List<OFStatistics>, a list of statistics records received from
+     *         the switch as response from the request; OFError if the switch
+     *         failed handle the request or NULL if timeout has occurred while
+     *         waiting for the response.
+     */
+    public Object getStatistics(OFStatisticsRequest req);
+
+    /**
+     * Returns true if the switch has reached the operational state (has sent
+     * FEATURE_REPLY to the controller).
+     * 
+     * @return true if the switch is operational
+     */
+    public boolean isOperational();
+
+    /**
+     * Sends synchronous Barrier message 
+     */
+    public Object sendBarrierMessage();
 }