Commit 6332a9ce authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

410: Convert to Spring Boot library and application (OPENED)

Task-Url: #410
parent 3041d8c2
Pipeline #23177 failed with stage
in 14 seconds
......@@ -7,7 +7,7 @@ import java.util.Map;
import org.joda.time.DateTime;
import org.joda.time.Period;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
......@@ -22,6 +22,7 @@ import eu.dariah.de.colreg.pojo.api.ExtendedCollectionApiPojo;
import eu.dariah.de.colreg.pojo.api.results.CollectionApiResultPojo;
import eu.dariah.de.search.Constants.AccessMethods;
import eu.dariah.de.search.api.client.base.BaseApiClientImpl;
import eu.dariah.de.search.config.MainConfigProperties;
import eu.dariah.de.search.model.Collection;
import eu.dariah.de.search.model.Dataset;
import eu.dariah.de.search.model.Endpoint;
......@@ -31,23 +32,12 @@ import eu.dariah.de.search.model.Endpoint;
public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, ExtendedCollectionApiPojo> {
private static final String defaultUnclosedFrequencyKey = "_defaultUnclosed";
@Autowired private MainConfigProperties config;
private Map<String, Period> updateFrequencyMap;
private List<String> knownUpdatePolicies;
private List<Collection> currentCollections;
@Value("${url.colreg}")
private String colregUrl;
@Value("${datamodels.special.oai_dc:#{null}}")
private String oaidcModel;
@Value("${api.colreg.fetch_all}")
private String fetchAllUrl;
@Value("${api.colreg.fetch_detail}")
private String fetchDetailUrl;
public List<Collection> getCurrentCollections() { return currentCollections; }
public void setCurrentCollections(List<Collection> currentCollections) { this.currentCollections = currentCollections; }
......@@ -56,12 +46,10 @@ public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, E
public List<String> getKnownUpdatePolicies() { return knownUpdatePolicies; }
public void setKnownUpdatePolicies(List<String> knownUpdatePolicies) { this.knownUpdatePolicies = knownUpdatePolicies; }
@Override protected String getFetchAllUrl() { return fetchAllUrl; }
@Override protected String getFetchDetailsUrl() { return fetchDetailUrl; }
@Override protected String getPingUrl() { return this.colregUrl; }
@Override protected String getFetchAllUrl() { return this.apiConfig.getColreg().getFetchAllUrl(); }
@Override protected String getFetchDetailsUrl() { return this.apiConfig.getColreg().getFetchDetailUrl(); }
@Override protected String getPingUrl() { return this.apiConfig.getDme().getBaseUrl(); }
public CollectionSyncClient() {
super(ExtendedCollectionApiPojo.class, (new CollectionApiPojo[0]).getClass());
......@@ -76,7 +64,7 @@ public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, E
// TExt result = restTemplate.getForObject(String.format(this.getFetchDetailsUrl(), id), entityClass);
String result = restTemplate.getForObject(String.format(this.getFetchDetailsUrl(), id), String.class);
CollectionApiResultPojo<ExtendedCollectionApiPojo> rPojo = objectMapper.readValue(result, new TypeReference<CollectionApiResultPojo<ExtendedCollectionApiPojo>>() {});
CollectionApiResultPojo<ExtendedCollectionApiPojo> rPojo = apiObjectMapper.readValue(result, new TypeReference<CollectionApiResultPojo<ExtendedCollectionApiPojo>>() {});
if (rPojo.getContent()!=null && rPojo.getContent().size()>0) {
return rPojo.getContent().iterator().next();
}
......@@ -92,7 +80,7 @@ public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, E
try {
String result = restTemplate.getForObject(requestUrl, String.class);
CollectionApiResultPojo<CollectionApiPojo> rPojo = objectMapper.readValue(result, new TypeReference<CollectionApiResultPojo<CollectionApiPojo>>() {});
CollectionApiResultPojo<CollectionApiPojo> rPojo = apiObjectMapper.readValue(result, new TypeReference<CollectionApiResultPojo<CollectionApiPojo>>() {});
return rPojo.getContent().toArray(new CollectionApiPojo[0]);
} catch (Exception e) {
logger.error(String.format("Error while executing [%s]: %s", requestUrl, e.getMessage()));
......@@ -354,9 +342,9 @@ public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, E
for (DatamodelPojo m : accessPojo.getDatamodels()) {
e.getDatasets().add(new Dataset(m.getId(), m.getAlias()));
}
} else if (oaidcModel!=null && accessPojo.getType().equals("OAI-PMH")) {
} else if (config.getDatamodels().getOaidcModel()!=null && accessPojo.getType().equals("OAI-PMH")) {
Dataset dsOaiDc = new Dataset();
dsOaiDc.setId(oaidcModel);
dsOaiDc.setId(config.getDatamodels().getOaidcModel());
e.getDatasets().add(dsOaiDc);
}
......
......@@ -5,12 +5,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import de.unibamberg.minf.dme.model.base.Grammar;
import de.unibamberg.minf.dme.model.grammar.GrammarContainer;
import de.unibamberg.minf.dme.model.serialization.MappingContainer;
import eu.dariah.de.search.api.client.base.BaseDmeClient;
import eu.dariah.de.search.model.ExtendedMappingContainer;
......@@ -22,28 +20,9 @@ public class DmeMappingClient extends BaseDmeClient<MappingContainer, MappingCon
private List<ExtendedMappingContainer> currentMappings;
private Map<String, Map<String, Grammar>> importMappingsGrammarsMap;
@Value("${url.dme}")
private String dmeUrl;
@Value("${api.dme.mapping_byST}")
private String fetchMappingBySourceAndTarget;
@Value("${api.dme.mapping_byT}")
private String fetchMappingByTarget;
@Value("${api.dme.mapping_byS}")
private String fetchMappingBySource;
@Value("${api.dme.mapping}")
private String fetchMappingDetails;
@Value("${api.dme.mappings}")
private String fetchAllUrl;
@Override protected String getFetchAllUrl() { return this.fetchAllUrl; }
@Override protected String getFetchDetailsUrl() { return this.fetchMappingDetails; }
@Override protected String getPingUrl() { return this.dmeUrl; }
@Override protected String getFetchAllUrl() { return this.apiConfig.getDme().getMappingsUrl(); }
@Override protected String getFetchDetailsUrl() { return this.apiConfig.getDme().getMappingUrl(); }
@Override protected String getPingUrl() { return this.apiConfig.getDme().getBaseUrl(); }
public List<ExtendedMappingContainer> getCurrentMappings() { return currentMappings; }
......
......@@ -5,7 +5,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
......@@ -13,7 +12,6 @@ import org.springframework.util.Assert;
import de.unibamberg.minf.dme.model.base.Element;
import de.unibamberg.minf.dme.model.base.Grammar;
import de.unibamberg.minf.dme.model.base.ModelElement;
import de.unibamberg.minf.dme.model.base.Nonterminal;
import de.unibamberg.minf.dme.model.datamodel.base.Datamodel;
import de.unibamberg.minf.dme.model.grammar.GrammarContainer;
import de.unibamberg.minf.dme.model.reference.Reference;
......@@ -29,28 +27,14 @@ public class DmeModelClient extends BaseDmeClient<DatamodelReferenceContainer, D
private List<ExtendedDatamodelContainer> currentDatamodels;
private Map<String, Map<String, GrammarContainer>> importDatamodelsGrammarsMap;
@Value("${url.dme}")
private String dmeUrl;
@Value("${api.dme.models}")
private String fetchAllUrl;
@Value("${api.dme.model}")
private String fetchModelDetails;
@Value("${api.dme.autocreate:true}")
private boolean autocreateModels;
public List<ExtendedDatamodelContainer> getCurrentDatamodels() { return currentDatamodels; }
public void setCurrentDatamodels(List<ExtendedDatamodelContainer> currentDatamodels) { this.currentDatamodels = currentDatamodels; }
@Override protected String getFetchAllUrl() { return this.fetchAllUrl; }
@Override protected String getFetchDetailsUrl() { return this.fetchModelDetails; }
@Override protected String getPingUrl() { return this.dmeUrl; }
@Override protected String getFetchAllUrl() { return this.apiConfig.getDme().getModelsUrl(); }
@Override protected String getFetchDetailsUrl() { return this.apiConfig.getDme().getModelUrl(); }
@Override protected String getPingUrl() { return this.apiConfig.getDme().getBaseUrl(); }
public DmeModelClient() {
super(DatamodelReferenceContainer.class, (new DatamodelReferenceContainer[0]).getClass());
......
......@@ -8,18 +8,21 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.unibamberg.minf.core.util.Stopwatch;
import eu.dariah.de.search.automation.base.ListeningSyncService;
import eu.dariah.de.search.config.ApiConfigProperties;
import eu.dariah.de.search.pojo.ApiStatusPojo;
public abstract class BaseApiClientImpl<TBase, TExt> implements ApiClient {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
protected ObjectMapper apiObjectMapper;
@Autowired protected RestTemplate restTemplate;
@Autowired protected ObjectMapper objectMapper;
@Autowired protected ApiConfigProperties apiConfig;
private ListeningSyncService syncListener;
private Class<TExt> entityClass;
......@@ -30,9 +33,12 @@ public abstract class BaseApiClientImpl<TBase, TExt> implements ApiClient {
public void setSyncListener(ListeningSyncService baseSyncService) { this.syncListener = baseSyncService; }
public BaseApiClientImpl(Class<TExt> entityClass, Class<? extends TBase[]> arrayClass) {
protected BaseApiClientImpl(Class<TExt> entityClass, Class<? extends TBase[]> arrayClass) {
this.entityClass = entityClass;
this.arrayClass = arrayClass;
this.apiObjectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
protected void notifyListenerSyncFailed() {
......@@ -83,7 +89,7 @@ public abstract class BaseApiClientImpl<TBase, TExt> implements ApiClient {
// Workaround with explicit type conversion because RestTemplate sometimes uses superclass of entityClass
// TExt result = restTemplate.getForObject(String.format(this.getFetchDetailsUrl(), id), entityClass);
String result = restTemplate.getForObject(String.format(this.getFetchDetailsUrl(), id), String.class);
return objectMapper.readValue(result, entityClass);
return apiObjectMapper.readValue(result, entityClass);
} catch (Exception e) {
logger.error(String.format("Error while fetching details [%s] for id [%s]: %s", this.getFetchDetailsUrl(), id, e.getMessage()));
return null;
......
......@@ -10,6 +10,7 @@ public class DatamodelConfigProperties {
private String presentation;
private String indexing;
private String metadata;
private String oaidcModel;
private List<String> modelsWithMessageCodes;
private String modelsMessageCodePrefix;
}
\ No newline at end of file
......@@ -2,17 +2,9 @@ package eu.dariah.de.search.crawling.crawler;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.joda.time.Period;
import org.slf4j.MDC;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContextAware;
import de.unibamberg.minf.dme.model.datamodel.NonterminalImpl;
import de.unibamberg.minf.processing.consumption.ResourceConsumptionService;
import de.unibamberg.minf.processing.exception.ProcessingConfigException;
......@@ -23,10 +15,10 @@ import eu.dariah.de.search.model.Endpoint;
import eu.dariah.de.search.model.ExtendedDatamodelContainer;
import eu.dariah.de.search.service.CrawlService;
public class FileProcessor extends ParallelFileProcessingService implements Processor, ResourceConsumptionService, InitializingBean {
public class FileProcessor extends ParallelFileProcessingService implements Processor, ResourceConsumptionService {
@Autowired private CrawlService crawlService;
@Autowired private List<String> antiPatterns;
@Autowired private List<String> fileProcessingAntiPatterns;
private boolean initialized = false;
......@@ -47,12 +39,6 @@ public class FileProcessor extends ParallelFileProcessingService implements Proc
return super.isInitialized() && initialized;
}
@SuppressWarnings("unchecked")
@Override
public void afterPropertiesSet() throws Exception {
this.antiPatterns = (List<String>)applicationContext.getBean("antiPatterns");
}
@Override
public void run() {
MDC.put("uid", crawlId);
......@@ -83,7 +69,7 @@ public class FileProcessor extends ParallelFileProcessingService implements Proc
try {
if (endpoint.getPatterns()!=null) {
this.setFileCollector(new MatchingFileCollector(Paths.get(this.getPath()), endpoint.getPatterns()));
this.getFileCollector().setAntiPatternStrings(antiPatterns);
this.getFileCollector().setAntiPatternStrings(fileProcessingAntiPatterns);
}
super.init();
} catch (ProcessingConfigException | IOException e) {
......
package eu.dariah.de.search.config;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import de.unibamberg.minf.gtf.GtfElementProcessor;
import de.unibamberg.minf.gtf.GtfMappingProcessor;
import de.unibamberg.minf.gtf.extensions.file.downloads.FileDownloader;
import de.unibamberg.minf.mapping.service.MappingExecutionServiceImpl;
import de.unibamberg.minf.processing.git.adapter.GitRepositoryAdapterImpl;
import de.unibamberg.minf.processing.service.json.JsonProcessingService;
import de.unibamberg.minf.processing.service.tabular.CsvProcessingService;
import de.unibamberg.minf.processing.service.tabular.TsvProcessingService;
import de.unibamberg.minf.processing.service.text.TextProcessingService;
import de.unibamberg.minf.processing.service.xml.XmlProcessingService;
import eu.dariah.de.search.config.nested.CrawlingAutomationConfigProperties;
import eu.dariah.de.search.crawling.TimedCrawlManagerImpl;
import eu.dariah.de.search.crawling.crawler.FileProcessor;
import eu.dariah.de.search.crawling.crawler.GitCrawlerImpl;
import eu.dariah.de.search.crawling.crawler.IndexCleaner;
import eu.dariah.de.search.crawling.crawler.OaiPmhCrawlerImpl;
import eu.dariah.de.search.crawling.files.FileUnarchiver;
import eu.dariah.de.search.crawling.files.FileUnpacker;
import eu.dariah.de.search.crawling.files.XmlChunker;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -20,6 +39,10 @@ import lombok.EqualsAndHashCode;
@Configuration
@ConfigurationProperties(prefix = "crawling")
public class CrawlingConfig extends CrawlingConfigProperties {
private int maxThreadsPerServiceType = 6;
private int apiAccessPolitenessSpanMs = 200;
@PostConstruct
public void completeConfiguration() {
if (this.getAutomation()==null) {
......@@ -44,13 +67,170 @@ public class CrawlingConfig extends CrawlingConfigProperties {
crawlManager.setAccessChains(accessChainMap);
Map<String, String> fileProcessingChainMap = new HashMap<>();
accessChainMap.put("XML", "fileUnpacker,fileUnarchiver,indexCleaner,xmlBatchFileProcessor");
accessChainMap.put("JSON", "fileUnpacker,fileUnarchiver,indexCleaner,jsonBatchFileProcessor");
accessChainMap.put("CSV", "fileUnpacker,fileUnarchiver,indexCleaner,csvBatchFileProcessor");
accessChainMap.put("TSV", "fileUnpacker,fileUnarchiver,indexCleaner,tsvBatchFileProcessor");
accessChainMap.put("TEXT", "fileUnpacker,fileUnarchiver,indexCleaner,textBatchFileProcessor");
fileProcessingChainMap.put("XML", "fileUnpacker,fileUnarchiver,indexCleaner,xmlBatchFileProcessor");
fileProcessingChainMap.put("JSON", "fileUnpacker,fileUnarchiver,indexCleaner,jsonBatchFileProcessor");
fileProcessingChainMap.put("CSV", "fileUnpacker,fileUnarchiver,indexCleaner,csvBatchFileProcessor");
fileProcessingChainMap.put("TSV", "fileUnpacker,fileUnarchiver,indexCleaner,tsvBatchFileProcessor");
fileProcessingChainMap.put("TEXT", "fileUnpacker,fileUnarchiver,indexCleaner,textBatchFileProcessor");
crawlManager.setFileProcessingChains(fileProcessingChainMap);
return crawlManager;
}
@Bean
@Scope("prototype")
public IndexCleaner indexCleaner() {
return new IndexCleaner();
}
@Bean
@Scope("prototype")
public OaiPmhCrawlerImpl oaipmhCrawler(GtfElementProcessor gtfElementProcessor) {
OaiPmhCrawlerImpl oaipmhCrawler = new OaiPmhCrawlerImpl();
oaipmhCrawler.setPolitenessTimespan(500);
return oaipmhCrawler;
}
@Bean
@Scope("prototype")
public GitCrawlerImpl gitCrawler() {
return new GitCrawlerImpl();
}
@Bean
@Scope("prototype")
public GitRepositoryAdapterImpl gitRepositoryAdapter() {
return new GitRepositoryAdapterImpl();
}
@Bean
@Scope("prototype")
public FileDownloader fileDownloader() {
return new FileDownloader();
}
@Bean
@Scope("prototype")
public FileUnpacker fileUnpacker() {
return new FileUnpacker();
}
@Bean
@Scope("prototype")
public FileUnarchiver fileUnarchiver() {
return new FileUnarchiver();
}
@Bean
@Scope("prototype")
public XmlChunker xmlChunker() {
return new XmlChunker();
}
@Bean
@Scope("prototype")
public XmlProcessingService xmlStringProcessor(GtfElementProcessor gtfElementProcessor) {
XmlProcessingService xmlStringProcessor = new XmlProcessingService();
xmlStringProcessor.setElementProcessors(new ArrayList<>());
xmlStringProcessor.getElementProcessors().add(gtfElementProcessor);
return xmlStringProcessor;
}
@Bean
@Scope("prototype")
public JsonProcessingService jsonProcessingService(GtfElementProcessor gtfElementProcessor) {
JsonProcessingService jsonProcessingService = new JsonProcessingService();
jsonProcessingService.setElementProcessors(new ArrayList<>());
jsonProcessingService.getElementProcessors().add(gtfElementProcessor);
return jsonProcessingService;
}
@Bean
@Scope("prototype")
public CsvProcessingService csvStringProcessor(GtfElementProcessor gtfElementProcessor) {
CsvProcessingService csvStringProcessor = new CsvProcessingService();
csvStringProcessor.setElementProcessors(new ArrayList<>());
csvStringProcessor.getElementProcessors().add(gtfElementProcessor);
return csvStringProcessor;
}
@Bean
@Scope("prototype")
public TsvProcessingService tsvStringProcessor(GtfElementProcessor gtfElementProcessor) {
TsvProcessingService tsvStringProcessor = new TsvProcessingService();
tsvStringProcessor.setElementProcessors(new ArrayList<>());
tsvStringProcessor.getElementProcessors().add(gtfElementProcessor);
return tsvStringProcessor;
}
@Bean
@Scope("prototype")
public TextProcessingService textStringProcessor(GtfElementProcessor gtfElementProcessor) {
TextProcessingService textStringProcessor = new TextProcessingService();
textStringProcessor.setElementProcessors(new ArrayList<>());
textStringProcessor.getElementProcessors().add(gtfElementProcessor);
return textStringProcessor;
}
@Bean
@Scope("prototype")
public MappingExecutionServiceImpl mappingExecutionService(GtfMappingProcessor gtfMappingProcessor) {
MappingExecutionServiceImpl mappingExecutionService = new MappingExecutionServiceImpl();
mappingExecutionService.setMappingProcessors(new ArrayList<>());
mappingExecutionService.getMappingProcessors().add(gtfMappingProcessor);
return mappingExecutionService;
}
@Bean
@Scope("prototype")
public FileProcessor xmlBatchFileProcessor() {
FileProcessor fileProcessor = new FileProcessor();
fileProcessor.setWrappedServiceType(XmlProcessingService.class);
fileProcessor.setMaxParallelThreads(6);
return fileProcessor;
}
@Bean
@Scope("prototype")
public FileProcessor jsonBatchFileProcessor() {
FileProcessor fileProcessor = new FileProcessor();
fileProcessor.setWrappedServiceType(JsonProcessingService.class);
fileProcessor.setMaxParallelThreads(6);
return fileProcessor;
}
@Bean
@Scope("prototype")
public FileProcessor textBatchFileProcessor() {
FileProcessor fileProcessor = new FileProcessor();
fileProcessor.setWrappedServiceType(TextProcessingService.class);
fileProcessor.setMaxParallelThreads(6);
return fileProcessor;
}
@Bean
@Scope("prototype")
public FileProcessor csvBatchFileProcessor() {
FileProcessor fileProcessor = new FileProcessor();
fileProcessor.setWrappedServiceType(CsvProcessingService.class);
fileProcessor.setMaxParallelThreads(6);
return fileProcessor;
}
@Bean
@Scope("prototype")
public FileProcessor tsvBatchFileProcessor() {
FileProcessor fileProcessor = new FileProcessor();
fileProcessor.setWrappedServiceType(TsvProcessingService.class);
fileProcessor.setMaxParallelThreads(6);
return fileProcessor;
}
@Bean
public List<String> fileProcessingAntiPatterns() {
List<String> fileProcessingAntiPatterns = new ArrayList<>();
fileProcessingAntiPatterns.add(".git/**");
return fileProcessingAntiPatterns;
}
}
......@@ -77,6 +77,9 @@ public class MainConfig extends MainConfigProperties {
if (paths.getDownloads()==null) {
paths.setDownloads(Paths.get(paths.getData(), "downloads").toString());
}
if (paths.getIndexingLogs()==null) {
paths.setIndexingLogs(Paths.get(paths.getData(), "indexingLogs").toString());
}
if (images==null) {
......
......@@ -16,6 +16,9 @@ import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.unibamberg.minf.gtf.DescriptionEngineImpl;
import de.unibamberg.minf.gtf.GtfElementProcessor;
import de.unibamberg.minf.gtf.GtfMappingProcessor;
import de.unibamberg.minf.gtf.MainEngine;
import de.unibamberg.minf.gtf.MainEngineImpl;
import de.unibamberg.minf.gtf.TransformationEngineImpl;
import de.unibamberg.minf.gtf.commands.CommandDispatcher;
......@@ -31,7 +34,6 @@ import de.unibamberg.minf.gtf.extensions.wiki.commands.WikiCommandsDispatcher;
import de.unibamberg.minf.gtf.transformation.processing.GlobalCommandDispatcher;
import de.unibamberg.minf.gtf.vocabulary.VocabularyEngine;
import eu.dariah.de.search.config.nested.FileConfigProperties;
import eu.dariah.de.search.exceptions.ConfigurationException;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -43,7 +45,7 @@ public class ProcessingConfig extends ProcessingConfigProperties {
@Autowired private MainConfigProperties mainConfig;
@PostConstruct
public void completeConfiguration() throws ConfigurationException {
public void completeConfiguration() {
if (this.getFile()==null) {
this.setFile(new FileConfigProperties());
}
......@@ -140,6 +142,22 @@ public class ProcessingConfig extends ProcessingConfigProperties {
return geoCommandsDispatcher;
}
@Bean
@Scope("prototype")
public GtfElementProcessor gtfElementProcessor(MainEngine mainEngine) {
GtfElementProcessor gtfElementProcessor = new GtfElementProcessor();
gtfElementProcessor.setMainEngine(mainEngine);
return gtfElementProcessor;
}
@Bean
@Scope("prototype")
public GtfMappingProcessor gtfMappingProcessor(MainEngine mainEngine) {
GtfMappingProcessor gtfMappingProcessor = new GtfMappingProcessor();
gtfMappingProcessor.setMainEngine(mainEngine);
return gtfMappingProcessor;
}
@Bean
public VocabularyEngine vocabularyEngine() {
return new VocabularyEngine();
......
......@@ -52,6 +52,10 @@ api:
dme:
base_url: https://teaching.clariah.de/dme/
crawling:
max_threads_per_service_type: 6