@@ -0,0 +1,1845 @@
+package no.uio.ifi.trackfind.backend.data.providers.trackhub;%0A%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport no.uio.ifi.trackfind.backend.annotations.VersionedComponent;%0Aimport no.uio.ifi.trackfind.backend.data.providers.AbstractDataProvider;%0Aimport org.apache.commons.collections4.MapUtils;%0Aimport org.apache.lucene.index.IndexWriter;%0A%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.net.URL;%0Aimport java.util.Collection;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * Draft of Data Provider for TrackHub%0A *%0A * @author Dmytro Titov%0A */%0A@Slf4j%0A@VersionedComponent%0Apublic class TrackHubDataProvider extends AbstractDataProvider %7B%0A%0A    private static final String FETCH_URL = %22https://hyperbrowser.uio.no/hb/static/hyperbrowser/files/trackfind/blueprint_hub.json%22;%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    @SuppressWarnings(%22unchecked%22)%0A    @Override%0A    protected void fetchData(IndexWriter indexWriter) %7B%0A        try (InputStream inputStream = new URL(FETCH_URL).openStream();%0A             InputStreamReader reader = new InputStreamReader(inputStream)) %7B%0A            Map document = gson.fromJson(reader, Map.class);%0A            Map hitsMap = MapUtils.getMap(document, %22hits%22);%0A            Collection%3CMap%3E hits = (Collection%3CMap%3E) hitsMap.get(%22hits%22);%0A            Collection%3CMap%3E datasets = new HashSet%3C%3E();%0A            for (Map hit : hits) %7B%0A                Map source = MapUtils.getMap(hit, %22_source%22);%0A                Collection%3CMap%3E data = (Collection%3CMap%3E) source.get(%22data%22);%0A                datasets.addAll(data);%0A            %7D%0A            indexWriter.addDocuments(datasets.parallelStream().map(this::postprocessDataset).map(mapToDocumentConverter).collect(Collectors.toSet()));%0A        %7D catch (Exception e) %7B%0A            log.error(e.getMessage(), e);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add TrackHubDataProvider.