@Override
@GET
public ScheduledServiceResourceResponse get(Context context, Request request, Response response, Variant variant)
throws ResourceException
{
ScheduledServiceResourceResponse result = new ScheduledServiceResourceResponse();
try {
ScheduledTask<?> task = getNexusScheduler().getTaskById(getScheduledServiceId(request));
ScheduledServiceBaseResource resource = getServiceRestModel(task);
if (resource != null) {
result.setData(resource);
}
else {
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "Invalid schedule id ("
+ getScheduledServiceId(request) + "), can't load task.");
}