Class AdminControllerImpl
java.lang.Object
uk.ac.manchester.spinnaker.alloc.db.SQLQueries
uk.ac.manchester.spinnaker.alloc.db.DatabaseAwareBean
uk.ac.manchester.spinnaker.alloc.admin.AdminControllerImpl
- All Implemented Interfaces:
AdminController
@Controller("mvc.adminUI")
@PreAuthorize("hasRole(\'ADMIN\')")
public class AdminControllerImpl
extends DatabaseAwareBean
implements AdminController
Implements the logic supporting the JSP views and maps them into URL space.
- Author:
- Donal Fellows
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.manchester.spinnaker.alloc.db.DatabaseAwareBean
DatabaseAwareBean.AbstractSQLNested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.alloc.admin.AdminController
AdminController.BlacklistData, AdminController.CreateGroupModel -
Field Summary
Fields inherited from class uk.ac.manchester.spinnaker.alloc.db.SQLQueries
ADD_BLACKLISTED_CHIP, ADD_BLACKLISTED_CORE, ADD_BLACKLISTED_LINK, ADD_USER_TO_GROUP, ADJUST_QUOTA, ALLOCATE_BOARDS_BOARD, ALLOCATE_BOARDS_JOB, BUMP_IMPORTANCE, CHECK_LOCATION, checkRectangle, checkRectangleAt, CLEAR_BLACKLISTED_CHIPS, CLEAR_BLACKLISTED_CORES, CLEAR_BLACKLISTED_LINKS, COMPLETED_BLACKLIST_WRITE, COMPLETED_BOARD_INFO_READ, COMPLETED_GET_SERIAL_REQ, COUNT_CHANGES_FOR_JOB, COUNT_FUNCTIONING_BOARDS, COUNT_MACHINE_THINGS, COUNT_POWERED_BOARDS, countConnected, CREATE_BLACKLIST_READ, CREATE_BLACKLIST_WRITE, CREATE_GROUP, CREATE_GROUP_IF_NOT_EXISTS, CREATE_SERIAL_READ_REQ, CREATE_TEMP_READ_REQ, CREATE_USER, DEALLOCATE_BMP_BOARDS_JOB, DECREMENT_QUOTA, DELETE_ALLOC_RECORD, DELETE_BLACKLIST_OP, DELETE_GROUP, DELETE_JOB_RECORD, DELETE_MACHINE_TAGS, DELETE_NMPI_JOB, DELETE_NMPI_SESSION, DELETE_PENDING, DELETE_TASK, DELETE_USER, DESTROY_ALL_LIVE_JOBS, DESTROY_JOB, ERROR_PENDING, FAILED_BLACKLIST_OP, FIND_BOARD_BY_ID, FIND_BOARD_BY_NAME_AND_CFB, FIND_BOARD_BY_NAME_AND_IP_ADDRESS, FIND_BOARD_BY_NAME_AND_XYZ, FIND_EXPIRED_JOBS, FIND_FREE_BOARD, FIND_LOCATION, findBoardByGlobalChip, findBoardByIPAddress, findBoardByJobChip, findBoardByLogicalCoords, findBoardByPhysicalCoords, findRectangle, findRectangleAt, FINISHED_PENDING, GET_ALL_BMP_BOARDS, GET_ALL_BMPS, GET_ALL_BOARDS, GET_ALL_BOARDS_OF_ALL_MACHINES, GET_ALL_LIVE_JOBS, GET_ALL_MACHINES, GET_AVAILABLE_BOARD_NUMBERS, GET_BLACKLIST_READS, GET_BLACKLIST_WRITES, GET_BLACKLISTED_CHIPS, GET_BLACKLISTED_CORES, GET_BLACKLISTED_LINKS, GET_BMP_ADDRESS, GET_BMP_BOARD_NUMBERS, GET_BOARD_ADDRESS, GET_BOARD_BY_COORDS, GET_BOARD_CONNECT_INFO, GET_BOARD_JOB, GET_BOARD_NUMBERS, GET_BOARD_POWER_INFO, GET_BOARD_REPORTS, GET_CHANGES, GET_COMPLETED_BLACKLIST_OP, GET_CONSOLIDATION_TARGETS, GET_CURRENT_USAGE, GET_DEAD_BOARDS, GET_FUNCTIONING_FIELD, GET_GROUP_BY_ID, GET_GROUP_BY_NAME, GET_GROUP_BY_NAME_AND_MEMBER, GET_GROUP_NAMES_OF_USER, GET_GROUP_QUOTA, GET_JOB, GET_JOB_BOARD_COORDS, GET_JOB_BOARDS, GET_JOB_CHIP_DIMENSIONS, GET_JOB_IDS, GET_JOB_NMPI_JOB, GET_JOB_SESSION, GET_JOB_USAGE_AND_QUOTA, GET_LIVE_BOARDS, GET_LIVE_JOB_IDS, GET_LOCAL_USER_DETAILS, GET_MACHINE_BY_ID, GET_MACHINE_JOBS, GET_MACHINE_REPORTS, GET_MACHINE_WRAPS, GET_MEMBERSHIP, GET_MEMBERSHIPS_OF_USER, GET_NAMED_MACHINE, GET_ROOT_BMP_ADDRESS, GET_ROOT_COORDS, GET_ROOT_OF_BOARD, GET_SERIAL_INFO_REQS, GET_SUM_BOARDS_POWERED, GET_TAGS, GET_TEMP_INFO_REQS, GET_USER_AUTHORITIES, GET_USER_DETAILS, GET_USER_DETAILS_BY_NAME, GET_USER_DETAILS_BY_SUBJECT, GET_USER_ID, GET_USER_QUOTA, GET_USERS_OF_GROUP, getAllocationTasks, getConnectedBoards, getDeadLinks, getJobsWithChanges, getPerimeterLinks, getReportedBoards, GROUP_SYNC_ADD_GROUPS, GROUP_SYNC_DROP_TEMP_TABLE, GROUP_SYNC_INSERT_TEMP_ROW, GROUP_SYNC_MAKE_TEMP_TABLE, GROUP_SYNC_REMOVE_GROUPS, INSERT_BMP, INSERT_BOARD, INSERT_BOARD_REPORT, INSERT_JOB, INSERT_LINK, INSERT_MACHINE_SPINN_5, INSERT_REQ_BOARD, INSERT_REQ_N_BOARDS, INSERT_REQ_SIZE, INSERT_REQ_SIZE_BOARD, INSERT_TAG, IS_BOARD_BLACKLIST_CURRENT, IS_USER_LOCKED, issueChangeForJob, KILL_ALL_JOB_ALLOC_TASK, KILL_JOB_ALLOC_TASK, LIST_ALL_GROUPS, LIST_ALL_GROUPS_OF_TYPE, LIST_ALL_USERS, LIST_ALL_USERS_OF_TYPE, LIST_LIVE_JOBS, LIST_MACHINE_NAMES, LOAD_DIR_INFO, MARK_BOARD_BLACKLIST_CHANGED, MARK_BOARD_BLACKLIST_SYNCHED, MARK_CONSOLIDATED, MARK_LOGIN_FAILURE, MARK_LOGIN_SUCCESS, NOTE_DESTROY_REASON, READ_HISTORICAL_ALLOCS, READ_HISTORICAL_JOBS, REMOVE_USER_FROM_GROUP, SET_ALL_BOARDS_OFF, SET_BOARD_POWER_OFF, SET_BOARD_POWER_ON, SET_BOARD_SERIAL_IDS, SET_COLLAB_QUOTA, SET_FUNCTIONING_FIELD, SET_JOB_NMPI_JOB, SET_JOB_SESSION, SET_MACHINE_STATE, SET_MAX_COORDS, SET_STATE_DESTROYED, SET_STATE_PENDING, SET_USER_DISABLED, SET_USER_LOCKED, SET_USER_NAME, SET_USER_PASS, SET_USER_TRUST, UNLOCK_LOCKED_USERS, UPDATE_GROUP, UPDATE_KEEPALIVE, WRITE_HISTORICAL_ALLOCS, WRITE_HISTORICAL_JOBSFields inherited from interface uk.ac.manchester.spinnaker.alloc.admin.AdminController
BASE_PATH, BLACKLIST_PATH, BOARDS_PATH, CREATE_GROUP_PATH, CREATE_USER_PATH, GROUP_ADD_USER_PATH, GROUP_DELETE_PATH, GROUP_PATH, GROUP_QUOTA_PATH, GROUP_REMOVE_USER_PATH, GROUPS_PATH, MACHINE_FILE_PARAM, MACHINE_PATH, MACHINE_RETAG_PARAM, TEMPERATURE_PATH, USER_DELETE_PATH, USER_PATH, USERS_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddUserToGroup(int id, String user, RedirectAttributes attrs) Add a user to a group.adjustGroupQuota(int id, int delta, RedirectAttributes attrs) Adjust the quota of a group.blacklistFetch(int boardId, int bmpId) Fetch the blacklist for a board from the machine.Save a new blacklist.board(BoardRecord board, ModelMap model) Manipulate a board.UI for boards.createGroup(AdminController.CreateGroupModel groupRequest, RedirectAttributes attrs) Create a group.createUser(UserRecord user, ModelMap model, RedirectAttributes attrs) Create a user.defineMachine(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(String machineName) Mark a machine as out of service.enableMachine(String machineName) Mark a machine as in service.getGroupCreationForm(ModelMap ignored) Get the form for creating a group.getTemperatures(int boardId, int bmpId) Get the temperature data for a board.getUserCreationForm(ModelMap ignored) Get the form for creating a user.listGroups(ModelMap ignored) List all groups.List all users.machineManagement(ModelMap ignored) 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(String machineName, 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, UserRecord user, ModelMap model, Principal principal) Modify user details.Methods inherited from class uk.ac.manchester.spinnaker.alloc.db.DatabaseAwareBean
execute, executeRead, getConnection, getHistoricalConnection, isHistoricalDBAvailable
-
Constructor Details
-
AdminControllerImpl
public AdminControllerImpl()
-
-
Method Details
-
mainUI
Description copied from interface:AdminControllerGet supported ops.- Specified by:
mainUIin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the view
-
listUsers
Description copied from interface:AdminControllerList all users.- Specified by:
listUsersin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model and view
-
getUserCreationForm
Description copied from interface:AdminControllerGet the form for creating a user.- Specified by:
getUserCreationFormin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model and view
-
createUser
Description copied from interface:AdminControllerCreate a user.- Specified by:
createUserin interfaceAdminController- Parameters:
user- The description of the user to createmodel- Overall modelattrs- 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
-
showUserForm
Description copied from interface:AdminControllerShow user details.- Specified by:
showUserFormin interfaceAdminController- Parameters:
id- The user ID- Returns:
- the model and view
-
submitUserForm
Description copied from interface:AdminControllerModify user details.- Specified by:
submitUserFormin interfaceAdminController- Parameters:
id- The user IDuser- The description of the user to updatemodel- Overall modelprincipal- Who is the admin? Used for safety checks.- Returns:
- the model and view
-
deleteUser
Description copied from interface:AdminControllerDelete a user.- Specified by:
deleteUserin interfaceAdminController- Parameters:
id- The user ID to deleteprincipal- 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
-
listGroups
Description copied from interface:AdminControllerList all groups.- Specified by:
listGroupsin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model and view
-
showGroupInfo
Description copied from interface:AdminControllerGet info about a particular group.- Specified by:
showGroupInfoin interfaceAdminController- Parameters:
id- The ID of the group to get info about.- Returns:
- the model and view
-
getGroupCreationForm
Description copied from interface:AdminControllerGet the form for creating a group.- Specified by:
getGroupCreationFormin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model (a
AdminController.CreateGroupModel) and view
-
createGroup
public ModelAndView createGroup(AdminController.CreateGroupModel groupRequest, RedirectAttributes attrs) Description copied from interface:AdminControllerCreate a group.- Specified by:
createGroupin interfaceAdminController- Parameters:
groupRequest- The description of the group to createattrs- 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
Description copied from interface:AdminControllerAdd a user to a group.- Specified by:
addUserToGroupin interfaceAdminController- Parameters:
id- The group ID to adjustuser- The name of the user to addattrs- 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
Description copied from interface:AdminControllerRemove a user from a group.- Specified by:
removeUserFromGroupin interfaceAdminController- Parameters:
id- The group ID to adjustuserid- The ID of the user to removeattrs- 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
Description copied from interface:AdminControllerAdjust the quota of a group.- Specified by:
adjustGroupQuotain interfaceAdminController- Parameters:
id- The group ID to adjustdelta- 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
Description copied from interface:AdminControllerDelete 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.- Specified by:
deleteGroupin interfaceAdminController- Parameters:
id- The group ID to deleteattrs- 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
-
boards
Description copied from interface:AdminControllerUI for boards.- Specified by:
boardsin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model and view
-
board
Description copied from interface:AdminControllerManipulate a board.- Specified by:
boardin interfaceAdminController- Parameters:
board- The board coordinates, and possibly the state changemodel- Overall model- Returns:
- the model and view
-
blacklistSave
Description copied from interface:AdminControllerSave a new blacklist.- Specified by:
blacklistSavein interfaceAdminController- Parameters:
bldata- The blacklist data.- Returns:
- The empty response with the appropriate code.
-
blacklistFetch
Description copied from interface:AdminControllerFetch the blacklist for a board from the machine.- Specified by:
blacklistFetchin interfaceAdminController- Parameters:
boardId- The board to get the data for.bmpId- The BMP of the board.- Returns:
- the blacklist data.
-
getTemperatures
Description copied from interface:AdminControllerGet the temperature data for a board.- Specified by:
getTemperaturesin interfaceAdminController- Parameters:
boardId- Which board to get the data for.bmpId- The BMP that controls the board.- Returns:
- the model and view in a future
-
machineManagement
Provide the form for uploading a machine definition.Implementation note: This is the baseline information that
admin/machine.jspneeds.- Specified by:
machineManagementin interfaceAdminController- Parameters:
ignored- Overall model- Returns:
- the model and view
-
retagMachine
Description copied from interface:AdminControllerHandle the change of the tags of a machine.- Specified by:
retagMachinein interfaceAdminController- Parameters:
machineName- The name of the machine being retaggednewTags- The tags of the machine; comma-separated list- Returns:
- the model and view
-
disableMachine
Description copied from interface:AdminControllerMark a machine as out of service.- Specified by:
disableMachinein interfaceAdminController- Parameters:
machineName- The name of the machine being disabled- Returns:
- the model and view
-
enableMachine
Description copied from interface:AdminControllerMark a machine as in service.- Specified by:
enableMachinein interfaceAdminController- Parameters:
machineName- The name of the machine being enabled- Returns:
- the model and view
-
defineMachine
Description copied from interface:AdminControllerHandle 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.- Specified by:
defineMachinein interfaceAdminController- Parameters:
file- The file being uploaded- Returns:
- the model and view
-