Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.HarvestHistoryRepository


                return OperResult.NOT_FOUND;
            }
            ah.destroy();
            settingMan.remove("harvesting/id:" + id);

            final HarvestHistoryRepository historyRepository = context.getBean(HarvestHistoryRepository.class);
            // set deleted status in harvest history table to 'y'
            historyRepository.markAllAsDeleted(ah.getParams().uuid);
            hmHarvesters.remove(id);
            return OperResult.OK;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        historyEl.addContent(new Element("cleared").
                setAttribute("recordsRemoved", numberOfRecordsRemoved + ""));
        final String lastRun = new DateTime().withZone(DateTimeZone.forID("UTC")).toString();
        ISODate lastRunDate = new ISODate(lastRun);

        HarvestHistoryRepository historyRepository = context.getBean(HarvestHistoryRepository.class);
        HarvestHistory history = new HarvestHistory();
        history.setDeleted(true);
        history.setElapsedTime((int) elapsedTime);
        history.setHarvestDate(lastRunDate);
        history.setHarvesterName(ah.getParams().name);
        history.setHarvesterType(ah.getType());
        history.setHarvesterUuid(ah.getParams().uuid);
        history.setInfo(historyEl);
        history.setParams(ah.getParams().node);

        historyRepository.save(history);
        return OperResult.OK;
    }}
View Full Code Here

    if ((sort != null) && (sort.equals("type"))) {
            sortCriteria = "type";
        }

        final HarvestHistoryRepository historyRepository = context.getBean(HarvestHistoryRepository.class);

        final Sort.Order harvestDateOrder = new Sort.Order(Sort.Direction.DESC, createPath(HarvestHistory_.harvestDate));
        final Sort.Order harvesterUuidOrder = new Sort.Order(createPath(HarvestHistory_.harvesterUuid));
        final Sort.Order harvesterTypeSort = new Sort.Order(createPath(HarvestHistory_.harvesterType));

        Sort springSort;
        if (sortCriteria.equals("date")) {
            springSort = new Sort(harvestDateOrder, harvesterUuidOrder);
        } else {
            springSort = new Sort(harvesterTypeSort, harvestDateOrder);
        }

        Element result;
        if ((uuid == null) || (uuid.equals(""))) {
            result = historyRepository.findAllAsXml(springSort);
    } else {
            result = historyRepository.findAllAsXml(hasHarvesterUuid(uuid), springSort);
        }


        String id = params.getChildText("id");
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.HarvestHistoryRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.