|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.onebusaway.transit_data_federation.impl.realtime.BlockLocationServiceImpl
@Component @ManagedResource(value="org.onebusaway.transit_data_federation.impl.realtime:name=BlockLocationServiceImpl") public class BlockLocationServiceImpl
Implementation for BlockLocationService
. Keeps a recent cache of
BlockLocationRecord
records for current queries and can access
database persisted records for queries in the past.
BlockLocationService
Constructor Summary | |
---|---|
BlockLocationServiceImpl()
|
Method Summary | |
---|---|
long |
getBlockLocationRecordPersistentStoreAccessCount()
|
long |
getLastInsertCount()
|
long |
getLastInsertDuration()
JMX Attributes |
BlockLocation |
getLocationForBlockInstance(BlockInstance blockInstance,
TargetTime time)
BlockLocationService Interface |
BlockLocation |
getLocationForBlockInstanceAndScheduledBlockLocation(BlockInstance blockInstance,
ScheduledBlockLocation scheduledLocation,
long targetTime)
|
BlockLocation |
getLocationForVehicleAndTime(org.onebusaway.gtfs.model.AgencyAndId vehicleId,
TargetTime targetTime)
|
Map<org.onebusaway.gtfs.model.AgencyAndId,List<BlockLocation>> |
getLocationsForBlockInstance(BlockInstance blockInstance,
List<Date> times,
long currentTime)
|
List<BlockLocation> |
getLocationsForBlockInstance(BlockInstance blockInstance,
TargetTime time)
Given a block instance and a target time, determine the vehicle locations at that time using real-time data when available. |
BlockLocation |
getScheduledLocationForBlockInstance(BlockInstance blockInstance,
long targetTime)
Determines the scheduled vehicle location of a given block instance at the specified time. |
void |
handleVehicleLocationRecord(VehicleLocationRecord record)
BlockVehicleLocationListener Interface |
void |
resetVehicleLocation(org.onebusaway.gtfs.model.AgencyAndId vehicleId)
|
void |
setBlockCalendarService(BlockCalendarService blockCalendarService)
|
void |
setBlockLocationListeners(List<BlockLocationListener> listeners)
|
void |
setBlockLocationRecordCacheWindowSize(int windowSize)
Controls how far back in time we include records in the BlockLocationRecordCollection for each active trip. |
void |
setBlockLocationRecordDao(BlockLocationRecordDao blockLocationRecordDao)
|
void |
setDistanceAlongBlockLocationInterpolation(boolean distanceAlongBlockLocationInterpolation)
|
void |
setPersistBlockLocationRecords(boolean persistBlockLocationRecords)
Should we persist BlockLocationRecord records to an underlying
datastore. |
void |
setRealTimeHistoryService(RealTimeHistoryService realTimeHistoryService)
|
void |
setScheduledBlockLocationService(ScheduledBlockLocationService scheduleBlockLocationService)
|
void |
setTransitGraphDao(TransitGraphDao transitGraphDao)
|
void |
setVehicleLocationRecordCache(VehicleLocationRecordCache cache)
|
void |
start()
Setup and Teardown |
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BlockLocationServiceImpl()
Method Detail |
---|
public void setVehicleLocationRecordCache(VehicleLocationRecordCache cache)
public void setBlockLocationRecordDao(BlockLocationRecordDao blockLocationRecordDao)
public void setTransitGraphDao(TransitGraphDao transitGraphDao)
public void setScheduledBlockLocationService(ScheduledBlockLocationService scheduleBlockLocationService)
public void setBlockCalendarService(BlockCalendarService blockCalendarService)
public void setRealTimeHistoryService(RealTimeHistoryService realTimeHistoryService)
public void setBlockLocationListeners(List<BlockLocationListener> listeners)
public void setBlockLocationRecordCacheWindowSize(int windowSize)
BlockLocationRecordCollection
for each active trip.
windowSize
- in secondspublic void setPersistBlockLocationRecords(boolean persistBlockLocationRecords)
BlockLocationRecord
records to an underlying
datastore. Useful if you wish to query trip status for historic analysis.
persistTripTimePredictions
- public void setDistanceAlongBlockLocationInterpolation(boolean distanceAlongBlockLocationInterpolation)
distanceAlongBlockLocationInterpolation
- @ManagedAttribute public long getLastInsertDuration()
@ManagedAttribute public long getLastInsertCount()
@ManagedAttribute public long getBlockLocationRecordPersistentStoreAccessCount()
@PostConstruct public void start()
@PreDestroy public void stop()
public void handleVehicleLocationRecord(VehicleLocationRecord record)
BlockVehicleLocationListener
Interface
handleVehicleLocationRecord
in interface BlockVehicleLocationListener
public void resetVehicleLocation(org.onebusaway.gtfs.model.AgencyAndId vehicleId)
resetVehicleLocation
in interface BlockVehicleLocationListener
public BlockLocation getLocationForBlockInstance(BlockInstance blockInstance, TargetTime time)
BlockLocationService
Interface
getLocationForBlockInstance
in interface BlockLocationService
blockInstance
- the block instance to querytime
- the target time (Unix-time)
public BlockLocation getLocationForBlockInstanceAndScheduledBlockLocation(BlockInstance blockInstance, ScheduledBlockLocation scheduledLocation, long targetTime)
getLocationForBlockInstanceAndScheduledBlockLocation
in interface BlockLocationService
public List<BlockLocation> getLocationsForBlockInstance(BlockInstance blockInstance, TargetTime time)
BlockLocationService
getLocationsForBlockInstance
in interface BlockLocationService
blockInstance
- the trip instance to querytime
- TODO
public Map<org.onebusaway.gtfs.model.AgencyAndId,List<BlockLocation>> getLocationsForBlockInstance(BlockInstance blockInstance, List<Date> times, long currentTime)
getLocationsForBlockInstance
in interface BlockLocationService
public BlockLocation getScheduledLocationForBlockInstance(BlockInstance blockInstance, long targetTime)
BlockLocationService
getScheduledLocationForBlockInstance
in interface BlockLocationService
public BlockLocation getLocationForVehicleAndTime(org.onebusaway.gtfs.model.AgencyAndId vehicleId, TargetTime targetTime)
getLocationForVehicleAndTime
in interface BlockLocationService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |