import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import org.opendaylight.infrautils.utils.concurrent.JdkFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
import org.opendaylight.mdsal.binding.api.ReadTransaction;
private static final String GROUP_EXISTS_IN_DEVICE_ERROR = "GROUPEXISTS";
private ListenerRegistration<FlowForwarder> listenerRegistration;
- private final BundleFlowForwarder bundleFlowForwarder;
public FlowForwarder(final ForwardingRulesManager manager, final DataBroker db) {
super(manager, db);
- bundleFlowForwarder = new BundleFlowForwarder(manager);
}
@Override
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleFlowForwarder.remove(identifier, removeDataObj, nodeIdent, bundleId);
+ provider.getBundleFlowListener().remove(identifier, removeDataObj, nodeIdent, bundleId);
} else {
final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
builder.setFlowRef(new FlowRef(identifier));
// into remove-flow input so that only a flow entry associated with
// a given flow object is removed.
builder.setTransactionUri(new Uri(provider.getNewTransactionId())).setStrict(Boolean.TRUE);
- final Future<RpcResult<RemoveFlowOutput>> resultFuture =
- provider.getSalFlowService().removeFlow(builder.build());
- JdkFutures.addErrorLogging(resultFuture, LOG, "removeFlow");
+ LoggingFutures.addErrorLogging(provider.getSalFlowService().removeFlow(builder.build()), LOG,
+ "removeFlow");
}
}
}
// TODO: Pull this into ForwardingRulesCommiter and override it here
@Override
- public Future<RpcResult<RemoveFlowOutput>> removeWithResult(final InstanceIdentifier<Flow> identifier,
+ public ListenableFuture<RpcResult<RemoveFlowOutput>> removeWithResult(final InstanceIdentifier<Flow> identifier,
final Flow removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- Future<RpcResult<RemoveFlowOutput>> resultFuture = SettableFuture.create();
+ ListenableFuture<RpcResult<RemoveFlowOutput>> resultFuture = SettableFuture.create();
final TableKey tableKey = identifier.firstKeyOf(Table.class);
if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
if (tableIdValidationPrecondition(tableKey, update)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- bundleFlowForwarder.update(identifier, original, update, nodeIdent, bundleId);
+ provider.getBundleFlowListener().update(identifier, original, update, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {
if (tableIdValidationPrecondition(tableKey, addDataObj)) {
BundleId bundleId = getActiveBundle(nodeIdent, provider);
if (bundleId != null) {
- return bundleFlowForwarder.add(identifier, addDataObj, nodeIdent, bundleId);
+ return provider.getBundleFlowListener().add(identifier, addDataObj, nodeIdent, bundleId);
} else {
final NodeId nodeId = getNodeIdFromNodeIdentifier(nodeIdent);
nodeConfigurator.enqueueJob(nodeId.getValue(), () -> {