class RrdpServiceImpl implements RrdpService {

    int storeSnapshotObjects(List<SnapshotObject> snapshotObjects,
                             final RpkiRepositoryValidationRun validationRun) {
        final AtomicInteger counter = new AtomicInteger();

        // Parsing RPKI objects is CPU bound, so do this with any available threads
        List<Either<ValidationResult, Pair<String, RpkiObject>>> converted = snapshotObjects.parallelStream().map((value) ->
                RpkiObjectUtils.createRpkiObject(value.getUri(), value.getContent())
        ).collect(Collectors.toList());

        storage.writeTx0(tx -> converted.forEach((maybeRpkiObject) ->
                storeSnapshotObject(tx, validationRun, maybeRpkiObject, counter)
        ));

        return counter.get();
    }

    @Autowired public  RrdpServiceImpl(
            final RrdpClient rrdpClient,
            final RpkiObjects rpkiObjects,
            final RpkiRepositories rpkiRepositories,
            final Storage storage,
            final RrdpMetricsService rrdpMetrics
    );

}