Merge "BUG-4148: Improving the logging in flow/group/meter to provide more contextual...
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.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;
10
11 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
12 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
13 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
14 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
15 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
16 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor;
17 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
18 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
20
21 /**
22  * This interface is responsible for instantiating DeviceContext and
23  * registering transaction chain for each DeviceContext. Each device
24  * has its own device context managed by this manager.
25  * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
26  */
27 public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor,
28         DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable {
29
30     /**
31      * Sets notification publish service
32      *
33      * @param notificationPublishService
34      */
35     void setNotificationPublishService(NotificationPublishService notificationPublishService);
36
37     /**
38      * invoked after all services injected
39      */
40     void initialize();
41
42     /**
43      * Returning device context from map maintained in device manager
44      * This prevent to send whole device context to another context
45      * If device context not exists for nodeId it will return null
46      * @param nodeId
47      * @return device context or null
48      */
49     DeviceContext getDeviceContextFromNodeId(NodeId nodeId);
50
51     void setStatisticsRpcEnabled(boolean isStatisticsRpcEnabled);
52 }
53