@Test public void testFullResyncSendsCC() throws NetconfMessageBuilderException, IOException, SAXException { m_session.forceAlign(); verify(m_server).executeNetconf(m_reqCaptor.capture()); String expect = "<rpc message-id=\"internal\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" + " <get-config>\n" + " <source>\n" + " <running/>\n" + " </source>\n" + " </get-config>\n" + "</rpc>\n"; TestUtil.assertXMLEquals(DocumentUtils.stringToDocument(expect).getDocumentElement(), DocumentUtils.stringToDocument(m_reqCaptor.getAllValues().get(0).requestToString()).getDocumentElement()); verify(m_das).forceAlign(any(Device.class), any(NetConfResponse.class)); }
@Override public void forceAlign() { try { PmaServer.setCurrentDevice(m_device); GetConfigRequest getConfig = new GetConfigRequest(); getConfig.setSourceRunning(); getConfig.setMessageId("internal"); Map.Entry<NetConfResponse, List<Notification>> entry = getNetConfResponseListEntry(getConfig); m_das.forceAlign(m_device, entry.getKey()); } finally { PmaServer.clearCurrentDevice(); } }
PmaServerSession implements PmaSession { @Override public void forceAlign() { try { PmaServer.setCurrentDevice(m_device); GetConfigRequest getConfig = new GetConfigRequest(); getConfig.setSourceRunning(); getConfig.setMessageId("internal"); Map.Entry<NetConfResponse, List<Notification>> entry = getNetConfResponseListEntry(getConfig); m_das.forceAlign(m_device, entry.getKey()); } finally { PmaServer.clearCurrentDevice(); } } }
PmaServerSession implements PmaSession { @Override public void forceAlign() { try { PmaServer.setCurrentDevice(m_device); GetConfigRequest getConfig = new GetConfigRequest(); getConfig.setSourceRunning(); getConfig.setMessageId("internal"); Map.Entry<NetConfResponse, List<Notification>> entry = getNetConfResponseListEntry(getConfig); m_das.forceAlign(m_device, entry.getKey()); } finally { PmaServer.clearCurrentDevice(); } } PmaServerSession(Device device, PmaServer pmaServer, NetconfDeviceAlignmentService das); }
PmaServerSession implements PmaSession { @Override public void forceAlign() { try { PmaServer.setCurrentDevice(m_device); GetConfigRequest getConfig = new GetConfigRequest(); getConfig.setSourceRunning(); getConfig.setMessageId("internal"); Map.Entry<NetConfResponse, List<Notification>> entry = getNetConfResponseListEntry(getConfig); m_das.forceAlign(m_device, entry.getKey()); } 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 void forceAlign() { try { PmaServer.setCurrentDevice(m_device); GetConfigRequest getConfig = new GetConfigRequest(); getConfig.setSourceRunning(); getConfig.setMessageId("internal"); Map.Entry<NetConfResponse, List<Notification>> entry = getNetConfResponseListEntry(getConfig); m_das.forceAlign(m_device, entry.getKey()); } 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();  }