223cb4c14f110e039d4d07a33b8012c6c2357ee5
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceManager.java
1 /*
2  * Copyright (c) 2015, 2017 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 com.google.common.util.concurrent.CheckedFuture;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
14 import org.opendaylight.openflowplugin.api.openflow.OFPManager;
15 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
16 import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
19 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
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  */
26 public interface DeviceManager extends
27         OFPManager,
28         TranslatorLibrarian {
29
30     /**
31      * invoked after all services injected.
32      */
33     void initialize();
34
35     CheckedFuture<Void, TransactionCommitFailedException> removeDeviceFromOperationalDS(
36             @Nonnull KeyedInstanceIdentifier<Node, NodeKey> ii);
37
38     DeviceContext createContext(@Nonnull ConnectionContext connectionContext);
39
40
41     void sendNodeAddedNotification(
42             @Nonnull KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier);
43
44     void sendNodeRemovedNotification(
45             @Nonnull KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier);
46 }
47