Class VehicleStatusServiceImpl
- java.lang.Object
-
- org.onebusaway.admin.service.impl.VehicleStatusServiceImpl
-
- All Implemented Interfaces:
VehicleStatusService
@Component public class VehicleStatusServiceImpl extends Object implements VehicleStatusService
Default implementation ofVehicleStatusService
- Author:
- abelsare
-
-
Constructor Summary
Constructors Constructor Description VehicleStatusServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VehicleDetail
getVehicleDetail(String vehicleId)
Make a web service call to report archive server about a specific vehicle.VehicleStatistics
getVehicleStatistics(String... parameters)
Returns statistics of the vehicles tracked such as vehicles reporting emergency, vehicles in revenue servie, vehicles tracked in past five minutesList<VehicleStatus>
getVehicleStatus(boolean loadNew)
Creates vehicle status data by making web service calls to TDM and report archive serversList<VehicleStatus>
search(Map<VehicleSearchParameters,String> searchParameters, boolean newSearch)
Searches vehicles based on the given parameters.void
setConfigurationService(ConfigurationService configurationService)
Injects configuration servicevoid
setRemoteConnectionService(RemoteConnectionService remoteConnectionService)
Injects remote connection servicevoid
setVehicleSearchService(VehicleSearchService vehicleSearchService)
Injects vehicle search servicevoid
sort(List<VehicleStatus> vehiclesPerPage, String field, String order)
Sorts vehicle records on the given field by given order.
-
-
-
Method Detail
-
getVehicleStatus
public List<VehicleStatus> getVehicleStatus(boolean loadNew)
Description copied from interface:VehicleStatusService
Creates vehicle status data by making web service calls to TDM and report archive servers- Specified by:
getVehicleStatus
in interfaceVehicleStatusService
- Returns:
- new/cached vehicle status data
-
getVehicleDetail
public VehicleDetail getVehicleDetail(String vehicleId)
Description copied from interface:VehicleStatusService
Make a web service call to report archive server about a specific vehicle.- Specified by:
getVehicleDetail
in interfaceVehicleStatusService
- Returns:
-
search
public List<VehicleStatus> search(Map<VehicleSearchParameters,String> searchParameters, boolean newSearch)
Description copied from interface:VehicleStatusService
Searches vehicles based on the given parameters. Uses vehicle cache for fetching vehicle data. Returns empty results if cache is empty- Specified by:
search
in interfaceVehicleStatusService
- Parameters:
searchParameters
- paramters for searchingnewSearch
- indicates this is a new search- Returns:
- results matching the parameters, empty list if the cache is empty
-
getVehicleStatistics
public VehicleStatistics getVehicleStatistics(String... parameters)
Description copied from interface:VehicleStatusService
Returns statistics of the vehicles tracked such as vehicles reporting emergency, vehicles in revenue servie, vehicles tracked in past five minutes- Specified by:
getVehicleStatistics
in interfaceVehicleStatusService
- Parameters:
parameters
- optional parameters from client- Returns:
- vehicle statistics with the required count
-
sort
public void sort(List<VehicleStatus> vehiclesPerPage, String field, String order)
Description copied from interface:VehicleStatusService
Sorts vehicle records on the given field by given order.- Specified by:
sort
in interfaceVehicleStatusService
- Parameters:
vehiclesPerPage
- vehicle records to be sortedfield
- field on which the records need to be sortedorder
- order of sorting
-
setConfigurationService
@Autowired public void setConfigurationService(ConfigurationService configurationService)
Injects configuration service- Parameters:
configurationService
- the configurationService to set
-
setRemoteConnectionService
@Autowired public void setRemoteConnectionService(RemoteConnectionService remoteConnectionService)
Injects remote connection service- Parameters:
remoteConnectionService
- the remoteConnectionService to set
-
setVehicleSearchService
@Autowired public void setVehicleSearchService(VehicleSearchService vehicleSearchService)
Injects vehicle search service- Parameters:
vehicleSearchService
- the vehicleSearchService to set
-
-