public class DbConfig
extends java.lang.Object
DbConfig is intended for the core application such that the necessary top level data can be read in at system startup. This doesn't read in all the low-level data such as paths and travel times. Those items are very voluminous and are therefore lazy loaded.
Constructor and Description |
---|
DbConfig(java.lang.String agencyId)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Agency> |
getAgencies() |
Block |
getBlock(java.lang.String serviceId,
java.lang.String blockId)
Returns the block specified by the service and block ID parameters.
|
java.util.List<Block> |
getBlocks()
Returns unmodifiable list of blocks for the agency.
|
java.util.Collection<Block> |
getBlocks(java.lang.String serviceId)
Returns unmodifiable collection of blocks associated with the specified
serviceId.
|
java.util.Collection<Block> |
getBlocksForAllServiceIds(java.lang.String blockId)
Returns blocks for the specified blockId for all service IDs.
|
java.util.List<Block> |
getBlocksForRoute(java.lang.String routeId)
Returns List of Blocks associated with the routeId for all service IDs.
|
java.util.List<Block> |
getBlocksForRoute(java.lang.String serviceId,
java.lang.String routeId)
Returns List of Blocks associated with the serviceId and routeId.
|
java.util.List<CalendarDate> |
getCalendarDates()
Returns list of all calendar dates from the GTFS calendar_dates.txt file.
|
java.util.List<CalendarDate> |
getCalendarDatesForNow()
Returns CalendarDate for the current day.
|
java.util.List<Calendar> |
getCalendars()
Returns list of all calendars
|
int |
getConfigRev()
Returns the database revision of the configuration data that was read in.
|
java.util.List<Calendar> |
getCurrentCalendars()
Returns list of calendars that are currently active
|
java.util.List<java.lang.String> |
getCurrentServiceIds()
Returns list of service IDs that are currently active
|
Agency |
getFirstAgency()
There can be multiple agencies but usually there will be just one.
|
Route |
getRouteById(java.lang.String routeId)
Returns the Route with the specified routeId.
|
Route |
getRouteByShortName(java.lang.String routeShortName)
Returns the Route with the specified routeShortName
|
java.util.List<Route> |
getRoutes()
Returns ordered list of routes.
|
java.util.Map<java.lang.String,Route> |
getRoutesByRouteIdMap()
Returns Map of routesMap keyed on the routeId.
|
java.util.List<java.lang.String> |
getServiceIds()
Returns list of all service IDs
|
Stop |
getStop(java.lang.String stopId)
Returns the Stop with the specified stopId.
|
Trip |
getTrip(java.lang.String tripId)
For more quickly getting a trip.
|
java.util.List<TripPattern> |
getTripPatternsForRoute(java.lang.String routeId)
Returns the list of trip patterns associated with the specified route.
|
java.util.Map<java.lang.String,Trip> |
getTrips()
Returns cached map of all Trips.
|
Trip |
getTripUsingTripShortName(java.lang.String tripShortName)
For more quickly getting a trip.
|
static void |
main(java.lang.String[] args)
For debugging.
|
void |
read(int configRev)
Initiates the reading of the configuration data from the database.
|
public DbConfig(java.lang.String agencyId)
agencyId
- public void read(int configRev)
configRev
- public java.util.List<Block> getBlocksForRoute(java.lang.String serviceId, java.lang.String routeId)
serviceId
- Specified service ID that want blocks for. Can set to null to
blocks for all service IDs for the route.routeId
- public java.util.List<Block> getBlocksForRoute(java.lang.String routeId)
routeId
- public java.util.List<TripPattern> getTripPatternsForRoute(java.lang.String routeId)
routeId
- public java.util.Map<java.lang.String,Trip> getTrips()
public Trip getTrip(java.lang.String tripId)
tripId
- public Trip getTripUsingTripShortName(java.lang.String tripShortName)
tripShortName
- public Block getBlock(java.lang.String serviceId, java.lang.String blockId)
serviceId
- Specified which service class to look for block. If null then
will use the first service class for the current time that has
the specified block.blockId
- Specifies which block to returnpublic java.util.Collection<Block> getBlocksForAllServiceIds(java.lang.String blockId)
blockId
- Which blocks to returnpublic java.util.Collection<Block> getBlocks(java.lang.String serviceId)
serviceId
- public java.util.List<Block> getBlocks()
public java.util.Map<java.lang.String,Route> getRoutesByRouteIdMap()
public java.util.List<Route> getRoutes()
public Route getRouteById(java.lang.String routeId)
routeId
- public Route getRouteByShortName(java.lang.String routeShortName)
routeShortName
- public Stop getStop(java.lang.String stopId)
stopId
- public java.util.List<Calendar> getCalendars()
public java.util.List<Calendar> getCurrentCalendars()
public java.util.List<CalendarDate> getCalendarDates()
public java.util.List<CalendarDate> getCalendarDatesForNow()
public java.util.List<java.lang.String> getServiceIds()
public java.util.List<java.lang.String> getCurrentServiceIds()
public Agency getFirstAgency()
public java.util.List<Agency> getAgencies()
public int getConfigRev()
public static void main(java.lang.String[] args)
args
-