@Test public void testExceptionIsThrownWhenDeviceNotManaged() throws ExecutionException { try { m_pmaRegistry.executeNC("device2", ""); fail("Expected an exception here"); } catch (IllegalArgumentException e) { assertEquals("Device not managed : device2", e.getMessage()); } }
@Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) public Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest) throws IllegalArgumentException, IllegalStateException, ExecutionException { return executeWithPmaSession(deviceName, session -> session.executeNC(netconfRequest)); }
PmaRegistryImpl implements PmaRegistry { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) public Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest) throws IllegalArgumentException, IllegalStateException, ExecutionException { return executeWithPmaSession(deviceName, session -> session.executeNC(netconfRequest)); } }
PmaRegistryImpl implements PmaRegistry { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) public Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest) throws IllegalArgumentException, IllegalStateException, ExecutionException { return executeWithPmaSession(deviceName, session -> session.executeNC(netconfRequest)); } PmaRegistryImpl(DeviceManager deviceManager,
                           PmaSessionFactory factory); }
PmaRegistryImpl implements PmaRegistry { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) public Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest) throws IllegalArgumentException, IllegalStateException, ExecutionException { return executeWithPmaSession(deviceName, session -> session.executeNC(netconfRequest)); } PmaRegistryImpl(DeviceManager deviceManager,
                           PmaSessionFactory factory); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest); @Override RT executeWithPmaSession(String deviceName, PmaSessionTemplate<RT> sessionTemplate); @Override void forceAlign(String deviceName); @Override void align(String deviceName); void deviceRemoved(String deviceName); @Override NetConfResponse getAllPersistCfg(String deviceName); }
PmaRegistryImpl implements PmaRegistry { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) public Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest) throws IllegalArgumentException, IllegalStateException, ExecutionException { return executeWithPmaSession(deviceName, session -> session.executeNC(netconfRequest)); } PmaRegistryImpl(DeviceManager deviceManager,
                           PmaSessionFactory factory); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class, Exception.class}) Map<NetConfResponse, List<Notification>> executeNC(String deviceName, String netconfRequest); @Override RT executeWithPmaSession(String deviceName, PmaSessionTemplate<RT> sessionTemplate); @Override void forceAlign(String deviceName); @Override void align(String deviceName); void deviceRemoved(String deviceName); @Override NetConfResponse getAllPersistCfg(String deviceName); static final String COMPONENT_ID; }