// Path: osgi.enroute.examples.scheduler.application/src/osgi/enroute/examples/scheduler/application/SchedulerApplication.java
// public static class ExampleInfo extends DTO {
// 	public String description;
// 	public String type;
// 	public String deflt;
// }
// 
// Path: osgi.enroute.examples.scheduler.application/src/osgi/enroute/examples/scheduler/application/SchedulerApplication.java
// public static class Tracker extends DTO {
// 	public int id;
// 	public long created = System.currentTimeMillis();
// 	public long modified;
// 	public List<Integer> ticks = new ArrayList<>();
// 	public String tooltip;
// 	public long ended;
// 	public String method;
// 	public String parameter;
// 	public Object value;
// 	public String failure;
// 	public TrackerEvent lastEvent;
// 
// 	CancellablePromise<?> promise;
// }


import java.util.Map;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import osgi.enroute.examples.scheduler.application.SchedulerApplication.ExampleInfo;
import osgi.enroute.examples.scheduler.application.SchedulerApplication.Tracker;
import osgi.enroute.rest.api.REST;
import osgi.enroute.rest.api.RESTRequest;
package osgi.enroute.examples.scheduler.application;




/**
 * This component is the facade for the REST interface. We accept a uri like
 * 
 * <pre>
 * PUT /rest/scheduler/:method-name?parameter=   start a tracker
 * DELETE /rest/scheduler/:id                    delete a tracker
 * GET /rest/scheduler/:id                       get the tracker
 * GET /rest/scheduler                           get example info
 * </pre>
 * <p>
 * This example should, but does not do it, implement authorization checking.
 */
@Component()
public class SchedulerRESTFacade implements REST {
	@Reference	private SchedulerApplication app;

	interface PutRequest extends RESTRequest {
		String parameter();
	}

	/*
	 * Start a command and create a tracker.
	 */
// Path: osgi.enroute.examples.scheduler.application/src/osgi/enroute/examples/scheduler/application/SchedulerApplication.java
// public static class ExampleInfo extends DTO {
// 	public String description;
// 	public String type;
// 	public String deflt;
// }
// 
// Path: osgi.enroute.examples.scheduler.application/src/osgi/enroute/examples/scheduler/application/SchedulerApplication.java
// public static class Tracker extends DTO {
// 	public int id;
// 	public long created = System.currentTimeMillis();
// 	public long modified;
// 	public List<Integer> ticks = new ArrayList<>();
// 	public String tooltip;
// 	public long ended;
// 	public String method;
// 	public String parameter;
// 	public Object value;
// 	public String failure;
// 	public TrackerEvent lastEvent;
// 
// 	CancellablePromise<?> promise;
// }


// Path: osgi.enroute.examples.scheduler.application/src/osgi/enroute/examples/scheduler/application/SchedulerRESTFacade.java
import java.util.Map;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import osgi.enroute.examples.scheduler.application.SchedulerApplication.ExampleInfo;
import osgi.enroute.examples.scheduler.application.SchedulerApplication.Tracker;
import osgi.enroute.rest.api.REST;
import osgi.enroute.rest.api.RESTRequest;

package osgi.enroute.examples.scheduler.application;




/**
 * This component is the facade for the REST interface. We accept a uri like
 * 
 * <pre>
 * PUT /rest/scheduler/:method-name?parameter=   start a tracker
 * DELETE /rest/scheduler/:id                    delete a tracker
 * GET /rest/scheduler/:id                       get the tracker
 * GET /rest/scheduler                           get example info
 * </pre>
 * <p>
 * This example should, but does not do it, implement authorization checking.
 */
@Component()
public class SchedulerRESTFacade implements REST {
	@Reference	private SchedulerApplication app;

	interface PutRequest extends RESTRequest {
		String parameter();
	}

	/*
	 * Start a command and create a tracker.
	 */
	public Tracker putScheduler(PutRequest rq, Object payload, String method) throws Exception {