Search in sources :

Example 1 with BlockLocationRecord

use of org.onebusaway.transit_data_federation.impl.realtime.BlockLocationRecord in project onebusaway-application-modules by camsys.

the class VehicleStatusBeanServiceImpl method getVehicleLocations.

@Override
public ListBean<VehicleLocationRecordBean> getVehicleLocations(VehicleLocationRecordQueryBean query) {
    AgencyAndId blockId = AgencyAndIdLibrary.convertFromString(query.getBlockId());
    AgencyAndId tripId = AgencyAndIdLibrary.convertFromString(query.getTripId());
    AgencyAndId vehicleId = AgencyAndIdLibrary.convertFromString(query.getVehicleId());
    List<BlockLocationRecord> records = _blockLocationRecordDao.getBlockLocationRecords(blockId, tripId, vehicleId, query.getServiceDate(), query.getFromTime(), query.getToTime(), 1000);
    List<VehicleLocationRecordBean> beans = new ArrayList<VehicleLocationRecordBean>(records.size());
    for (BlockLocationRecord record : records) {
        VehicleLocationRecordBean bean = getBlockLocationRecordAsVehicleLocationRecord(record);
        beans.add(bean);
    }
    return new ListBean<VehicleLocationRecordBean>(beans, false);
}
Also used : AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) BlockLocationRecord(org.onebusaway.transit_data_federation.impl.realtime.BlockLocationRecord) ArrayList(java.util.ArrayList) ListBean(org.onebusaway.transit_data.model.ListBean) VehicleLocationRecordBean(org.onebusaway.transit_data.model.realtime.VehicleLocationRecordBean)

Aggregations

ArrayList (java.util.ArrayList)1 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 ListBean (org.onebusaway.transit_data.model.ListBean)1 VehicleLocationRecordBean (org.onebusaway.transit_data.model.realtime.VehicleLocationRecordBean)1 BlockLocationRecord (org.onebusaway.transit_data_federation.impl.realtime.BlockLocationRecord)1