Merge "OPNFLWPLUG-1076 Migrate lldp-speaker, forwardingrules-sync and arbitratorrecon...
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / SyncPlanPushStrategy.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.openflowplugin.applications.frsync;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.openflowplugin.applications.frsync.impl.strategy.SynchronizationDiffInput;
12 import org.opendaylight.openflowplugin.applications.frsync.util.SyncCrudCounters;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
14
15 /**
16  * Prescribes common synchronization plan execution strategy.
17  * Implementations should be stateless.
18  */
19 public interface SyncPlanPushStrategy {
20
21     /**
22      * Invoked to execute the synchronization strategy.
23      *
24      * @param resultVehicle bootstrap future - execution will chain it's async calls to this one
25      * @param diffInput     wraps all diff data required for any strategy ({add,remove,update} x {flow,group,meter})
26      * @param counters      reference to internal one-shot statistics - summary off successfully pushed items
27      *                      shall be recorded here
28      * @return last future of the chain
29      */
30     ListenableFuture<RpcResult<Void>> executeSyncStrategy(ListenableFuture<RpcResult<Void>> resultVehicle,
31                                                           SynchronizationDiffInput diffInput,
32                                                           SyncCrudCounters counters);
33 }