Package org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime

Examples of org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.MonitoredResult


        _log.warn("error refreshing data", ex);
      }
    }

    private void preHandleRefresh() {
      _currentResult = new MonitoredResult();
      _currentResult.setAgencyIds(_agencyIds);
    }
View Full Code Here


 
  protected int getTotalRecordCount(String agencyId) throws Exception {
    int totalRecords = 0;

    for (MonitoredDataSource mds : getDataSources()) {
      MonitoredResult result = mds.getMonitoredResult();
      if (result == null) continue;
      for (String mAgencyId : result.getAgencyIds()) {
        if (agencyId.equals(mAgencyId)) {
          totalRecords += result.getRecordsTotal();
        }
      }
    }
    return totalRecords;
  }
View Full Code Here

 
  protected List<String> getValidRealtimeTripIds(String agencyId) {
    Set<String> tripIds = new HashSet<String>();

    for (MonitoredDataSource mds : getDataSources()) {
      MonitoredResult result = mds.getMonitoredResult();
      if (result == null) continue;
      for (String tripId : result.getMatchedTripIds()) {
        if (agencyId.equals(AgencyAndIdLibrary.convertFromString(tripId).getAgencyId())) {
          tripIds.add(tripId);
        }
      }
    }
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("matched-stops", "con configured data sources")).build();
      }

      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            matchedStopIds.addAll(result.getMatchedStopIds());
          }
        }
      }

      return Response.ok(ok("matched-stops", matchedStopIds.size())).build();
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("unmatched-stops", "no configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          _log.debug("examining agency=" + mAgencyId + " with unmatched stops=" + result.getUnmatchedStopIds().size());
          if (agencyId.equals(mAgencyId)) {
            unmatchedStops += result.getUnmatchedStopIds().size();
          }
        }
      }
      return Response.ok(ok("unmatched-stops", unmatchedStops)).build();
    } catch (Exception e) {
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("unmatched-stop-ids", "con configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            unmatchedStopIds.addAll(result.getUnmatchedStopIds());
          }
        }
      }
      return Response.ok(ok("unmatched-stop-ids", unmatchedStopIds)).build();
    } catch (Exception e) {
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("last-update-delta", "no configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            lastUpdate += result.getLastUpdate();
          }
        }
      }
      return Response.ok(ok("last-update-delta", (System.currentTimeMillis() - lastUpdate)/1000)).build();
    } catch (Exception e) {
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("total-lat-lon-count", "no configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            totalLatLons.addAll(result.getAllCoordinates());
          }
        }
      }
      return Response.ok(ok("total-lat-lon-count", totalLatLons.size())).build();
    } catch (Exception e) {
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("invalid-lat-lon-count", "no configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            invalidLatLons.addAll(findInvalidLatLon(agencyId, result.getAllCoordinates()));
          }
        }
      }
      return Response.ok(ok("invalid-lat-lon-count", invalidLatLons.size())).build();
    } catch (Exception e) {
View Full Code Here

        _log.error("no configured data sources");
        return Response.ok(error("invalid-lat-lons", "no configured data sources")).build();
      }
     
      for (MonitoredDataSource mds : getDataSources()) {
        MonitoredResult result = mds.getMonitoredResult();
        if (result == null) continue;
        for (String mAgencyId : result.getAgencyIds()) {
          if (agencyId.equals(mAgencyId)) {
            invalidLatLons.addAll(findInvalidLatLon(agencyId, result.getAllCoordinates()));
          }
        }
      }
      return Response.ok(ok("invalid-lat-lons", invalidLatLons)).build();
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.MonitoredResult

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.