Interface SystemController
- All Known Implementing Classes:
- SystemControllerImpl
The main web interface controller.
- Author:
- Donal Fellows
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe root path to the controller within the overall application.static final StringThe name of the boolean view attribute describing whether the password change form may be used.static final StringThe name of the main attribute supporting a password change form.
- 
Method SummaryModifier and TypeMethodDescriptiondestroyJob(int id, String reason) Delete a job.getJobInfo(int id) Get the view for some job details.Get the view for the general job list.getMachineInfo(String machine) Get the view for some machine details.Get the view for the general machine list.getPasswordChangeForm(Principal principal) Get the view and model for the password change form.index()Get the view for the main page of the service.listProcesses(int id, @jakarta.validation.Valid int x, @jakarta.validation.Valid int y) Get job processes on a chip.login()Get the login form page.performLogout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Log the user out.postPasswordChangeForm(@Valid PasswordChangeRecord user, Principal principal) Carry out a password change.powerJob(int id, boolean power) Set the power of a job.
- 
Field Details- 
ROOT_PATHThe root path to the controller within the overall application.- See Also:
 
- 
USER_PASSWORD_CHANGE_ATTRThe name of the main attribute supporting a password change form.- See Also:
 
- 
USER_MAY_CHANGE_PASSWORDThe name of the boolean view attribute describing whether the password change form may be used. Only local users may change their password!- See Also:
 
 
- 
- 
Method Details- 
indexGet the view for the main page of the service.- Returns:
- View (index.jsp)
 
- 
loginGet the login form page. Note that this must be a resource that can be accessed without authentication; it is part of the auth flow!- Returns:
- View (login.jsp)
 
- 
getMachineListGet the view for the general machine list.- Returns:
- View (listmachines.jsp) and model (based onMachineListEntryRecord)
 
- 
getMachineInfo@GetMapping("/machine_info/{machine}") @PreAuthorize("hasRole(\'READER\')") ModelAndView getMachineInfo(@PathVariable("machine") String machine) Get the view for some machine details.- Parameters:
- machine- Which machine is being asked for
- Returns:
- View (machinedetails.jsp) and model (based onMachineDescription)
 
- 
getJobListGet the view for the general job list.- Returns:
- View (listjobs.jsp) and model (based onJobListEntryRecord)
 
- 
getJobInfo@GetMapping("/job_info/{id}") @PreAuthorize("hasRole(\'READER\')") ModelAndView getJobInfo(@PathVariable("id") int id) Get the view for some job details.- Parameters:
- id- Which job is being asked for
- Returns:
- View (jobdetails.jsp) and model (based onJobDescription)
 
- 
destroyJob@PostMapping("/delete_job/{id}") @PreAuthorize("#permit.admin or #permit.nmpiexec or #permit.name == filterObject.owner.orElse(null)") ModelAndView destroyJob(@PathVariable("id") int id, @RequestParam("reason") String reason) Delete a job.- Parameters:
- id- Which job is being deleted
- reason- Why the job is being deleted
- Returns:
- View (jobdetails.jsp) and model (based onJobDescription)
 
- 
powerJob@PostMapping("/power_job/{id}") @PreAuthorize("#permit.admin or #permit.nmpiexec or #permit.name == filterObject.owner.orElse(null)") ModelAndView powerJob(@PathVariable("id") int id, @RequestParam("power") boolean power) Set the power of a job.- Parameters:
- id- Which job is being deleted
- power- Whether to power on or off
- Returns:
- View (jobdetails.jsp) and model (based onJobDescription)
 
- 
getPasswordChangeFormGet the view and model for the password change form.- Parameters:
- principal- Who is changing their password.
- Returns:
- View (password.jsp) and model (based onPasswordChangeRecord)
 
- 
postPasswordChangeForm@PostMapping("/change_password") ModelAndView postPasswordChangeForm(@ModelAttribute("user") @Valid @Valid PasswordChangeRecord user, Principal principal) Carry out a password change.- Parameters:
- user- The description of what to change.
- principal- Who is changing their password.
- Returns:
- View (password.jsp) and model (based onPasswordChangeRecord)
 
- 
performLogout@GetMapping("/perform_logout") String performLogout(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Log the user out.- Parameters:
- request- What request was made
- response- What response to build
- Returns:
- Redirect to the login page
- See Also:
 
- 
listProcesses@GetMapping("/job_processes/{id}") @PreAuthorize("hasRole(\'READER\')") @ResponseBody List<Process> listProcesses(@PathVariable("id") int id, @Valid @RequestParam("x") @jakarta.validation.Valid int x, @Valid @RequestParam("y") @jakarta.validation.Valid int y) Get job processes on a chip.- Parameters:
- id- Which job is being asked for
- x- The x coordinate of the chip
- y- The y coordinate of the chip
- Returns:
- List of Processes. Note all cores are returned though there may be no process on some of them and some may be dead cores.
 
 
-