All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fi.evolver.basics.spring.job.TaskStatusController Maven / Gradle / Ivy

There is a newer version: 6.5.1
Show newest version
package fi.evolver.basics.spring.job;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import fi.evolver.basics.spring.http.MessageType;
import fi.evolver.basics.spring.http.crud.ReadOnlyCrudController;
import fi.evolver.basics.spring.job.entity.TaskStatus;
import fi.evolver.basics.spring.job.entity.TaskStatus.TaskState;

@RestController
@RequestMapping("/task")
public class TaskStatusController extends ReadOnlyCrudController {

	@Autowired
	public TaskStatusController(TaskStatusRepository taskStatusRepository) {
		super(taskStatusRepository);
	}


	@MessageType("TaskStatus/active")
	@GetMapping("/list/active")
	public List getStatusByReportable() {
		return ((TaskStatusRepository)this.jpaRepository).findByStates(List.of(TaskState.RUNNING, TaskState.CANCELLING));
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy