Merge "Move adsal into its own subdirectory."
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / flowprogrammer / IFlowProgrammerService.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.sal.flowprogrammer;
10
11 import org.opendaylight.controller.sal.core.Node;
12 import org.opendaylight.controller.sal.utils.Status;
13
14 /**
15  * Interface that defines the methods available to the functional modules above
16  * SAL for installing/modifying/removing flows on a network node
17  */
18 public interface IFlowProgrammerService {
19     /**
20      * Synchronously add a flow to the network node
21      *
22      * @param node
23      *            The target network node
24      * @param flow
25      *            The flow to install
26      * @return The status of this request
27      */
28     Status addFlow(Node node, Flow flow);
29
30     /**
31      * Synchronously modify existing flow on the switch
32      *
33      * @param node
34      *            The target network node
35      * @param oldFlow
36      *            The existing flow to modify
37      * @param newFlow
38      *            The new flow to install
39      * @return The status of this request
40      */
41     Status modifyFlow(Node node, Flow oldFlow, Flow newFlow);
42
43     /**
44      * Synchronously remove the flow from the network node
45      *
46      * @param node
47      *            The target network node
48      * @param flow
49      *            The flow to remove
50      * @return The status of this request
51      */
52     Status removeFlow(Node node, Flow flow);
53
54     /**
55      * Asynchronously add a flow to the network node
56      *
57      * @param node
58      *            The target network node
59      * @param flow
60      *            The flow to install
61      * @return The status of this request containing the unique request id
62      */
63     Status addFlowAsync(Node node, Flow flow);
64
65     /**
66      * Asynchronously modify existing flow on the switch
67      *
68      * @param node
69      *            The target network node
70      * @param oldFlow
71      *            The existing flow to modify
72      * @param newFlow
73      *            The new flow to install
74      * @return The status of this request containing the unique request id
75      */
76     Status modifyFlowAsync(Node node, Flow oldFlow, Flow newFlow);
77
78     /**
79      * Asynchronously remove the flow from the network node
80      *
81      * @param node
82      *            The target network node
83      * @param flow
84      *            The flow to remove
85      * @return The status of this request containing the unique request id
86      */
87     Status removeFlowAsync(Node node, Flow flow);
88
89     /**
90      * Remove all flows present on the network node
91      *
92      * @param node
93      *            The target network node
94      * @return The status of this request containing the unique request id
95      */
96     Status removeAllFlows(Node node);
97
98     /**
99      * Send Barrier message synchronously. The caller will be blocked until the
100      * solicitation response arrives.
101      *
102      * Solicit the network node to report whether all the requests sent so far
103      * are completed. When this call is done, caller knows that all past flow
104      * operations requested to the node in asynchronous fashion were satisfied
105      * by the network node and that in case of any failure, a message was sent
106      * to the controller.
107      *
108      * @param node
109      *            The network node to solicit
110      * @return The status of this request containing the unique request id
111      */
112     Status syncSendBarrierMessage(Node node);
113
114     /**
115      * Send Barrier message asynchronously. The caller is not blocked.
116      *
117      * Solicit the network node to report whether all the requests sent so far
118      * are completed. When this call is done, caller knows that all past flow
119      * operations requested to the node in asynchronous fashion were satisfied
120      * by the network node and that in case of any failure, a message was sent
121      * to the controller.
122      *
123      * @param node
124      *            The network node to solicit
125      * @return The status of this request containing the unique request id
126      */
127     Status asyncSendBarrierMessage(Node node);
128 }