Search in sources :

Example 1 with BlockStopTimeIndicesFactory

use of org.onebusaway.transit_data_federation.impl.blocks.BlockStopTimeIndicesFactory in project onebusaway-application-modules by camsys.

the class BlockIndicesTask method run.

@Override
public void run() {
    try {
        Iterable<BlockEntry> blocks = _transitGraphDao.getAllBlocks();
        List<BlockTripIndexData> tripData = _blockIndexFactoryService.createTripData(blocks);
        List<BlockLayoverIndexData> layoverData = _blockIndexFactoryService.createLayoverData(blocks);
        List<FrequencyBlockTripIndexData> frequencyTripData = _blockIndexFactoryService.createFrequencyTripData(blocks);
        ObjectSerializationLibrary.writeObject(_bundle.getBlockTripIndicesPath(), tripData);
        ObjectSerializationLibrary.writeObject(_bundle.getBlockLayoverIndicesPath(), layoverData);
        ObjectSerializationLibrary.writeObject(_bundle.getFrequencyBlockTripIndicesPath(), frequencyTripData);
        BlockStopTimeIndicesFactory stopFactory = new BlockStopTimeIndicesFactory();
        stopFactory.createIndices(blocks);
        _refreshService.refresh(RefreshableResources.BLOCK_INDEX_DATA);
    } catch (Exception ex) {
        throw new IllegalStateException(ex);
    }
}
Also used : BlockEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockEntry) BlockStopTimeIndicesFactory(org.onebusaway.transit_data_federation.impl.blocks.BlockStopTimeIndicesFactory) BlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.BlockTripIndexData) FrequencyBlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData) BlockLayoverIndexData(org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndexData) FrequencyBlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData)

Aggregations

BlockStopTimeIndicesFactory (org.onebusaway.transit_data_federation.impl.blocks.BlockStopTimeIndicesFactory)1 BlockLayoverIndexData (org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndexData)1 BlockTripIndexData (org.onebusaway.transit_data_federation.services.blocks.BlockTripIndexData)1 FrequencyBlockTripIndexData (org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData)1 BlockEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockEntry)1