Refactor reconciliation wiring
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / NodeConfigurator.java
1 /*
2  * Copyright (c) 2018 Ericsson India Global Services Pvt Ltd. 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.frm;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.concurrent.Callable;
12
13 public interface NodeConfigurator extends AutoCloseable {
14     /**
15      * Enqueues a job in nodeconfigurator.
16      *
17      * @param key        The job's key. Jobs with the same key are run sequentially.
18      *                   Jobs with different keys are run in parallel.
19      * @param mainWorker The task that runs for the job.
20      *
21      * @return the result of the enqueued job.
22      */
23     <T> ListenableFuture<T> enqueueJob(String key, Callable<ListenableFuture<T>> mainWorker);
24 }