@Test public void processRequestGetSpecificYangModules() throws Exception { m_libraryConsultAdapter.processRequest(m_clientInfo, REQUEST_SPECIFIC_USED_YANG_MODULE); verify(m_libConsultMgr).getSpecificUsedYangModules(anyString(), anyString(), any()); }
@Override public String processRequest(NetconfClientInfo clientInfo, String netconfRequest) throws DispatchException { QueryYangModuleInUseRpc queryYangModuleInUseRpc = QueryYangModuleInUseRpc.getInstance(netconfRequest); return processRequestInternal(netconfRequest, null, (Document document, String devName) -> { UsedYangModules usedYangModules = queryYangModuleInUseRpc.getUsedYangModules(); if (usedYangModules == null) { return null; } List<YangModule> yangModules = usedYangModules.getYangModules(); if ((yangModules != null) && (!yangModules.isEmpty())) { YangModule filterModule = yangModules.get(0); return m_libConsultMgr.getSpecificUsedYangModules(filterModule.getName(), filterModule.getRevision(), document); } return m_libConsultMgr.getAllUsedYangModules(document); }); }
LibraryConsultAdapter implements GlobalRequestProcessor, DeviceConfigProcessor { @Override public String processRequest(NetconfClientInfo clientInfo, String netconfRequest) throws DispatchException { QueryYangModuleInUseRpc queryYangModuleInUseRpc = QueryYangModuleInUseRpc.getInstance(netconfRequest); return processRequestInternal(netconfRequest, null, (Document document, String devName) -> { UsedYangModules usedYangModules = queryYangModuleInUseRpc.getUsedYangModules(); if (usedYangModules == null) { return null; } List<YangModule> yangModules = usedYangModules.getYangModules(); if ((yangModules != null) && (!yangModules.isEmpty())) { YangModule filterModule = yangModules.get(0); return m_libConsultMgr.getSpecificUsedYangModules(filterModule.getName(), filterModule.getRevision(), document); } return m_libConsultMgr.getAllUsedYangModules(document); }); } }
LibraryConsultAdapter implements GlobalRequestProcessor, DeviceConfigProcessor { @Override public String processRequest(NetconfClientInfo clientInfo, String netconfRequest) throws DispatchException { QueryYangModuleInUseRpc queryYangModuleInUseRpc = QueryYangModuleInUseRpc.getInstance(netconfRequest); return processRequestInternal(netconfRequest, null, (Document document, String devName) -> { UsedYangModules usedYangModules = queryYangModuleInUseRpc.getUsedYangModules(); if (usedYangModules == null) { return null; } List<YangModule> yangModules = usedYangModules.getYangModules(); if ((yangModules != null) && (!yangModules.isEmpty())) { YangModule filterModule = yangModules.get(0); return m_libConsultMgr.getSpecificUsedYangModules(filterModule.getName(), filterModule.getRevision(), document); } return m_libConsultMgr.getAllUsedYangModules(document); }); } LibraryConsultAdapter(Aggregator aggregator, LibConsultMgr libConsultMgr); }
LibraryConsultAdapter implements GlobalRequestProcessor, DeviceConfigProcessor { @Override public String processRequest(NetconfClientInfo clientInfo, String netconfRequest) throws DispatchException { QueryYangModuleInUseRpc queryYangModuleInUseRpc = QueryYangModuleInUseRpc.getInstance(netconfRequest); return processRequestInternal(netconfRequest, null, (Document document, String devName) -> { UsedYangModules usedYangModules = queryYangModuleInUseRpc.getUsedYangModules(); if (usedYangModules == null) { return null; } List<YangModule> yangModules = usedYangModules.getYangModules(); if ((yangModules != null) && (!yangModules.isEmpty())) { YangModule filterModule = yangModules.get(0); return m_libConsultMgr.getSpecificUsedYangModules(filterModule.getName(), filterModule.getRevision(), document); } return m_libConsultMgr.getAllUsedYangModules(document); }); } LibraryConsultAdapter(Aggregator aggregator, LibConsultMgr libConsultMgr); void init(); void destroy(); @Override String processRequest(NetconfClientInfo clientInfo, String netconfRequest); @Override String processRequest(String deviceName, String netconfRequest); }
LibraryConsultAdapter implements GlobalRequestProcessor, DeviceConfigProcessor { @Override public String processRequest(NetconfClientInfo clientInfo, String netconfRequest) throws DispatchException { QueryYangModuleInUseRpc queryYangModuleInUseRpc = QueryYangModuleInUseRpc.getInstance(netconfRequest); return processRequestInternal(netconfRequest, null, (Document document, String devName) -> { UsedYangModules usedYangModules = queryYangModuleInUseRpc.getUsedYangModules(); if (usedYangModules == null) { return null; } List<YangModule> yangModules = usedYangModules.getYangModules(); if ((yangModules != null) && (!yangModules.isEmpty())) { YangModule filterModule = yangModules.get(0); return m_libConsultMgr.getSpecificUsedYangModules(filterModule.getName(), filterModule.getRevision(), document); } return m_libConsultMgr.getAllUsedYangModules(document); }); } LibraryConsultAdapter(Aggregator aggregator, LibConsultMgr libConsultMgr); void init(); void destroy(); @Override String processRequest(NetconfClientInfo clientInfo, String netconfRequest); @Override String processRequest(String deviceName, String netconfRequest);  }