2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
8 package org.opendaylight.genius.mdsalutil.interfaces;
10 import com.google.common.util.concurrent.FluentFuture;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import java.util.concurrent.ExecutionException;
13 import org.opendaylight.genius.infra.Datastore.Configuration;
14 import org.opendaylight.genius.infra.TypedReadWriteTransaction;
15 import org.opendaylight.genius.infra.TypedWriteTransaction;
16 import org.opendaylight.genius.mdsalutil.FlowEntity;
17 import org.opendaylight.genius.mdsalutil.GroupEntity;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
23 import org.opendaylight.yangtools.yang.common.Uint64;
25 public interface IMdsalApiManager {
30 * @param flowEntity The flow entity.
31 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
35 FluentFuture<Void> installFlow(FlowEntity flowEntity);
40 * @param dpId The DPN identifier.
41 * @param flowEntity The flow entity.
42 * @deprecated Use {@link #addFlow(TypedWriteTransaction, Uint64, Flow)}.
46 FluentFuture<Void> installFlow(Uint64 dpId, Flow flowEntity);
51 * @param dpId The DPN identifier.
52 * @param flowEntity The flow entity.
53 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
57 FluentFuture<Void> installFlow(Uint64 dpId, FlowEntity flowEntity);
60 * Adds the given flow.
62 * @param tx The transaction to use.
63 * @param flowEntity The flow entity.
65 void addFlow(TypedWriteTransaction<Configuration> tx, FlowEntity flowEntity);
68 * Adds the given flow.
70 * @param tx The transaction to use.
71 * @param dpId The DPN identifier.
72 * @param flow The flow.
74 void addFlow(TypedWriteTransaction<Configuration> tx, Uint64 dpId, Flow flow);
79 * @param dpId The DPN identifier.
80 * @param tableId The table identifier.
81 * @param flowId The flow identifier.
82 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, Uint64, String, short)}.
86 ListenableFuture<Void> removeFlow(Uint64 dpId, short tableId, FlowId flowId);
91 * @param flowEntity The flow entity.
92 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
96 FluentFuture<Void> removeFlow(FlowEntity flowEntity);
101 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, Uint64, Flow)}.
104 FluentFuture<Void> removeFlow(Uint64 dpId, Flow flowEntity);
107 * Removes the given flow.
109 * @param tx The transaction to use.
110 * @param dpId The DPN identifier.
111 * @param flow The flow.
112 * @throws ExecutionException in case of a technical (!) error while reading
113 * @throws InterruptedException in case of a technical (!) error while reading
115 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, Flow flow)
116 throws ExecutionException, InterruptedException;
119 * Removes the given flow.
121 * @param tx The transaction to use.
122 * @param flowEntity The flow entity.
123 * @throws ExecutionException in case of a technical (!) error while reading
124 * @throws InterruptedException in case of a technical (!) error while reading
126 void removeFlow(TypedReadWriteTransaction<Configuration> tx, FlowEntity flowEntity)
127 throws ExecutionException, InterruptedException;
130 * Removes the given flow.
132 * @param tx The transaction to use.
133 * @param dpId The DPN identifier.
134 * @param flowKey The flow key.
135 * @param tableId The table identifier.
136 * @throws ExecutionException in case of a technical (!) error while reading
137 * @throws InterruptedException in case of a technical (!) error while reading
139 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, FlowKey flowKey, short tableId)
140 throws ExecutionException, InterruptedException;
143 * Removes the given flow.
145 * @param tx The transaction to use.
146 * @param dpId The DPN identifier.
147 * @param flowId The flow identifier.
148 * @param tableId The table identifier.
149 * @throws ExecutionException in case of a technical (!) error while reading
150 * @throws InterruptedException in case of a technical (!) error while reading
152 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, String flowId, short tableId)
153 throws ExecutionException, InterruptedException;
156 * Adds the given group using the given transaction.
158 * @param tx The transaction to use.
159 * @param groupEntity The group to add.
161 void addGroup(TypedWriteTransaction<Configuration> tx, GroupEntity groupEntity);
164 * Adds the given group using the given transaction.
166 * @param tx The transaction to use.
167 * @param dpId The DPN identifier.
168 * @param group The group to add.
170 void addGroup(TypedWriteTransaction<Configuration> tx, Uint64 dpId, Group group);
175 * @param groupEntity The group to remove.
176 * @deprecated Use {@link #removeGroup(TypedReadWriteTransaction, GroupEntity)}
179 void removeGroup(GroupEntity groupEntity);
182 * Remove a group using the given transaction.
184 * @param tx The transaction to use.
185 * @param groupEntity The group to remove.
186 * @throws ExecutionException in case of a technical (!) error while reading
187 * @throws InterruptedException in case of a technical (!) error while reading
189 void removeGroup(TypedReadWriteTransaction<Configuration> tx, GroupEntity groupEntity)
190 throws ExecutionException, InterruptedException;
193 * Remove a group using the given transaction.
195 * @param tx The transaction to use.
196 * @param dpId The DPN identifier.
197 * @param group The group to remove.
198 * @throws ExecutionException in case of a technical (!) error while reading
199 * @throws InterruptedException in case of a technical (!) error while reading
201 void removeGroup(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, Group group)
202 throws ExecutionException, InterruptedException;
205 * Remove a group using the given transaction.
207 * @param tx The transaction to use.
208 * @param dpId The DPN identifier.
209 * @param groupId The group identifier of the group to remove.
210 * @throws ExecutionException in case of a technical (!) error while reading
211 * @throws InterruptedException in case of a technical (!) error while reading
213 void removeGroup(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId)
214 throws ExecutionException, InterruptedException;
217 * Check if OF group exist on DPN.
223 * @return true if group exists and false otherwise
226 boolean groupExists(Uint64 dpId, long groupId);
229 * API to remove the flow on Data Plane Node synchronously. It internally waits for
230 * Flow Change Notification to confirm flow delete request is being sent with-in delayTime.
232 * @param flowEntity The flow entity.
233 * @param delayTime The delay time.
234 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
237 void syncRemoveFlow(FlowEntity flowEntity, long delayTime);
242 * @param flowEntity The flow entity.
243 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
246 void syncRemoveFlow(FlowEntity flowEntity);
251 * @param flowEntity The flow entity.
252 * @param delayTime The delay time.
253 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
256 void syncInstallFlow(FlowEntity flowEntity, long delayTime);
261 * @param flowEntity The flow entity.
262 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
265 void syncInstallFlow(FlowEntity flowEntity);
270 * @param groupEntity The group to add.
271 * @deprecated Use {@link #addGroup(TypedWriteTransaction, GroupEntity)}.
274 void syncInstallGroup(GroupEntity groupEntity);
277 * API to remove the Group on Data Plane Node synchronously. It internally waits for
278 * Group Change Notification to confirm group delete request is being sent.
279 * @param groupEntity The group to add.
280 * @deprecated Use {@link #removeGroup(TypedReadWriteTransaction, GroupEntity)}.
283 void syncRemoveGroup(GroupEntity groupEntity);
285 void addBucket(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId, Bucket bucket)
286 throws ExecutionException, InterruptedException;
288 void removeBucket(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId, long bucketId)
289 throws ExecutionException, InterruptedException;