2 * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
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.connection.ConnectionContext;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
14 import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager;
15 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
16 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
17 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager;
18 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
21 * Generic interface for context chain holder, hold all created context chains.
23 public interface ContextChainHolder extends
24 DeviceConnectedHandler,
25 MastershipChangeListener,
26 DeviceDisconnectedHandler,
27 EntityOwnershipListener,
31 * Managers need to be added before.
32 * {@link DeviceManager}
34 * {@link StatisticsManager}
35 * @param manager a child class of {@link OFPManager}
36 * @param <T> {@link OFPManager}
38 <T extends OFPManager> void addManager(T manager);
41 * Create a new context chain.
42 * @param connectionContext new connection
43 * @return {@link ContextChain}
45 ContextChain createContextChain(ConnectionContext connectionContext);
48 * Called if connection needs to be destroyed.
49 * @param deviceInfo {@link DeviceInfo}
51 void destroyContextChain(DeviceInfo deviceInfo);
54 void close() throws Exception;