Search in sources :

Example 11 with SessionBinder

use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.

the class KrameriusItemReaderNoSorting method beforeStep.

@Override
public void beforeStep(StepExecution stepExecution) {
    try (SessionBinder sess = hibernateSync.register()) {
        conf = configDao.get(confId);
        if (confId == null) {
            throw new IllegalArgumentException(String.format("Kramerius harvest configuration with id=%s not found", confId));
        }
        KrameriusHarvesterParams params = new KrameriusHarvesterParams();
        params.setUrl(conf.getUrl());
        params.setMetadataStream(conf.getMetadataStream());
        params.setQueryRows(conf.getQueryRows());
        params.setFrom(fromDate);
        params.setUntil(untilDate);
        kHarvester = harvesterFactory.createNoSorting(params, confId);
    }
}
Also used : SessionBinder(cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder)

Aggregations

SessionBinder (cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder)11 OAIHarvestConfiguration (cz.mzk.recordmanager.server.model.OAIHarvestConfiguration)6 DownloadImportConfiguration (cz.mzk.recordmanager.server.model.DownloadImportConfiguration)2 RegexpExtractor (cz.mzk.recordmanager.server.util.RegexpExtractor)2 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)2 TransformerFactory (javax.xml.transform.TransformerFactory)2 KrameriusConfiguration (cz.mzk.recordmanager.server.model.KrameriusConfiguration)1