Improve cleanup after device disconnected event
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / handlers / DeviceInitializationPhaseHandler.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.device.handlers;
10
11 import javax.annotation.CheckForNull;
12 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
14 import org.opendaylight.openflowplugin.api.openflow.lifecycle.LifecycleService;
15
16 /**
17  * openflowplugin-api
18  * org.opendaylight.openflowplugin.api.openflow.device.handlers
19  *
20  * Interface represent handler for new connected device building cycle. Every implementation
21  * have some unnecessary steps which has to be done before add new Device instance.
22  *
23  * Created: Apr 3, 2015
24  */
25 public interface DeviceInitializationPhaseHandler {
26
27     /**
28      * Method represents an initialization cycle for {@link DeviceContext} preparation for use.
29      *
30      * @param deviceInfo - device
31      * @param lifecycleService - cluster singleton service
32      * @throws Exception - needs to be catch in ConnectionHandler implementation
33      */
34     void onDeviceContextLevelUp(final @CheckForNull DeviceInfo deviceInfo,
35                                 final @CheckForNull LifecycleService lifecycleService) throws Exception;
36 }