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 com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
12 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
13 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
14 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
15 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
16 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
17 import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager;
18 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
19 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
20 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcManager;
21 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
24 * Generic interface for context chain holder, hold all created context chains.
26 public interface ContextChainHolder extends
27 DeviceConnectedHandler,
28 MastershipChangeListener,
29 DeviceDisconnectedHandler,
30 EntityOwnershipListener,
34 * Managers need to be added before.
35 * {@link DeviceManager}
37 * {@link StatisticsManager}
38 * @param manager a child class of {@link OFPManager}
39 * @param <T> {@link OFPManager}
41 <T extends OFPManager> void addManager(T manager);
44 * Create a new context chain.
45 * @param connectionContext new connection
46 * @return {@link ContextChain}
48 ContextChain createContextChain(ConnectionContext connectionContext);
51 * Called if connection needs to be destroyed.
52 * @param deviceInfo {@link DeviceInfo}
54 ListenableFuture<Void> destroyContextChain(DeviceInfo deviceInfo);
57 * Provider is needed to register cluster singleton service.
58 * @param singletonServicesProvider provider
60 void addSingletonServicesProvider(ClusterSingletonServiceProvider singletonServicesProvider);
63 * Register EOS listener.
64 * @param entityOwnershipService EOS services
66 void changeEntityOwnershipService(EntityOwnershipService entityOwnershipService);
69 void close() throws Exception;