Search in sources :

Example 6 with NetconfDeviceCapabilities

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());
}
Also used : NetconfClientSessionListener(org.opendaylight.netconf.client.NetconfClientSessionListener) NetconfDeviceCommunicator(org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator) NetconfDeviceCapabilities(org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode) NetconfReconnectingClientConfiguration(org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfiguration)

Example 7 with NetconfDeviceCapabilities

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();
}
Also used : NetconfDeviceCapabilities(org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities)

Example 8 with NetconfDeviceCapabilities

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();
}
Also used : NetconfDeviceCapabilities(org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities)

Aggregations

NetconfDeviceCapabilities (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCapabilities)8 Test (org.junit.Test)4 NetconfDeviceCommunicator (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfDeviceCommunicator)4 QName (org.opendaylight.yangtools.yang.common.QName)3 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)3 HashMap (java.util.HashMap)2 DOMRpcService (org.opendaylight.mdsal.dom.api.DOMRpcService)2 NetconfClientSessionListener (org.opendaylight.netconf.client.NetconfClientSessionListener)2 NetconfReconnectingClientConfiguration (org.opendaylight.netconf.client.conf.NetconfReconnectingClientConfiguration)2 NetconfSessionPreferences (org.opendaylight.netconf.sal.connect.netconf.listener.NetconfSessionPreferences)2 NetconfNode (org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode)2 MountPointContext (org.opendaylight.yangtools.rfc8528.data.api.MountPointContext)2 EffectiveModelContextFactory (org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory)2 HashMultimap (com.google.common.collect.HashMultimap)1 Iterables (com.google.common.collect.Iterables)1 Lists (com.google.common.collect.Lists)1 Sets (com.google.common.collect.Sets)1 Futures (com.google.common.util.concurrent.Futures)1 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)1 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)1