Improve cleanup after device disconnected event
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / OFPManager.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
9 package org.opendaylight.openflowplugin.api.openflow;
10
11 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
12 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor;
13 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler;
14 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
15
16 /**
17  * This interface is responsible for managing lifecycle of itself and all it's associated contexts.
18  * Every manager that implements this interface must handle connection initialization and termination chain
19  * by implementing methods from {@link org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor},
20  * then it must handle initialization and termination chain of it's associated context by implementing methods from
21  * {@link org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler} and
22  * {@link org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler} and also removal
23  * of these contexts from it's internal map of contexts by implementing methods from
24  * {@link org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceRemovedHandler}. And at last, it must
25  * handle it's own full termination by implementing {@link AutoCloseable#close()}
26  */
27 public interface OFPManager extends
28         DeviceLifecycleSupervisor,
29         DeviceInitializationPhaseHandler,
30         DeviceTerminationPhaseHandler,
31         DeviceRemovedHandler,
32         AutoCloseable {
33
34     @Override
35     void close();
36 }