Search in sources :

Example 1 with BallotDocumentElement

use of com.hack23.cia.model.external.riksdagen.voteringlista.impl.BallotDocumentElement in project cia by Hack23.

the class RiksdagenBallotListWorkGeneratorImpl method generateWorkOrders.

@Override
public void generateWorkOrders() {
    try {
        final List<BallotDocumentElement> ballotList = riksdagenApi.getBallotList();
        final Map<String, String> alreadySavedIdMap = getImportService().getLoadedBallotIdMap();
        for (final BallotDocumentElement ballotDocument : ballotList) {
            if (!alreadySavedIdMap.containsKey(ballotDocument.getBallotId())) {
                getJmsSender().send(voteDataWorkdestination, ballotDocument.getBallotId());
                LOGGER.info("Load : https://data.riksdagen.se/votering/{}", ballotDocument.getBallotId());
            }
        }
    } catch (final DataFailureException e) {
        LOGGER.warn("Loadin ballots", e);
    }
}
Also used : DataFailureException(com.hack23.cia.service.external.riksdagen.api.DataFailureException) BallotDocumentElement(com.hack23.cia.model.external.riksdagen.voteringlista.impl.BallotDocumentElement)

Aggregations

BallotDocumentElement (com.hack23.cia.model.external.riksdagen.voteringlista.impl.BallotDocumentElement)1 DataFailureException (com.hack23.cia.service.external.riksdagen.api.DataFailureException)1