Class JobsController
java.lang.Object
edu.ucsb.cs156.happiercows.controllers.ApiController
edu.ucsb.cs156.happiercows.controllers.JobsController
Launch endpoints for this app's concrete jobs. The generic admin endpoints (list jobs, get
paginated jobs, get logs, delete jobs) come from the lib-jobs library's own controller.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.ucsb.cs156.jobs.entities.Jobedu.ucsb.cs156.jobs.entities.JobinstructorReportSingleGame(Long gameId) edu.ucsb.cs156.jobs.entities.Jobedu.ucsb.cs156.jobs.entities.JoblaunchMilkTheCowsJobSingleGame(Long gameId) edu.ucsb.cs156.jobs.entities.JoblaunchTestJob(Boolean fail, Integer sleepMs) edu.ucsb.cs156.jobs.entities.Jobedu.ucsb.cs156.jobs.entities.JobsetCowHealth(Long gameID, double health) edu.ucsb.cs156.jobs.entities.Jobedu.ucsb.cs156.jobs.entities.JobupdateCowHealthSingleGame(Long gameId) Methods inherited from class ApiController
genericMessage, getCurrentUser, handleBadRequest, handleForbidden, handleGenericException
-
Constructor Details
-
JobsController
public JobsController()
-
-
Method Details
-
launchTestJob
-
launchMilkTheCowsJob
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/milkthecowjob") public edu.ucsb.cs156.jobs.entities.Job launchMilkTheCowsJob() -
launchMilkTheCowsJobSingleGame
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/milkthecowjobsinglegame") public edu.ucsb.cs156.jobs.entities.Job launchMilkTheCowsJobSingleGame(@RequestParam Long gameId) -
updateCowHealth
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/updatecowhealth") public edu.ucsb.cs156.jobs.entities.Job updateCowHealth() -
updateCowHealthSingleGame
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/updatecowhealthsinglegame") public edu.ucsb.cs156.jobs.entities.Job updateCowHealthSingleGame(@RequestParam Long gameId) -
setCowHealth
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/setcowhealth") public edu.ucsb.cs156.jobs.entities.Job setCowHealth(@RequestParam Long gameID, @RequestParam double health) -
instructorReport
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/instructorreport") public edu.ucsb.cs156.jobs.entities.Job instructorReport() -
instructorReportSingleGame
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/instructorreportsinglegame") public edu.ucsb.cs156.jobs.entities.Job instructorReportSingleGame(@RequestParam Long gameId) -
recordGameStats
@PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/launch/recordgamestats") public edu.ucsb.cs156.jobs.entities.Job recordGameStats()
-