Migrate netconf-topology to new transport
[netconf.git] / apps / callhome-provider / src / main / java / org / opendaylight / netconf / callhome / mount / CallHomeTopology.java
1 /*
2  * Copyright (c) 2016 Brocade Communication Systems 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.netconf.callhome.mount;
9
10 import com.google.common.annotations.VisibleForTesting;
11 import io.netty.util.concurrent.EventExecutor;
12 import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
13 import org.opendaylight.controller.config.threadpool.ThreadPool;
14 import org.opendaylight.mdsal.binding.api.DataBroker;
15 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
16 import org.opendaylight.netconf.client.NetconfClientFactory;
17 import org.opendaylight.netconf.client.mdsal.api.BaseNetconfSchemas;
18 import org.opendaylight.netconf.client.mdsal.api.DeviceActionFactory;
19 import org.opendaylight.netconf.client.mdsal.api.SchemaResourceManager;
20 import org.opendaylight.netconf.topology.spi.AbstractNetconfTopology;
21 import org.opendaylight.netconf.topology.spi.NetconfClientConfigurationBuilderFactory;
22 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
23 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
24
25 // Non-final for mocking
26 public class CallHomeTopology extends AbstractNetconfTopology {
27     public CallHomeTopology(final String topologyId, final NetconfClientFactory clientFactory,
28             final EventExecutor eventExecutor, final ScheduledThreadPool scheduledThreadPool,
29             final ThreadPool processingThreadPool, final SchemaResourceManager schemaRepositoryProvider,
30             final DataBroker dataBroker, final DOMMountPointService mountPointService,
31             final NetconfClientConfigurationBuilderFactory builderFactory, final BaseNetconfSchemas baseSchemas,
32             final DeviceActionFactory deviceActionFactory) {
33         super(topologyId, clientFactory, eventExecutor, scheduledThreadPool, processingThreadPool,
34             schemaRepositoryProvider, dataBroker, mountPointService, builderFactory, deviceActionFactory,
35             baseSchemas);
36     }
37
38     void disconnectNode(final NodeId nodeId) {
39         deleteNode(nodeId);
40     }
41
42     @VisibleForTesting
43     public void connectNode(final Node node) {
44         ensureNode(node);
45     }
46 }