Search in sources :

Example 1 with GtfsRealtimeFuzzyTripMatcher

use of org.opentripplanner.updater.GtfsRealtimeFuzzyTripMatcher in project OpenTripPlanner by opentripplanner.

the class GtfsRealtimeAlertsUpdater method configurePolling.

@Override
protected void configurePolling(Graph graph, JsonNode config) throws Exception {
    // TODO: add options to choose different patch services
    AlertPatchService alertPatchService = new AlertPatchServiceImpl(graph);
    this.alertPatchService = alertPatchService;
    String url = config.path("url").asText();
    if (url == null) {
        throw new IllegalArgumentException("Missing mandatory 'url' parameter");
    }
    this.url = url;
    this.earlyStart = config.path("earlyStartSec").asInt(0);
    this.feedId = config.path("feedId").asText();
    if (config.path("fuzzyTripMatching").asBoolean(false)) {
        this.fuzzyTripMatcher = new GtfsRealtimeFuzzyTripMatcher(graph.index);
    }
    LOG.info("Creating real-time alert updater running every {} seconds : {}", frequencySec, url);
}
Also used : GtfsRealtimeFuzzyTripMatcher(org.opentripplanner.updater.GtfsRealtimeFuzzyTripMatcher) AlertPatchService(org.opentripplanner.routing.services.AlertPatchService) AlertPatchServiceImpl(org.opentripplanner.routing.impl.AlertPatchServiceImpl)

Aggregations

AlertPatchServiceImpl (org.opentripplanner.routing.impl.AlertPatchServiceImpl)1 AlertPatchService (org.opentripplanner.routing.services.AlertPatchService)1 GtfsRealtimeFuzzyTripMatcher (org.opentripplanner.updater.GtfsRealtimeFuzzyTripMatcher)1