Interface SystemController
- All Known Implementing Classes:
SystemControllerImpl
@RequestMapping("/system") public interface SystemController
The main web interface controller.
- Author:
- Donal Fellows
-
Field Summary
Fields Modifier and Type Field Description static String
ROOT_PATH
The root path to the controller within the overall application.static String
USER_MAY_CHANGE_PASSWORD
The name of the boolean view attribute describing whether the password change form may be used.static String
USER_PASSWORD_CHANGE_ATTR
The name of the main attribute supporting a password change form. -
Method Summary
Modifier and Type Method Description ModelAndView
destroyJob(int id, String reason)
Delete a job.ModelAndView
getJobInfo(int id)
Get the view for some job details.ModelAndView
getJobList()
Get the view for the general job list.ModelAndView
getMachineInfo(String machine)
Get the view for some machine details.ModelAndView
getMachineList()
Get the view for the general machine list.ModelAndView
getPasswordChangeForm(Principal principal)
Get the view and model for the password change form.ModelAndView
index()
Get the view for the main page of the service.List<Process>
listProcesses(int id, @javax.validation.Valid int x, @javax.validation.Valid int y)
Get job processes on a chip.ModelAndView
login()
Get the login form page.String
performLogout(HttpServletRequest request, HttpServletResponse response)
Log the user out.ModelAndView
postPasswordChangeForm(@Valid PasswordChangeRecord user, Principal principal)
Carry out a password change.ModelAndView
powerJob(int id, boolean power)
Set the power of a job.
-
Field Details
-
ROOT_PATH
The root path to the controller within the overall application.- See Also:
- Constant Field Values
-
USER_PASSWORD_CHANGE_ATTR
The name of the main attribute supporting a password change form.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Method Details
-
index
Get the view for the main page of the service.- Returns:
- View (
index.jsp
)
-
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
Get 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
)
-
getJobList
Get 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 deletedreason
- 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 deletedpower
- Whether to power on or off- Returns:
- View (
jobdetails.jsp
) and model (based onJobDescription
)
-
getPasswordChangeForm
Get 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(HttpServletRequest request, HttpServletResponse response)Log the user out.- Parameters:
request
- What request was maderesponse
- What response to build- Returns:
- Redirect to the login page
- See Also:
LogoutHandler
-
listProcesses
@GetMapping("/job_processes/{id}") @PreAuthorize("hasRole(\'READER\')") @ResponseBody List<Process> listProcesses(@PathVariable("id") int id, @Valid @RequestParam("x") @javax.validation.Valid int x, @Valid @RequestParam("y") @javax.validation.Valid int y)Get job processes on a chip.- Parameters:
id
- Which job is being asked forx
- The x coordinate of the chipy
- 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.
-