use of org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities in project netconf by opendaylight.
the class RemoteDeviceConnectorImpl method startRemoteDeviceConnection.
@Override
public void startRemoteDeviceConnection(final RemoteDeviceHandler<NetconfSessionPreferences> deviceHandler) {
final NetconfNode netconfNode = netconfTopologyDeviceSetup.getNode().augmentation(NetconfNode.class);
final NodeId nodeId = netconfTopologyDeviceSetup.getNode().getNodeId();
requireNonNull(netconfNode.getHost());
requireNonNull(netconfNode.getPort());
this.deviceCommunicatorDTO = createDeviceCommunicator(nodeId, netconfNode, deviceHandler);
final NetconfDeviceCommunicator deviceCommunicator = deviceCommunicatorDTO.getCommunicator();
final NetconfClientSessionListener netconfClientSessionListener = deviceCommunicatorDTO.getSessionListener();
final NetconfReconnectingClientConfiguration clientConfig = getClientConfig(netconfClientSessionListener, netconfNode);
final ListenableFuture<NetconfDeviceCapabilities> future = deviceCommunicator.initializeRemoteConnection(netconfTopologyDeviceSetup.getNetconfClientDispatcher(), clientConfig);
Futures.addCallback(future, new FutureCallback<NetconfDeviceCapabilities>() {
@Override
public void onSuccess(final NetconfDeviceCapabilities result) {
LOG.debug("{}: Connector started successfully", remoteDeviceId);
}
@Override
public void onFailure(final Throwable throwable) {
LOG.error("{}: Connector failed", remoteDeviceId, throwable);
}
}, MoreExecutors.directExecutor());
}
use of org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities in project netconf by opendaylight.
the class MasterSalFacade method onDeviceDisconnected.
@Override
public void onDeviceDisconnected() {
LOG.info("Device {} disconnected - unregistering master mount point", id);
salProvider.getTopologyDatastoreAdapter().updateDeviceData(false, new NetconfDeviceCapabilities());
unregisterMasterMountPoint();
}
use of org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities in project netconf by opendaylight.
the class NetconfDeviceSalFacade method onDeviceDisconnected.
@Override
public synchronized void onDeviceDisconnected() {
salProvider.getTopologyDatastoreAdapter().updateDeviceData(false, new NetconfDeviceCapabilities());
salProvider.getMountInstance().onTopologyDeviceDisconnected();
closeLockChangeListener();
}
Aggregations