Bug 8902 - Reconciliation Framework changes
[openflowplugin.git] / applications / reconciliation-framework / src / main / java / org / opendaylight / openflowplugin / applications / reconciliation / ReconciliationNotificationListener.java
1 /*
2  * Copyright (c) 2017 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
9 package org.opendaylight.openflowplugin.applications.reconciliation;
10
11 import com.google.common.util.concurrent.ListenableFuture;
12 import java.util.concurrent.Future;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.rf.state.rev170713.ResultState;
15
16 /*
17  * Provider to start the reconciliation of a node
18  * Provider to end the reconciliation of a node
19  */
20 public interface ReconciliationNotificationListener extends AutoCloseable {
21     /*
22      * This method will be a callback from RF to start the application
23      * reconciliation. If the reconciliation fails for the services with a priority, the reconciliation of the node for
24      * other services with lower priority has to be carried out or cancelled depending on the resultstate decided by
25      * the services so that it is "fail fast" and doesn't block. This enhancement would be done later and currently the
26      * reconciliation for all the services is carried out irrespective of the intent.
27      *
28      * @param nodeId - Node InstanceIdentifier
29      *
30      * @return the nodeId
31      */
32     ListenableFuture<Boolean> startReconciliation(DeviceInfo node);
33
34     /*
35      * This method will be a callback from RF when dpn disconnects during
36      * reconciliation
37      *
38      * @param nodeId - Node InstanceIdentifier
39      *
40      * @return the nodeId
41      */
42     ListenableFuture<Boolean> endReconciliation(DeviceInfo node);
43
44     /*
45      * Priority of the application. The priority should be a set of values from which the user should be able to select
46      * for the service instead of allowing any random values for priority from the user. Enhancement to be made to
47      * restrict the user to choose from among a set of priorities by making this enum. Also enhancement to be made to
48      * add the service reconciliation property as a configurable property.
49      *
50      * @return the priority of the service
51      */
52     int getPriority();
53
54     /*
55      * Name of the application
56      *
57      * @return the name of the service
58      */
59     String getName();
60
61     /*
62      * Application's intent when the application's reconciliation fails
63      *
64      * @return the intent of the service if the reconciliation fails
65      */
66     ResultState getResultState();
67 }