Bug-2827: role switch proposal
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / md / core / session / IMessageDispatchService.java
1 /**
2  * Copyright IBM Corporation, 2013.  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 package org.opendaylight.openflowplugin.api.openflow.md.core.session;
9
10 import java.util.concurrent.Future;
11
12 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncOutput;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigOutput;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInput;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigInput;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetQueueConfigOutput;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInput;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInput;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInput;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestInput;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.RoleRequestOutput;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetAsyncInput;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.TableModInput;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.service.rev131107.UpdatePortOutput;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
39 import org.opendaylight.yangtools.yang.common.RpcResult;
40
41 /**
42  * Message Dispatch Service to send the message to switch.
43  *
44  * @author AnilGujele
45  *
46  */
47 public interface IMessageDispatchService {
48
49     public static final String CONNECTION_ERROR_MESSAGE = "Session for the cookie is invalid. Reason: "
50     + "the switch has been recently disconnected OR inventory provides outdated information.";
51
52     /**
53      * send barrier message to switch
54      *
55      * @param input
56      *            - message
57      * @param cookie
58      *            - to identify connection if null then feel free to send via
59      *            any connection
60      * @return - the future
61      */
62     Future<RpcResult<BarrierOutput>> barrier(BarrierInput input, SwitchConnectionDistinguisher cookie);
63
64     /**
65      * send experimenter message to switch
66      *
67      * @param input
68      *            - message
69      * @param cookie
70      *            - to identify connection if null then feel free to send via
71      *            any connection
72      * @return - the future
73      */
74     Future<RpcResult<java.lang.Void>> experimenter(ExperimenterInput input, SwitchConnectionDistinguisher cookie);
75
76     /**
77      * send flow modification message to switch
78      *
79      * @param input
80      *            - message
81      * @param cookie
82      *            - to identify connection if null then feel free to send via
83      *            any connection
84      * @return - the future
85      */
86     Future<RpcResult<UpdateFlowOutput>> flowMod(FlowModInput input, SwitchConnectionDistinguisher cookie);
87
88     /**
89      * send get async message to switch
90      *
91      * @param input
92      *            - message
93      * @param cookie
94      *            - to identify connection if null then feel free to send via
95      *            any connection
96      * @return - the future
97      */
98     Future<RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input, SwitchConnectionDistinguisher cookie);
99
100     /**
101      * send get config message to switch
102      *
103      * @param input
104      *            - message
105      * @param cookie
106      *            - to identify connection if null then feel free to send via
107      *            any connection
108      * @return - the future
109      */
110     Future<RpcResult<GetConfigOutput>> getConfig(GetConfigInput input, SwitchConnectionDistinguisher cookie);
111
112     /**
113      * send get features message to switch
114      *
115      * @param input
116      *            - message
117      * @param cookie
118      *            - to identify connection if null then feel free to send via
119      *            any connection
120      * @return - the future
121      */
122     Future<RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input, SwitchConnectionDistinguisher cookie);
123
124     /**
125      * send get queue config message to switch
126      *
127      * @param input
128      *            - message
129      * @param cookie
130      *            - to identify connection if null then feel free to send via
131      *            any connection
132      * @return - the future
133      */
134     Future<RpcResult<GetQueueConfigOutput>> getQueueConfig(GetQueueConfigInput input,
135             SwitchConnectionDistinguisher cookie);
136
137     /**
138      * send group modification message to switch
139      *
140      * @param input
141      *            - message
142      * @param cookie
143      *            - to identify connection if null then feel free to send via
144      *            any connection
145      * @return - the future
146      */
147     Future<RpcResult<UpdateGroupOutput>> groupMod(GroupModInput input, SwitchConnectionDistinguisher cookie);
148
149     /**
150      * send meter modification message to switch
151      *
152      * @param input
153      *            - message
154      * @param cookie
155      *            - to identify connection if null then feel free to send via
156      *            any connection
157      * @return - the future
158      */
159     Future<RpcResult<UpdateMeterOutput>> meterMod(MeterModInput input, SwitchConnectionDistinguisher cookie);
160
161     /**
162      * send multipart request message to switch
163      *
164      * @param input
165      *            - multipart request message
166      * @param cookie
167      *            - to identify connection if null then feel free to send via
168      *            any connection
169      * @return - the future
170      */
171     Future<RpcResult<java.lang.Void>> multipartRequest(MultipartRequestInput input, SwitchConnectionDistinguisher cookie);
172
173     /**
174      * send packet out message to switch
175      *
176      * @param input
177      *            - message
178      * @param cookie
179      *            - to identify connection if null then feel free to send via
180      *            any connection
181      * @return - the future
182      */
183     Future<RpcResult<java.lang.Void>> packetOut(PacketOutInput input, SwitchConnectionDistinguisher cookie);
184
185     /**
186      * send port modification message to switch
187      *
188      * @param input
189      *            - message
190      * @param cookie
191      *            - to identify connection if null then feel free to send via
192      *            any connection
193      * @return - the future
194      */
195     Future<RpcResult<UpdatePortOutput>> portMod(PortModInput input, SwitchConnectionDistinguisher cookie);
196
197     /**
198      * send role request message to switch
199      *
200      * @param input
201      *            - message
202      * @param cookie
203      *            - to identify connection if null then feel free to send via
204      *            any connection
205      * @return - the future
206      */
207     Future<RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input, SwitchConnectionDistinguisher cookie);
208
209     /**
210      * send set async message to switch
211      *
212      * @param input
213      *            - message
214      * @param cookie
215      *            - to identify connection if null then feel free to send via
216      *            any connection
217      * @return - the future
218      */
219     Future<RpcResult<java.lang.Void>> setAsync(SetAsyncInput input, SwitchConnectionDistinguisher cookie);
220
221     /**
222      * send set config message to switch
223      *
224      * @param input
225      *            - message
226      * @param cookie
227      *            - to identify connection if null then feel free to send via
228      *            any connection
229      * @return - the future
230      */
231     Future<RpcResult<java.lang.Void>> setConfig(SetConfigInput input, SwitchConnectionDistinguisher cookie);
232
233     /**
234      * send table modification message to switch
235      *
236      * @param input
237      *            - message
238      * @param cookie
239      *            - to identify connection if null then feel free to send via
240      *            any connection
241      * @return - the future
242      */
243     Future<RpcResult<java.lang.Void>> tableMod(TableModInput input, SwitchConnectionDistinguisher cookie);
244     
245 }