org.onebusaway.transit_data.services
Interface TransitDataService
- All Superinterfaces:
- FederatedService
public interface TransitDataService
- extends FederatedService
The TransitDataService
is the primary interface separating
user-interface modules that access transit data from the data providers that
contain the data.
The service is a FederatedService
, which means that multiple
TransitDataService
instances covering transit agencies across the
county can be stitched into one virtual service that seamlessly passes calls
to the appropriate underlying instance. As such, you'll notice that all the
service methods here are annotated with @FederatedBy... annotations that give
hints how the method should be dispatched between multiple instances.
Note that all methods return "bean" objects, which are POJOs designed for
flexibility in over-the-wire serialization for RPC and are separate from the
underlying representations in the datastore.
- Author:
- bdferris
Method Summary |
void |
cancelAlarmForArrivalAndDepartureAtStop(String alarmId)
|
ServiceAlertBean |
createServiceAlert(String agencyId,
ServiceAlertBean situation)
Service Alert Methods |
void |
deleteStopProblemReportForStopIdAndId(String stopId,
long id)
|
void |
deleteTripProblemReportForTripIdAndId(String tripId,
long id)
|
List<AgencyWithCoverageBean> |
getAgenciesWithCoverage()
The coverage area for each agency is generally the lat-lon bounds of all
stops served by that agency. |
AgencyBean |
getAgency(String agencyId)
|
ListBean<ServiceAlertBean> |
getAllServiceAlertsForAgencyId(String agencyId)
|
List<StopProblemReportBean> |
getAllStopProblemReportsForStopId(String stopId)
|
List<String> |
getAllTripProblemReportLabels()
|
List<TripProblemReportBean> |
getAllTripProblemReportsForTripId(String tripId)
|
ListBean<VehicleStatusBean> |
getAllVehiclesForAgency(String agencyId,
long time)
|
ArrivalAndDepartureBean |
getArrivalAndDepartureForStop(ArrivalAndDepartureForStopQueryBean query)
|
BlockBean |
getBlockForId(String blockId)
|
BlockInstanceBean |
getBlockInstance(String blockId,
long serviceDate)
|
ListBean<CurrentVehicleEstimateBean> |
getCurrentVehicleEstimates(CurrentVehicleEstimateQueryBean query)
|
ItinerariesBean |
getItinerariesBetween(TransitLocationBean from,
TransitLocationBean to,
long targetTime,
ConstraintsBean constraints)
Plan a trip between two locations at a particular time, with the specified
constraints. |
List<TimedPlaceBean> |
getLocalPaths(String agencyId,
ConstraintsBean constraints,
MinTravelTimeToStopsBean minTravelTimeToStops,
List<LocalSearchResult> localResults)
|
MinTravelTimeToStopsBean |
getMinTravelTimeToStopsFrom(CoordinatePoint location,
long time,
TransitShedConstraintsBean constraints)
|
RouteBean |
getRouteForId(String routeId)
|
ListBean<String> |
getRouteIdsForAgencyId(String agencyId)
|
RoutesBean |
getRoutes(SearchQueryBean query)
|
ListBean<RouteBean> |
getRoutesForAgencyId(String agencyId)
|
ScheduledBlockLocationBean |
getScheduledBlockLocationFromScheduledTime(String blockId,
long serviceDate,
int scheduledTime)
|
StopScheduleBean |
getScheduleForStop(String stopId,
Date date)
|
ServiceAlertBean |
getServiceAlertForId(String situationId)
|
ListBean<ServiceAlertBean> |
getServiceAlerts(SituationQueryBean query)
|
EncodedPolylineBean |
getShapeForId(String shapeId)
|
ListBean<String> |
getShapeIdsForAgencyId(String agencyId)
|
TripDetailsBean |
getSingleTripDetails(TripDetailsQueryBean query)
|
StopBean |
getStop(String stopId)
|
ListBean<String> |
getStopIdsForAgencyId(String agencyId)
|
StopProblemReportBean |
getStopProblemReportForStopIdAndId(String stopId,
long id)
|
ListBean<StopProblemReportBean> |
getStopProblemReports(StopProblemReportQueryBean query)
|
ListBean<StopProblemReportSummaryBean> |
getStopProblemReportSummaries(StopProblemReportQueryBean query)
|
StopsBean |
getStops(SearchQueryBean query)
|
StopsForRouteBean |
getStopsForRoute(String routeId)
|
StopsWithArrivalsAndDeparturesBean |
getStopsWithArrivalsAndDepartures(Collection<String> stopIds,
ArrivalsAndDeparturesQueryBean query)
|
StopWithArrivalsAndDeparturesBean |
getStopWithArrivalsAndDepartures(String stopId,
ArrivalsAndDeparturesQueryBean query)
|
ListBean<VertexBean> |
getStreetGraphForRegion(double latFrom,
double lonFrom,
double latTo,
double lonTo)
|
TripBean |
getTrip(String tripId)
|
ListBean<TripDetailsBean> |
getTripDetails(TripDetailsQueryBean query)
|
TripDetailsBean |
getTripDetailsForVehicleAndTime(TripForVehicleQueryBean query)
|
TripProblemReportBean |
getTripProblemReportForTripIdAndId(String tripId,
long id)
|
ListBean<TripProblemReportBean> |
getTripProblemReports(TripProblemReportQueryBean query)
|
ListBean<TripProblemReportSummaryBean> |
getTripProblemReportSummaries(TripProblemReportQueryBean query)
|
ListBean<TripDetailsBean> |
getTripsForAgency(TripsForAgencyQueryBean query)
|
ListBean<TripDetailsBean> |
getTripsForBounds(TripsForBoundsQueryBean query)
|
ListBean<TripDetailsBean> |
getTripsForRoute(TripsForRouteQueryBean query)
|
VehicleStatusBean |
getVehicleForAgency(String vehicleId,
long time)
Vehicle Methods |
VehicleLocationRecordBean |
getVehicleLocationRecordForVehicleId(String vehicleId,
long targetTime)
|
ListBean<VehicleLocationRecordBean> |
getVehicleLocationRecords(VehicleLocationRecordQueryBean query)
|
String |
registerAlarmForArrivalAndDepartureAtStop(ArrivalAndDepartureForStopQueryBean query,
RegisterAlarmQueryBean alarm)
|
void |
removeAllServiceAlertsForAgencyId(String agencyId)
|
void |
removeServiceAlert(String situationId)
|
void |
reportProblemWithPlannedTrip(TransitLocationBean from,
TransitLocationBean to,
long targetTime,
ConstraintsBean constraints,
PlannedTripProblemReportBean report)
|
void |
reportProblemWithStop(StopProblemReportBean problem)
Report a problem with a particular stop. |
void |
reportProblemWithTrip(TripProblemReportBean problem)
Report a problem with a particular trip. |
void |
resetVehicleLocation(String vehicleId)
|
void |
submitVehicleLocation(VehicleLocationRecordBean record)
|
void |
updateServiceAlert(ServiceAlertBean situation)
|
void |
updateTripProblemReport(TripProblemReportBean tripProblemReport)
|
getAgenciesWithCoverage
List<AgencyWithCoverageBean> getAgenciesWithCoverage()
throws ServiceException
- The coverage area for each agency is generally the lat-lon bounds of all
stops served by that agency.
- Returns:
- the list of all transit agencies in the service, along with their
coverage information.
- Throws:
ServiceException
getAgency
AgencyBean getAgency(String agencyId)
throws ServiceException
- Parameters:
agencyId
-
- Returns:
- the agency with the specified id, or null if not found
- Throws:
ServiceException
getRoutes
RoutesBean getRoutes(SearchQueryBean query)
throws ServiceException
- Parameters:
query
- specifies the bounds of the query and an optional route name
query
- Returns:
- return all routes matching the specified query
- Throws:
ServiceException
getRouteForId
RouteBean getRouteForId(String routeId)
throws ServiceException
- Parameters:
routeId
-
- Returns:
- the route with specified id, or null if not found
- Throws:
ServiceException
getRouteIdsForAgencyId
ListBean<String> getRouteIdsForAgencyId(String agencyId)
- Parameters:
agencyId
-
- Returns:
- the list of all route ids for the specified agency id
getRoutesForAgencyId
ListBean<RouteBean> getRoutesForAgencyId(String agencyId)
- Parameters:
agencyId
-
- Returns:
- the list of all routes for the specified agency id
getStopsForRoute
StopsForRouteBean getStopsForRoute(String routeId)
throws ServiceException
- Parameters:
routeId
-
- Returns:
- the stops for the specified route, or null if not found
- Throws:
ServiceException
getTrip
TripBean getTrip(String tripId)
throws ServiceException
- Parameters:
tripId
-
- Returns:
- the trip with the specifid id, or null if not found
- Throws:
ServiceException
getSingleTripDetails
TripDetailsBean getSingleTripDetails(TripDetailsQueryBean query)
throws ServiceException
- Parameters:
query
- details about which trip to query, and what to include in the
response
- Returns:
- trip details for trip matching the specified query, or null if not
found
- Throws:
ServiceException
getTripDetails
ListBean<TripDetailsBean> getTripDetails(TripDetailsQueryBean query)
throws ServiceException
- Parameters:
query
- details about which trips to query, and what to include in the
response
- Returns:
- trip details for trips matching the specified query, or empty if
not found
- Throws:
ServiceException
getTripsForBounds
ListBean<TripDetailsBean> getTripsForBounds(TripsForBoundsQueryBean query)
- Parameters:
query
- determines the time and location of the query
- Returns:
- trips details for the trips matching the specified bounds query
getTripsForRoute
ListBean<TripDetailsBean> getTripsForRoute(TripsForRouteQueryBean query)
- Parameters:
query
- determines the time and location of the query
- Returns:
- trips details for the trips matching the specified bounds query
getTripsForAgency
ListBean<TripDetailsBean> getTripsForAgency(TripsForAgencyQueryBean query)
- Parameters:
query
- determines the time and location of the query
- Returns:
- trips details for the trips matching the specified bounds query
getBlockForId
BlockBean getBlockForId(String blockId)
getBlockInstance
BlockInstanceBean getBlockInstance(String blockId,
long serviceDate)
getScheduledBlockLocationFromScheduledTime
ScheduledBlockLocationBean getScheduledBlockLocationFromScheduledTime(String blockId,
long serviceDate,
int scheduledTime)
getVehicleForAgency
VehicleStatusBean getVehicleForAgency(String vehicleId,
long time)
- Vehicle Methods
getAllVehiclesForAgency
ListBean<VehicleStatusBean> getAllVehiclesForAgency(String agencyId,
long time)
getVehicleLocationRecordForVehicleId
VehicleLocationRecordBean getVehicleLocationRecordForVehicleId(String vehicleId,
long targetTime)
getVehicleLocationRecords
ListBean<VehicleLocationRecordBean> getVehicleLocationRecords(VehicleLocationRecordQueryBean query)
- Parameters:
query
-
- Returns:
submitVehicleLocation
void submitVehicleLocation(VehicleLocationRecordBean record)
resetVehicleLocation
void resetVehicleLocation(String vehicleId)
getTripDetailsForVehicleAndTime
TripDetailsBean getTripDetailsForVehicleAndTime(TripForVehicleQueryBean query)
- Parameters:
query
- determines the vehicle and time of the trip query
- Returns:
- trip details for the trip matching the specified query, or null if
not found
getStopWithArrivalsAndDepartures
StopWithArrivalsAndDeparturesBean getStopWithArrivalsAndDepartures(String stopId,
ArrivalsAndDeparturesQueryBean query)
throws ServiceException
- Parameters:
stopId
- timeFrom
- timeTo
-
- Returns:
- stop with arrival and departure information for the specified stop
and time range, or null if not found
- Throws:
ServiceException
getStopsWithArrivalsAndDepartures
StopsWithArrivalsAndDeparturesBean getStopsWithArrivalsAndDepartures(Collection<String> stopIds,
ArrivalsAndDeparturesQueryBean query)
throws ServiceException
- Parameters:
stopIds
- timeFrom
- timeTo
-
- Returns:
- stops with arrival and departure information for the specified
stops and time range
- Throws:
ServiceException
NoSuchStopServiceException
- if one of the specified stops could not
be found
getArrivalAndDepartureForStop
ArrivalAndDepartureBean getArrivalAndDepartureForStop(ArrivalAndDepartureForStopQueryBean query)
throws ServiceException
- Throws:
ServiceException
registerAlarmForArrivalAndDepartureAtStop
String registerAlarmForArrivalAndDepartureAtStop(ArrivalAndDepartureForStopQueryBean query,
RegisterAlarmQueryBean alarm)
cancelAlarmForArrivalAndDepartureAtStop
void cancelAlarmForArrivalAndDepartureAtStop(String alarmId)
getScheduleForStop
StopScheduleBean getScheduleForStop(String stopId,
Date date)
throws ServiceException
- Parameters:
stopId
- date
-
- Returns:
- retrieve the full schedule for the stop on the specified date
- Throws:
ServiceException
getStops
StopsBean getStops(SearchQueryBean query)
throws ServiceException
- Parameters:
query
- determines the query bounds, along with an optional stop code
- Returns:
- find all stops within the specified bounds query
- Throws:
ServiceException
getStop
StopBean getStop(String stopId)
throws ServiceException
- Parameters:
stopId
-
- Returns:
- the stop with the specified id, or null if not found
- Throws:
ServiceException
getStopIdsForAgencyId
ListBean<String> getStopIdsForAgencyId(String agencyId)
- Parameters:
agencyId
-
- Returns:
- the list of all stops operated by the specified agency
getShapeForId
EncodedPolylineBean getShapeForId(String shapeId)
- Parameters:
shapeId
-
- Returns:
- an encoded polyline of the shape with the specified id, or null if
not found
getShapeIdsForAgencyId
ListBean<String> getShapeIdsForAgencyId(String agencyId)
- Parameters:
agencyId
-
- Returns:
- the list of all shape ids associated with the specified agency
getCurrentVehicleEstimates
ListBean<CurrentVehicleEstimateBean> getCurrentVehicleEstimates(CurrentVehicleEstimateQueryBean query)
getItinerariesBetween
ItinerariesBean getItinerariesBetween(TransitLocationBean from,
TransitLocationBean to,
long targetTime,
ConstraintsBean constraints)
throws ServiceException
- Plan a trip between two locations at a particular time, with the specified
constraints.
- Parameters:
from
- to
- targetTime
- constraints
-
- Returns:
- a list of trip plans computed between the two locations with the
specified constraints
- Throws:
ServiceException
reportProblemWithPlannedTrip
void reportProblemWithPlannedTrip(TransitLocationBean from,
TransitLocationBean to,
long targetTime,
ConstraintsBean constraints,
PlannedTripProblemReportBean report)
getStreetGraphForRegion
ListBean<VertexBean> getStreetGraphForRegion(double latFrom,
double lonFrom,
double latTo,
double lonTo)
throws ServiceException
- Throws:
ServiceException
getMinTravelTimeToStopsFrom
MinTravelTimeToStopsBean getMinTravelTimeToStopsFrom(CoordinatePoint location,
long time,
TransitShedConstraintsBean constraints)
throws ServiceException
- Parameters:
location
- time
- constraints
-
- Returns:
- min travel time transit-shed computation to a list of stops from
the specified starting location with the specified travel
constraints
- Throws:
ServiceException
getLocalPaths
List<TimedPlaceBean> getLocalPaths(String agencyId,
ConstraintsBean constraints,
MinTravelTimeToStopsBean minTravelTimeToStops,
List<LocalSearchResult> localResults)
throws ServiceException
- Parameters:
agencyId
- constraints
- minTravelTimeToStops
- localResults
-
- Returns:
- finish off the transit-shed computation by computing last-mile
walking paths to target locations from min-travel-time-to-stops
results
- Throws:
ServiceException
createServiceAlert
ServiceAlertBean createServiceAlert(String agencyId,
ServiceAlertBean situation)
- Service Alert Methods
updateServiceAlert
void updateServiceAlert(ServiceAlertBean situation)
removeServiceAlert
void removeServiceAlert(String situationId)
getServiceAlertForId
ServiceAlertBean getServiceAlertForId(String situationId)
getAllServiceAlertsForAgencyId
ListBean<ServiceAlertBean> getAllServiceAlertsForAgencyId(String agencyId)
removeAllServiceAlertsForAgencyId
void removeAllServiceAlertsForAgencyId(String agencyId)
getServiceAlerts
ListBean<ServiceAlertBean> getServiceAlerts(SituationQueryBean query)
reportProblemWithStop
void reportProblemWithStop(StopProblemReportBean problem)
- Report a problem with a particular stop.
- Parameters:
problem
- the problem summary bean
getStopProblemReportSummaries
ListBean<StopProblemReportSummaryBean> getStopProblemReportSummaries(StopProblemReportQueryBean query)
getStopProblemReports
ListBean<StopProblemReportBean> getStopProblemReports(StopProblemReportQueryBean query)
getAllStopProblemReportsForStopId
List<StopProblemReportBean> getAllStopProblemReportsForStopId(String stopId)
getStopProblemReportForStopIdAndId
StopProblemReportBean getStopProblemReportForStopIdAndId(String stopId,
long id)
deleteStopProblemReportForStopIdAndId
void deleteStopProblemReportForStopIdAndId(String stopId,
long id)
reportProblemWithTrip
void reportProblemWithTrip(TripProblemReportBean problem)
- Report a problem with a particular trip.
- Parameters:
problem
- the problem summary bean
getTripProblemReportSummaries
ListBean<TripProblemReportSummaryBean> getTripProblemReportSummaries(TripProblemReportQueryBean query)
getTripProblemReports
ListBean<TripProblemReportBean> getTripProblemReports(TripProblemReportQueryBean query)
getAllTripProblemReportsForTripId
List<TripProblemReportBean> getAllTripProblemReportsForTripId(String tripId)
getTripProblemReportForTripIdAndId
TripProblemReportBean getTripProblemReportForTripIdAndId(String tripId,
long id)
updateTripProblemReport
void updateTripProblemReport(TripProblemReportBean tripProblemReport)
deleteTripProblemReportForTripIdAndId
void deleteTripProblemReportForTripIdAndId(String tripId,
long id)
getAllTripProblemReportLabels
List<String> getAllTripProblemReportLabels()
Copyright © 2012 OneBusAway. All Rights Reserved.