Interface SystemController

All Known Implementing Classes:
SystemControllerImpl

@RequestMapping("/system") public interface SystemController
The main web interface controller.
Author:
Donal Fellows
  • Field Details

    • ROOT_PATH

      static final String ROOT_PATH
      The root path to the controller within the overall application.
      See Also:
    • USER_PASSWORD_CHANGE_ATTR

      static final String USER_PASSWORD_CHANGE_ATTR
      The name of the main attribute supporting a password change form.
      See Also:
    • USER_MAY_CHANGE_PASSWORD

      static final String USER_MAY_CHANGE_PASSWORD
      The 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

    • index

      Get the view for the main page of the service.
      Returns:
      View (index.jsp)
    • login

      @GetMapping("/login.html") ModelAndView login()
      Get 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)
    • getMachineList

      @GetMapping("/list_machines") @PreAuthorize("hasRole(\'READER\')") ModelAndView getMachineList()
      Get the view for the general machine list.
      Returns:
      View (listmachines.jsp) and model (based on MachineListEntryRecord)
    • 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 on MachineDescription)
    • getJobList

      @GetMapping("/list_jobs") @PreAuthorize("hasRole(\'READER\')") ModelAndView getJobList()
      Get the view for the general job list.
      Returns:
      View (listjobs.jsp) and model (based on JobListEntryRecord)
    • 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 on JobDescription)
    • 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 on JobDescription)
    • 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 on JobDescription)
    • getPasswordChangeForm

      @GetMapping("/change_password") ModelAndView getPasswordChangeForm(Principal principal)
      Get the view and model for the password change form.
      Parameters:
      principal - Who is changing their password.
      Returns:
      View (password.jsp) and model (based on PasswordChangeRecord)
    • 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 on PasswordChangeRecord)
    • 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.