use of org.onosproject.netconf.NetconfDevice in project onos by opennetworkinglab.
the class NetconfControllerImplTest method testConnectCorrectDevice.
/**
* Check for correct device connection. In this case the device map get modified.
*/
@Test
public void testConnectCorrectDevice() throws Exception {
reflectedDeviceMap.clear();
NetconfDevice device1 = ctrl.connectDevice(deviceInfo1.getDeviceId());
NetconfDevice device2 = ctrl.connectDevice(deviceInfo2.getDeviceId());
assertTrue(String.format("Incorrect device connection from '%s' we get '%s' contains '%s'", deviceInfo1, ctrl.getDevicesMap(), deviceId1), ctrl.getDevicesMap().containsKey(deviceId1));
assertTrue("Incorrect device connection", ctrl.getDevicesMap().containsKey(deviceId2));
assertEquals("Incorrect device connection", 2, ctrl.getDevicesMap().size());
}
use of org.onosproject.netconf.NetconfDevice in project onos by opennetworkinglab.
the class CienaWaveserverAiDeviceDescription method getNetconfSession.
/**
* Returns the NETCONF session of the device.
*
* @return session
*/
private NetconfSession getNetconfSession() {
NetconfController controller = checkNotNull(handler().get(NetconfController.class));
NetconfDevice ncDevice = controller.getDevicesMap().get(handler().data().deviceId());
if (ncDevice == null) {
log.error("Internal ONOS Error. Device has been marked as reachable, " + "but deviceID {} is not in Devices Map. Continuing with empty description", handler().data().deviceId());
}
return controller.getDevicesMap().get(handler().data().deviceId()).getSession();
}
Aggregations