+ private ImmutableTriple<String, Map<String, String>, Collection<ModuleReference>>
+ getAllModuleReferencesAndNewYangResourcesByModuleSetTag(final YangModelCmHandle yangModelCmHandle,
+ final boolean inUpgrade) {
+
+ final String moduleSetTag = getModuleSetTag(yangModelCmHandle, inUpgrade);
+ final Collection<ModuleReference> allModuleReferences;
+ Map<String, String> newYangResources = Collections.emptyMap();
+
+ final Optional<DataNode> optionalDataNode = getFirstReadyDataNodeByModuleSetTagProvidedInDb(moduleSetTag);
+
+ if (optionalDataNode.isPresent()) {
+ log.info("Found other cm handle having same module set tag: {}", moduleSetTag);
+ final String otherAnchorWithSameModuleSetTag
+ = YangDataConverter.extractCmHandleIdFromXpath(optionalDataNode.get().getXpath());
+ allModuleReferences = cpsModuleService.getYangResourcesModuleReferences(
+ NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, otherAnchorWithSameModuleSetTag);
+ } else {
+ allModuleReferences = dmiModelOperations.getModuleReferences(yangModelCmHandle);
+ newYangResources = getNewModuleNameToContentMap(yangModelCmHandle, allModuleReferences);
+ }
+ return ImmutableTriple.of(moduleSetTag, newYangResources, allModuleReferences);
+ }
+
+ private Optional<DataNode> getFirstReadyDataNodeByModuleSetTagProvidedInDb(final String moduleSetTag) {