2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.netconf.topology.spi;
10 import java.util.List;
11 import org.opendaylight.netconf.client.NetconfClientSessionListener;
12 import org.opendaylight.netconf.sal.connect.api.RemoteDeviceHandler;
13 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator;
14 import org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences;
15 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration;
17 public final class NetconfConnectorDTO implements AutoCloseable {
18 private final List<SchemaSourceRegistration<?>> yanglibRegistrations;
19 private final NetconfDeviceCommunicator communicator;
20 private final RemoteDeviceHandler<NetconfSessionPreferences> facade;
22 public NetconfConnectorDTO(final NetconfDeviceCommunicator communicator,
23 final RemoteDeviceHandler<NetconfSessionPreferences> facade,
24 final List<SchemaSourceRegistration<?>> yanglibRegistrations) {
25 this.communicator = communicator;
27 this.yanglibRegistrations = yanglibRegistrations;
30 public NetconfDeviceCommunicator getCommunicator() {
34 public RemoteDeviceHandler<NetconfSessionPreferences> getFacade() {
38 public NetconfClientSessionListener getSessionListener() {
46 yanglibRegistrations.forEach(SchemaSourceRegistration::close);