use of org.onebusaway.container.cache.Cacheable in project onebusaway-application-modules by camsys.
the class BlockBeanServiceImpl method getBlockForId.
@Cacheable
public BlockBean getBlockForId(AgencyAndId blockId) {
BlockEntry blockEntry = _graph.getBlockEntryForId(blockId);
if (blockEntry == null)
return null;
BlockBean bean = new BlockBean();
bean.setId(AgencyAndIdLibrary.convertToString(blockEntry.getId()));
List<BlockConfigurationBean> configBeans = new ArrayList<BlockConfigurationBean>();
for (BlockConfigurationEntry blockConfiguration : blockEntry.getConfigurations()) {
BlockConfigurationBean configBean = getBlockConfigurationAsBean(blockConfiguration);
configBeans.add(configBean);
}
bean.setConfigurations(configBeans);
return bean;
}
use of org.onebusaway.container.cache.Cacheable in project onebusaway-application-modules by camsys.
the class RoutesBeanServiceImpl method getRouteIdsForAgencyId.
@Cacheable
@Override
public ListBean<String> getRouteIdsForAgencyId(String agencyId) {
AgencyEntry agency = _graphDao.getAgencyForId(agencyId);
if (agency == null)
throw new NoSuchAgencyServiceException(agencyId);
List<String> ids = new ArrayList<String>();
for (RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
AgencyAndId id = routeCollection.getId();
ids.add(AgencyAndIdLibrary.convertToString(id));
}
return new ListBean<String>(ids, false);
}
use of org.onebusaway.container.cache.Cacheable in project onebusaway-application-modules by camsys.
the class StopBeanServiceImpl method getStopForId.
@Cacheable
public StopBean getStopForId(AgencyAndId id) {
StopEntry stop = _transitGraphDao.getStopEntryForId(id);
StopNarrative narrative = _narrativeService.getStopForId(id);
if (stop == null) {
// try looking up consolidated id
AgencyAndId consolidatedId = _consolidatedStopsService.getConsolidatedStopIdForHiddenStopId(id);
if (consolidatedId != null)
return getStopForId(consolidatedId);
throw new NoSuchStopServiceException(AgencyAndIdLibrary.convertToString(id));
}
StopBean sb = new StopBean();
fillStopBean(stop, narrative, sb);
fillRoutesForStopBean(stop, sb);
return sb;
}
Aggregations