Interface AdminController
- All Known Implementing Classes:
- AdminControllerImpl
@RequestMapping("/system/admin")
@PreAuthorize("hasRole(\'ADMIN\')")
public interface AdminController
The API for the controller for the admin user interface.
- Author:
- Donal Fellows
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classThe model of a blacklist used by the administration web interface.static classModel used when creating a group.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe base path of this interface within the MVC domain.static final StringPath to blacklist operations.static final StringPath to boards operations.static final StringPath to group creation operations.static final StringPath to user creation operations.static final StringPath to user-add-to-group operation.static final StringPath to single-user-deletion operation.static final StringPath to single-group operations.static final StringPath to quota-adjustment operation.static final StringPath to user-remove-from-group operation.static final StringPath to all-groups operations.static final StringName of parameter used when submitting a new machine definition.static final StringPath to machine-instantiation operations.static final StringName of parameter used to mark a retagging.static final StringPath to temperature operations.static final StringPath to single-user-deletion operation.static final StringPath to single-user operations.static final StringPath to all-users operations.
- 
Method SummaryModifier and TypeMethodDescriptionaddUserToGroup(int id, @NotBlank String user, RedirectAttributes attrs) Add a user to a group.adjustGroupQuota(int id, int delta, RedirectAttributes attrs) Adjust the quota of a group.blacklistFetch(@jakarta.validation.Valid int boardId, @jakarta.validation.Valid int bmpId) Fetch the blacklist for a board from the machine.blacklistSave(@Valid AdminController.BlacklistData bldata) Save a new blacklist.board(@Valid BoardRecord board, ModelMap model) Manipulate a board.UI for boards.createGroup(@Valid AdminController.CreateGroupModel group, RedirectAttributes attrs) Create a group.createUser(@Valid UserRecord user, ModelMap model, RedirectAttributes attrs) Create a user.defineMachine(@NotNull MultipartFile file) Handle the upload of a machine definition.deleteGroup(int id, RedirectAttributes attrs) Delete a group.deleteUser(int id, Principal principal, RedirectAttributes attrs) Delete a user.disableMachine(@NotEmpty String machineName) Mark a machine as out of service.enableMachine(@NotEmpty String machineName) Mark a machine as in service.getGroupCreationForm(ModelMap model) Get the form for creating a group.getTemperatures(@jakarta.validation.Valid int boardId, @jakarta.validation.Valid int bmpId) Get the temperature data for a board.getUserCreationForm(ModelMap model) Get the form for creating a user.listGroups(ModelMap model) List all groups.List all users.machineManagement(ModelMap model) Provide the form for uploading a machine definition.Get supported ops.removeUserFromGroup(int id, int userid, RedirectAttributes attrs) Remove a user from a group.retagMachine(@NotEmpty String machineName, @TagList @NotNull String newTags) Handle the change of the tags of a machine.showGroupInfo(int id) Get info about a particular group.showUserForm(int id) Show user details.submitUserForm(int id, @Valid UserRecord user, ModelMap model, Principal principal) Modify user details.
- 
Field Details- 
BASE_PATHThe base path of this interface within the MVC domain.- See Also:
 
- 
USERS_PATHPath to all-users operations.- See Also:
 
- 
CREATE_USER_PATHPath to user creation operations.- See Also:
 
- 
USER_PATHPath to single-user operations.- See Also:
 
- 
USER_DELETE_PATHPath to single-user-deletion operation.- See Also:
 
- 
GROUPS_PATHPath to all-groups operations.- See Also:
 
- 
CREATE_GROUP_PATHPath to group creation operations.- See Also:
 
- 
GROUP_PATHPath to single-group operations.- See Also:
 
- 
GROUP_ADD_USER_PATHPath to user-add-to-group operation.- See Also:
 
- 
GROUP_REMOVE_USER_PATHPath to user-remove-from-group operation.- See Also:
 
- 
GROUP_QUOTA_PATHPath to quota-adjustment operation.- See Also:
 
- 
GROUP_DELETE_PATHPath to single-user-deletion operation.- See Also:
 
- 
BOARDS_PATHPath to boards operations.- See Also:
 
- 
BLACKLIST_PATHPath to blacklist operations.- See Also:
 
- 
TEMPERATURE_PATHPath to temperature operations.- See Also:
 
- 
MACHINE_PATHPath to machine-instantiation operations.- See Also:
 
- 
MACHINE_FILE_PARAMName of parameter used when submitting a new machine definition.- See Also:
 
- 
MACHINE_RETAG_PARAMName of parameter used to mark a retagging.- See Also:
 
 
- 
- 
Method Details- 
mainUIGet supported ops.- Parameters:
- model- Overall model
- Returns:
- the view
 
- 
listUsersList all users.- Parameters:
- model- Overall model
- Returns:
- the model and view
 
- 
getUserCreationFormGet the form for creating a user.- Parameters:
- model- Overall model
- Returns:
- the model and view
 
- 
createUser@PostMapping("/create-user") ModelAndView createUser(@Valid @ModelAttribute("user") @Valid UserRecord user, ModelMap model, RedirectAttributes attrs) Create a user.- Parameters:
- user- The description of the user to create
- model- Overall model
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
showUserFormShow user details.- Parameters:
- id- The user ID
- Returns:
- the model and view
 
- 
submitUserForm@PostMapping("/users/{id}") ModelAndView submitUserForm(@PathVariable("id") int id, @Valid @ModelAttribute("user") @Valid UserRecord user, ModelMap model, Principal principal) Modify user details.- Parameters:
- id- The user ID
- user- The description of the user to update
- model- Overall model
- principal- Who is the admin? Used for safety checks.
- Returns:
- the model and view
 
- 
deleteUser@PostMapping("/users/{id}/delete") ModelAndView deleteUser(@PathVariable("id") int id, Principal principal, RedirectAttributes attrs) Delete a user.- Parameters:
- id- The user ID to delete
- principal- Who is the admin? Used for safety checks.
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
listGroupsList all groups.- Parameters:
- model- Overall model
- Returns:
- the model and view
 
- 
showGroupInfoGet info about a particular group.- Parameters:
- id- The ID of the group to get info about.
- Returns:
- the model and view
 
- 
getGroupCreationFormGet the form for creating a group.- Parameters:
- model- Overall model
- Returns:
- the model (a AdminController.CreateGroupModel) and view
 
- 
createGroup@PostMapping("/create-group") ModelAndView createGroup(@Valid @ModelAttribute("group") @Valid AdminController.CreateGroupModel group, RedirectAttributes attrs) Create a group.- Parameters:
- group- The description of the group to create
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
addUserToGroup@PostMapping("/groups/{id}/add-user") ModelAndView addUserToGroup(@PathVariable("id") int id, @NotBlank @RequestParam("user") @NotBlank String user, RedirectAttributes attrs) Add a user to a group.- Parameters:
- id- The group ID to adjust
- user- The name of the user to add
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
removeUserFromGroup@PostMapping("/groups/{id}/remove-user/{userid}") ModelAndView removeUserFromGroup(@PathVariable("id") int id, @PathVariable("userid") int userid, RedirectAttributes attrs) Remove a user from a group.- Parameters:
- id- The group ID to adjust
- userid- The ID of the user to remove
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
adjustGroupQuota@PostMapping("/groups/{id}/adjust-quota") ModelAndView adjustGroupQuota(@PathVariable("id") int id, @RequestParam("delta") int delta, RedirectAttributes attrs) Adjust the quota of a group.- Parameters:
- id- The group ID to adjust
- delta- By how much are we to adjust the quota. In board-hours.
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
deleteGroup@PostMapping("/groups/{id}/delete") ModelAndView deleteGroup(@PathVariable("id") int id, RedirectAttributes attrs) Delete a group. It is legal for a user to not be a member of any group; they just won't be able to submit jobs if that's the case.- Parameters:
- id- The group ID to delete
- attrs- Where to put attributes of the model so that they are respected after the redirect without being present in the URL.
- Returns:
- the model and view
 
- 
boardsUI for boards.- Parameters:
- model- Overall model
- Returns:
- the model and view
 
- 
board@PostMapping("/boards") ModelAndView board(@Valid @ModelAttribute("board") @Valid BoardRecord board, ModelMap model) Manipulate a board.- Parameters:
- board- The board coordinates, and possibly the state change
- model- Overall model
- Returns:
- the model and view
 
- 
blacklistSave@PostMapping("/boards/blacklist") ResponseEntity<Void> blacklistSave(@Valid @RequestBody @Valid AdminController.BlacklistData bldata) Save a new blacklist.- Parameters:
- bldata- The blacklist data.
- Returns:
- The empty response with the appropriate code.
 
- 
blacklistFetch@GetMapping("/boards/blacklist") @ResponseBody AdminController.BlacklistData blacklistFetch(@Valid @RequestParam("board_id") @jakarta.validation.Valid int boardId, @Valid @RequestParam("bmp_id") @jakarta.validation.Valid int bmpId) Fetch the blacklist for a board from the machine.- Parameters:
- boardId- The board to get the data for.
- bmpId- The BMP of the board.
- Returns:
- the blacklist data.
 
- 
getTemperatures@GetMapping("/boards/temperature") @ResponseBody BoardTemperatures getTemperatures(@Valid @RequestParam("board_id") @jakarta.validation.Valid int boardId, @Valid @RequestParam("bmp_id") @jakarta.validation.Valid int bmpId) Get the temperature data for a board.- Parameters:
- boardId- Which board to get the data for.
- bmpId- The BMP that controls the board.
- Returns:
- the model and view in a future
 
- 
machineManagementProvide the form for uploading a machine definition.- Parameters:
- model- Overall model
- Returns:
- the model and view
 
- 
retagMachine@PostMapping(path="/machine", params="retag") ModelAndView retagMachine(@NotEmpty @ModelAttribute("machine") @NotEmpty String machineName, @TagList @NotNull @ModelAttribute("retag") @TagList @NotNull String newTags) Handle the change of the tags of a machine.- Parameters:
- machineName- The name of the machine being retagged
- newTags- The tags of the machine; comma-separated list
- Returns:
- the model and view
 
- 
disableMachine@PostMapping(value="/machine", params="outOfService") ModelAndView disableMachine(@NotEmpty @ModelAttribute("machine") @NotEmpty String machineName) Mark a machine as out of service.- Parameters:
- machineName- The name of the machine being disabled
- Returns:
- the model and view
 
- 
enableMachine@PostMapping(value="/machine", params="intoService") ModelAndView enableMachine(@NotEmpty @ModelAttribute("machine") @NotEmpty String machineName) Mark a machine as in service.- Parameters:
- machineName- The name of the machine being enabled
- Returns:
- the model and view
 
- 
defineMachine@PostMapping(path="/machine") ModelAndView defineMachine(@NotNull @RequestParam("file") @NotNull MultipartFile file) Handle the upload of a machine definition. Note that no user has any quota set on a newly defined machine; it's totally free to use by default.- Parameters:
- file- The file being uploaded
- Returns:
- the model and view
 
 
-