d043c7ea2188d75f071dcfeb9259d60cfcec5768
[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 java.util.concurrent.Future;
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
15 /**
16  * Generic interface for context chain holder, hold all created context chains
17  */
18 public interface ContextChainHolder {
19
20     <T extends OFPManager> void addManager(final T manager);
21     Future<Void> createContextChain(final DeviceInfo deviceInfo);
22     Future<Void> connectionLost(final DeviceInfo deviceInfo);
23     void destroyContextChain(final DeviceInfo deviceInfo);
24
25     /**
26      * This method will pair up connection with existing context chain
27      * If context chain doesn't exist will create context chain a set this connection as primary to the new created context chain
28      * If context chain cannot be created close connection and destroy context chain
29      * @param connectionContext new connection
30      */
31     void pairConnection(final ConnectionContext connectionContext);
32
33 }