Search in sources :

Example 1 with BlockInstanceV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean in project onebusaway-application-modules by camsys.

the class BlockInstanceAction method show.

public DefaultHttpHeaders show() throws ServiceException {
    if (!isVersion(V2))
        return setUnknownVersionResponse();
    if (hasErrors())
        return setValidationErrorsResponse();
    BlockInstanceBean blockInstance = _service.getBlockInstance(_id, _serviceDate);
    if (blockInstance == null)
        return setResourceNotFoundResponse();
    BeanFactoryV2 factory = getBeanFactoryV2();
    BlockInstanceV2Bean bean = factory.getBlockInstance(blockInstance);
    EntryWithReferencesBean<BlockInstanceV2Bean> response = factory.entry(bean);
    return setOkResponse(response);
}
Also used : BlockInstanceV2Bean(org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean) BlockInstanceBean(org.onebusaway.transit_data.model.blocks.BlockInstanceBean) BeanFactoryV2(org.onebusaway.api.model.transit.BeanFactoryV2)

Example 2 with BlockInstanceV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getBlockInstance.

public BlockInstanceV2Bean getBlockInstance(BlockInstanceBean blockInstance) {
    BlockInstanceV2Bean bean = new BlockInstanceV2Bean();
    bean.setBlockConfiguration(getBlockConfig(blockInstance.getBlockConfiguration()));
    bean.setBlockId(blockInstance.getBlockId());
    bean.setServiceDate(blockInstance.getServiceDate());
    return bean;
}
Also used : BlockInstanceV2Bean(org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean)

Aggregations

BlockInstanceV2Bean (org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean)2 BeanFactoryV2 (org.onebusaway.api.model.transit.BeanFactoryV2)1 BlockInstanceBean (org.onebusaway.transit_data.model.blocks.BlockInstanceBean)1