Fix context chain initialization and SLAVE change
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / lifecycle / ContextChainHolder.java
1 /*
2  * Copyright (c) 2016 Pantheon Technologies s.r.o. 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.api.openflow.lifecycle;
9
10 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
11 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
12 import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager;
13 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
14 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
15 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler;
16 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager;
17 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
18
19 /**
20  * Generic interface for context chain holder, hold all created context chains.
21  */
22 public interface ContextChainHolder extends
23         DeviceConnectedHandler,
24         MastershipChangeListener,
25         DeviceDisconnectedHandler,
26         DeviceRemovedHandler,
27         EntityOwnershipListener,
28         AutoCloseable {
29
30     /**
31      * Managers need to be added before.
32      * {@link DeviceManager}
33      * {@link RpcManager}
34      * {@link StatisticsManager}
35      * @param manager a child class of {@link OFPManager}
36      * @param <T> {@link OFPManager}
37      */
38     <T extends OFPManager> void addManager(T manager);
39
40     @Override
41     void close() throws Exception;
42
43 }