Package org.onebusaway.admin.service.api
Class VehicleAssignmentResource
- java.lang.Object
-
- org.onebusaway.admin.service.bundle.api.AuthenticatedResource
-
- org.onebusaway.admin.service.api.VehicleAssignmentResource
-
@Path("/vehicle-assign") @RestController public class VehicleAssignmentResource extends AuthenticatedResource
Endpoint for vehicle assignment services, such as manually associating a vehicle with a block, and managing that relationship life cycle.
-
-
Field Summary
-
Fields inherited from class org.onebusaway.admin.service.bundle.api.AuthenticatedResource
_currentUserService
-
-
Constructor Summary
Constructors Constructor Description VehicleAssignmentResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
assign(String blockId, String vehicleId)
javax.ws.rs.core.Response
assignVehicleToBlock(String block, String vehicle)
List<ActiveBlock>
getActiveBlocks(org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate, List<org.onebusaway.gtfs.model.AgencyAndId> filterRoutes)
javax.ws.rs.core.Response
getActiveBlocksAsCSV(String serviceDate, String routes)
javax.ws.rs.core.Response
getActiveVehiclesAsJson(String query)
String
getAssignmentByBlockId(String blockId)
javax.ws.rs.core.Response
getAssignmentsAsCSV()
javax.ws.rs.core.Response
getAssignmentsAsJson()
javax.ws.rs.core.Response
getTripsForBlockAsJson(String blockId)
void
setActiveVehiclesService(ActiveVehiclesServiceImpl activeVehiclesService)
void
setVehicleAssignmentService(VehicleAssignmentServiceImpl vehicleAssignmentService)
-
Methods inherited from class org.onebusaway.admin.service.bundle.api.AuthenticatedResource
isAuthorized
-
-
-
-
Method Detail
-
setVehicleAssignmentService
public void setVehicleAssignmentService(VehicleAssignmentServiceImpl vehicleAssignmentService)
-
setActiveVehiclesService
public void setActiveVehiclesService(ActiveVehiclesServiceImpl activeVehiclesService)
-
assignVehicleToBlock
@Path("/assign/block/{block}/vehicle/{vehicle}") @GET public javax.ws.rs.core.Response assignVehicleToBlock(@PathParam("block") String block, @PathParam("vehicle") String vehicle)
-
getActiveBlocks
public List<ActiveBlock> getActiveBlocks(org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate, List<org.onebusaway.gtfs.model.AgencyAndId> filterRoutes) throws ExecutionException
- Throws:
ExecutionException
-
getActiveBlocksAsCSV
@Path("/active-blocks/{serviceDate}/{routeList}") @GET public javax.ws.rs.core.Response getActiveBlocksAsCSV(@PathParam("serviceDate") String serviceDate, @PathParam("routeList") String routes) throws ExecutionException
- Throws:
ExecutionException
-
getAssignmentsAsCSV
@Path("/get/csv") @GET public javax.ws.rs.core.Response getAssignmentsAsCSV()
-
getAssignmentsAsJson
@Path("/list") @GET @Produces("application/json") public javax.ws.rs.core.Response getAssignmentsAsJson() throws IOException
- Throws:
IOException
-
getActiveVehiclesAsJson
@Path("/active-vehicles/list") @GET @Produces("application/json") public javax.ws.rs.core.Response getActiveVehiclesAsJson(@QueryParam("q") String query) throws IOException
- Throws:
IOException
-
getTripsForBlockAsJson
@Path("/trips/block/{blockId}") @GET @Produces("application/json") public javax.ws.rs.core.Response getTripsForBlockAsJson(@PathParam("blockId") String blockId) throws IOException, ExecutionException
- Throws:
IOException
ExecutionException
-
-