[Subcommunities] remove not needed methods used to create datasourceCommunityMap

This commit is contained in:
Miriam Baglioni 2024-11-21 11:05:58 +01:00
parent ba9f1982b3
commit 0656ed568d
1 changed files with 0 additions and 41 deletions

View File

@ -359,47 +359,6 @@ public class Utils implements Serializable {
.collect(Collectors.toList());
}
public static CommunityEntityMap getCommunityDatasource(String baseURL) throws IOException {
CommunityEntityMap datasourceMap = new CommunityEntityMap();
getValidCommunities(baseURL)
.forEach(community -> {
getRelatedDatasource(community.getId(), baseURL, datasourceMap);
try {
List<SubCommunityModel> subcommunities = getSubcommunities(community.getId(), baseURL);
subcommunities.forEach(sc -> getRelatedDatasource(community.getId(), sc.getSubCommunityId(), baseURL, datasourceMap));
} catch (IOException e) {
throw new RuntimeException(e);
}
});
return datasourceMap;
}
private static void getRelatedDatasource(String communityId, String baseURL, CommunityEntityMap communityEntityMap){
try {
List<String> associatedDatasources = MAPPER
.readValue(
QueryCommunityAPI.communityDatasource(communityId, baseURL), EntityIdentifierList.class);
associatedDatasources.forEach(d -> communityEntityMap.add(ModelSupport.getIdPrefix(Datasource.class) + "|" + d, communityId ));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private static void getRelatedDatasource(String communityId, String baseURL,String subcommunityId, CommunityEntityMap communityEntityMap){
try {
List<String> associatedDatasources = MAPPER
.readValue(
QueryCommunityAPI.subcommunityDatasource(communityId, subcommunityId, baseURL), EntityIdentifierList.class);
associatedDatasources.forEach(d -> communityEntityMap.add(ModelSupport.getIdPrefix(Datasource.class) + "|" + d, communityId ));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}