@Test public void testPmaSessionContactsPmaServer() throws NetconfMessageBuilderException, IOException, SAXException { m_session.executeNC(EDIT_REQ); verify(m_server).executeNetconf(m_reqCaptor.capture()); TestUtil.assertXMLEquals(DocumentUtils.stringToDocument(EDIT_REQ).getDocumentElement(), DocumentUtils.stringToDocument(m_reqCaptor.getValue().requestToString()).getDocumentElement()); }
@Override public Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest) { try { PmaServer.setCurrentDevice(m_device); Document document = null; document = DocumentUtils.stringToDocument(netconfRequest); AbstractNetconfRequest request = DocumentToPojoTransformer.getRequest(document); return m_pmaServer.executeNetconf(request); } catch (NetconfMessageBuilderException e) { throw new IllegalArgumentException(String.format("Invalid netconf request received : %s for device %s", netconfRequest, m_device), e); } finally { PmaServer.clearCurrentDevice(); } }
PmaServerSession implements PmaSession { @Override public Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest) { try { PmaServer.setCurrentDevice(m_device); Document document = null; document = DocumentUtils.stringToDocument(netconfRequest); AbstractNetconfRequest request = DocumentToPojoTransformer.getRequest(document); return m_pmaServer.executeNetconf(request); } catch (NetconfMessageBuilderException e) { throw new IllegalArgumentException(String.format("Invalid netconf request received : %s for device %s", netconfRequest, m_device), e); } finally { PmaServer.clearCurrentDevice(); } } }
PmaServerSession implements PmaSession { @Override public Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest) { try { PmaServer.setCurrentDevice(m_device); Document document = null; document = DocumentUtils.stringToDocument(netconfRequest); AbstractNetconfRequest request = DocumentToPojoTransformer.getRequest(document); return m_pmaServer.executeNetconf(request); } catch (NetconfMessageBuilderException e) { throw new IllegalArgumentException(String.format("Invalid netconf request received : %s for device %s", netconfRequest, m_device), e); } finally { PmaServer.clearCurrentDevice(); } } PmaServerSession(Device device, PmaServer pmaServer, NetconfDeviceAlignmentService das); }
PmaServerSession implements PmaSession { @Override public Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest) { try { PmaServer.setCurrentDevice(m_device); Document document = null; document = DocumentUtils.stringToDocument(netconfRequest); AbstractNetconfRequest request = DocumentToPojoTransformer.getRequest(document); return m_pmaServer.executeNetconf(request); } catch (NetconfMessageBuilderException e) { throw new IllegalArgumentException(String.format("Invalid netconf request received : %s for device %s", netconfRequest, m_device), e); } finally { PmaServer.clearCurrentDevice(); } } PmaServerSession(Device device, PmaServer pmaServer, NetconfDeviceAlignmentService das); @Override Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest); @Override void forceAlign(); @Override void align(); boolean isActive(); @Override NetConfResponse getAllPersistCfg(); }
PmaServerSession implements PmaSession { @Override public Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest) { try { PmaServer.setCurrentDevice(m_device); Document document = null; document = DocumentUtils.stringToDocument(netconfRequest); AbstractNetconfRequest request = DocumentToPojoTransformer.getRequest(document); return m_pmaServer.executeNetconf(request); } catch (NetconfMessageBuilderException e) { throw new IllegalArgumentException(String.format("Invalid netconf request received : %s for device %s", netconfRequest, m_device), e); } finally { PmaServer.clearCurrentDevice(); } } PmaServerSession(Device device, PmaServer pmaServer, NetconfDeviceAlignmentService das); @Override Map<NetConfResponse, List<Notification>> executeNC(String netconfRequest); @Override void forceAlign(); @Override void align(); boolean isActive(); @Override NetConfResponse getAllPersistCfg();  }