ForwardingRulesManager to expose async flow api
[controller.git] / opendaylight / forwardingrulesmanager / api / src / main / java / org / opendaylight / controller / forwardingrulesmanager / IForwardingRulesManager.java
index d0efe4a83f7782d8225b79d483f446df49c5d280..78917c9c807752232c9e8af4d25f007fd1f7446b 100644 (file)
@@ -73,12 +73,90 @@ public interface IForwardingRulesManager {
      * not valid an error code is returned. If the existing flow is equal to the
      * passed one it will be a no op and success code is returned.
      * 
+     * 
      * @param newone
      *            the new flow entry to install
      * @return the {@code Status} object indicating the result of this action
      */
     public Status modifyOrAddFlowEntry(FlowEntry newone);
 
+    /**
+     * It requests FRM to install the passed Flow Entry through an asynchronous
+     * call. A unique request id is returned to the caller. FRM will request the
+     * SDN protocol plugin to install the flow on the network node. As immediate
+     * result of this asynchronous call, FRM will update its flow database as if
+     * the flow was successfully installed.
+     * 
+     * @param flow
+     *            the flow entry to install
+     * @return the status of this request containing the request id associated
+     *         to this asynchronous request
+     */
+    public Status installFlowEntryAsync(FlowEntry flow);
+
+    /**
+     * It requests FRM to remove the passed Flow Entry through an asynchronous
+     * call. A unique request id is returned to the caller. FRM will request the
+     * SDN protocol plugin to uninstall the flow from the network node. As
+     * immediate result of this asynchronous call, FRM will update its flow
+     * database as if the flow was successfully installed.
+     * 
+     * @param flow
+     *            the flow entry to uninstall
+     * @return the status of this request containing the unique id associated to
+     *         this asynchronous request
+     */
+    public Status uninstallFlowEntryAsync(FlowEntry flow);
+
+    /**
+     * It requests FRM to replace the currently installed Flow Entry with the
+     * new one through an asynchronous call. A unique request id is returned to
+     * the caller. It is up to the SDN protocol plugin to decide how to convey
+     * this message to the network node. It could be a delete + add or a single
+     * modify message depending on the SDN protocol specifications. If the
+     * current flow is equal to the new one it will be a no op.
+     * 
+     * @param current
+     *            the current flow entry to modify
+     * @param newone
+     *            the new flow entry which will replace the current one
+     * @return the status of this request containing the request id associated
+     *         to this asynchronous request
+     */
+    public Status modifyFlowEntryAsync(FlowEntry current, FlowEntry newone);
+
+    /**
+     * It requests the FRM to replace the currently installed Flow Entry with
+     * the new one through an asynchronous call. A unique request id is returned
+     * to the caller. The currently installed entry is derived by the Match
+     * portion of the passed Flow. FRM looks in its database for a previously
+     * installed FlowEntry which Match equals the Match of the passed Flow. If
+     * it finds it, it will request the SDN protocol plugin to replace the
+     * existing flow with the new one on the network node. If it does not find
+     * it, it will request plugin to add the new flow. If the passed entry is
+     * not valid a zero request id is returned. If the existing flow is equal to
+     * the passed one it will be a no op.
+     * 
+     * @param newone
+     *            the new flow entry to install
+     * @return the unique id associated to this request. In case of not
+     *         acceptable request -1 will be returned.
+     */
+    public Status modifyOrAddFlowEntryAsync(FlowEntry newone);
+
+    /**
+     * Requests ForwardingRulesManager to solicit the network node to inform
+     * us about the status of his execution on the asynchronous requests that
+     * were sent to it so far. It is a way for an application to poke the
+     * network node in order to get a feedback asap on the asynchronous
+     * requests generated by the application. It is a non-blocking call
+     * and does not guarantee the node will respond in any given time. 
+     * 
+     * @param node
+     *          The network node to solicit a response
+     */
+    public void solicitStatusResponse(Node node);
+
     /**
      * Check whether the passed flow entry conflicts with the Container flows
      * 
@@ -209,7 +287,7 @@ public interface IForwardingRulesManager {
      * @param name
      *            the flow name
      * @param n
-     *            the netwrok node identifier
+     *            the network node identifier
      * @return the {@code FlowConfig} object
      */
     public FlowConfig getStaticFlow(String name, Node n);