15 |
public class RestCommands { |
public class RestCommands { |
16 |
|
|
17 |
|
|
18 |
@Path("/distancecalculation/{distributor}") |
@Path("/distancecalculation/{distributor}/{type}") |
19 |
@GET |
@GET |
20 |
@Produces(MediaType.TEXT_PLAIN) |
@Produces(MediaType.TEXT_PLAIN) |
21 |
public String scheduleDistanceCalculation( |
public String scheduleDistanceCalculation( |
22 |
@Context ServletContext context, |
@Context ServletContext context, |
23 |
@PathParam("distributor") String distributor) { |
@PathParam("distributor") String distributor, |
24 |
|
@PathParam("type") String type |
25 |
|
) { |
26 |
|
|
27 |
|
|
28 |
TaskManager taskMgr = (TaskManager) context.getAttribute(TaskManager.TASKMANAGER); |
TaskManager taskMgr = (TaskManager) context.getAttribute(TaskManager.TASKMANAGER); |
29 |
|
|
30 |
AfstandAndenRuteTask task = new AfstandAndenRuteTask( distributor.toUpperCase() ); |
AfstandAndenRuteTask task = new AfstandAndenRuteTask( distributor.toUpperCase(), type ); |
31 |
|
|
32 |
taskMgr.submitTask(task); |
taskMgr.submitTask(task); |
33 |
|
|