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 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
33 FluentFuture<Void> installFlow(FlowEntity flowEntity);
38 * @deprecated Use {@link #addFlow(TypedWriteTransaction, Uint64, Flow)}.
41 FluentFuture<Void> installFlow(Uint64 dpId, Flow flowEntity);
46 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
49 FluentFuture<Void> installFlow(Uint64 dpId, FlowEntity flowEntity);
52 * Adds the given flow.
54 * @param tx The transaction to use.
55 * @param flowEntity The flow entity.
57 void addFlow(TypedWriteTransaction<Configuration> tx, FlowEntity flowEntity);
60 * Adds the given flow.
62 * @param tx The transaction to use.
63 * @param dpId The DPN identifier.
64 * @param flow The flow.
66 void addFlow(TypedWriteTransaction<Configuration> tx, Uint64 dpId, Flow flow);
71 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, Uint64, String, short)}.
74 ListenableFuture<Void> removeFlow(Uint64 dpId, short tableId, FlowId flowId);
79 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
82 FluentFuture<Void> removeFlow(FlowEntity flowEntity);
87 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, Uint64, Flow)}.
90 FluentFuture<Void> removeFlow(Uint64 dpId, Flow flowEntity);
93 * Removes the given flow.
95 * @param tx The transaction to use.
96 * @param dpId The DPN identifier.
97 * @param flow The flow.
99 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, Flow flow)
100 throws ExecutionException, InterruptedException;
103 * Removes the given flow.
105 * @param tx The transaction to use.
106 * @param flowEntity The flow entity.
108 void removeFlow(TypedReadWriteTransaction<Configuration> tx, FlowEntity flowEntity)
109 throws ExecutionException, InterruptedException;
112 * Removes the given flow.
114 * @param tx The transaction to use.
115 * @param dpId The DPN identifier.
116 * @param flowKey The flow key.
117 * @param tableId The table identifier.
119 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, FlowKey flowKey, short tableId)
120 throws ExecutionException, InterruptedException;
123 * Removes the given flow.
125 * @param tx The transaction to use.
126 * @param dpId The DPN identifier.
127 * @param flowId The flow identifier.
128 * @param tableId The table identifier.
130 void removeFlow(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, String flowId, short tableId)
131 throws ExecutionException, InterruptedException;
134 * Adds the given group using the given transaction.
136 * @param tx The transaction to use.
137 * @param groupEntity The group to add.
139 void addGroup(TypedWriteTransaction<Configuration> tx, GroupEntity groupEntity);
142 * Adds the given group using the given transaction.
144 * @param tx The transaction to use.
145 * @param dpId The DPN identifier.
146 * @param group The group to add.
148 void addGroup(TypedWriteTransaction<Configuration> tx, Uint64 dpId, Group group);
153 * @deprecated Use {@link #removeGroup(TypedReadWriteTransaction, GroupEntity)}
156 void removeGroup(GroupEntity groupEntity);
159 * Remove a group using the given transaction.
161 * @param tx The transaction to use.
162 * @param groupEntity The group to remove.
164 void removeGroup(TypedReadWriteTransaction<Configuration> tx, GroupEntity groupEntity)
165 throws ExecutionException, InterruptedException;
168 * Remove a group using the given transaction.
170 * @param tx The transaction to use.
171 * @param dpId The DPN identifier.
172 * @param group The group to remove.
174 void removeGroup(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, Group group)
175 throws ExecutionException, InterruptedException;
178 * Remove a group using the given transaction.
180 * @param tx The transaction to use.
181 * @param dpId The DPN identifier.
182 * @param groupId The group identifier of the group to remove.
184 void removeGroup(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId)
185 throws ExecutionException, InterruptedException;
188 * Check if OF group exist on DPN.
194 * @return true if group exists and false otherwise
197 boolean groupExists(Uint64 dpId, long groupId);
200 * API to remove the flow on Data Plane Node synchronously. It internally waits for
201 * Flow Change Notification to confirm flow delete request is being sent with-in delayTime.
203 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
206 void syncRemoveFlow(FlowEntity flowEntity, long delayTime);
211 * @deprecated Use {@link #removeFlow(TypedReadWriteTransaction, FlowEntity)}.
214 void syncRemoveFlow(FlowEntity flowEntity);
219 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
222 void syncInstallFlow(FlowEntity flowEntity, long delayTime);
227 * @deprecated Use {@link #addFlow(TypedWriteTransaction, FlowEntity)}.
230 void syncInstallFlow(FlowEntity flowEntity);
235 * @deprecated Use {@link #addGroup(TypedWriteTransaction, GroupEntity)}.
238 void syncInstallGroup(GroupEntity groupEntity);
241 * API to remove the Group on Data Plane Node synchronously. It internally waits for
242 * Group Change Notification to confirm group delete request is being sent.
243 * @deprecated Use {@link #removeGroup(TypedReadWriteTransaction, GroupEntity)}.
246 void syncRemoveGroup(GroupEntity groupEntity);
248 void addBucket(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId, Bucket bucket)
249 throws ExecutionException, InterruptedException;
251 void removeBucket(TypedReadWriteTransaction<Configuration> tx, Uint64 dpId, long groupId, long bucketId)
252 throws ExecutionException, InterruptedException;