Class AdminImpl
java.lang.Object
uk.ac.manchester.spinnaker.alloc.admin.AdminImpl
- All Implemented Interfaces:
- AdminAPI
@Service("admin")
@Path("spalloc/admin")
@ManagedResource("Spalloc:type=Admin,name=admin")
public class AdminImpl
extends Object
implements AdminAPI
Implements the service administration interface.
- Author:
- Donal Fellows
- 
Nested Class SummaryNested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.alloc.admin.AdminAPIAdminAPI.Description, AdminAPI.Paths
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddMember(int groupId, MemberRecord request, jakarta.ws.rs.core.UriInfo ui) Add a user to a group.jakarta.ws.rs.core.ResponsecreateGroup(GroupRecord group, jakarta.ws.rs.core.UriInfo ui) Create a new group.jakarta.ws.rs.core.ResponsecreateUser(UserRecord providedUser, jakarta.ws.rs.core.UriInfo ui) Create a new user.deleteGroup(int groupId) Delete a group.deleteUser(int id, jakarta.ws.rs.core.SecurityContext security) Delete a user.describeGroup(int groupId, jakarta.ws.rs.core.UriInfo ui) Read a particular group's details.describeMember(int groupId, int memberId, jakarta.ws.rs.core.UriInfo ui) Read a particular group's details.describeUser(int id, jakarta.ws.rs.core.UriInfo ui) Read a particular user's details.booleangetBoardStateAddress(String name, String address) Find board by IP address and return its state.booleangetBoardStateCFB(String name, int c, int f, int b) Find board by physical coordinates and return its state.booleangetBoardStateXYZ(String name, int x, int y, int z) Find board by logical triad coordinates and return its state.voidImport a machine definition by posting it.listGroups(jakarta.ws.rs.core.UriInfo ui) List the groups and the URIs used to describe and manipulate them.listUsers(jakarta.ws.rs.core.UriInfo ui) List the usernames and the URIs used to describe and manipulate them.jakarta.ws.rs.core.ResponseremoveMember(int groupId, int memberId) Delete a membership of a group.booleansetBoardStateAddress(String name, String address, boolean enabled) Enable or disable a board.booleansetBoardStateCFB(String name, int c, int f, int b, boolean enabled) Enable or disable a board.booleansetBoardStateXYZ(String name, int x, int y, int z, boolean enabled) Enable or disable a board.updateGroup(int groupId, GroupRecord group, jakarta.ws.rs.core.UriInfo ui) Update a particular group's details.updateUser(int id, UserRecord providedUser, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security) Update a particular user's details.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.manchester.spinnaker.alloc.admin.AdminAPIdescribeImport, describeOperations, getBoardState, setBoardState
- 
Constructor Details- 
AdminImplpublic AdminImpl()
 
- 
- 
Method Details- 
importMachinesByContentDescription copied from interface:AdminAPIImport a machine definition by posting it.- Specified by:
- importMachinesByContentin interface- AdminAPI
- Parameters:
- definitions- The definitions.
 
- 
getBoardStateXYZDescription copied from interface:AdminAPIFind board by logical triad coordinates and return its state.- Specified by:
- getBoardStateXYZin interface- AdminAPI
- Parameters:
- name- The name of the machine
- x- The X coordinate
- y- The Y coordinate
- z- The Z coordinate
- Returns:
- Whether the board is enabled
 
- 
setBoardStateXYZ@ManagedOperation public boolean setBoardStateXYZ(String name, int x, int y, int z, boolean enabled) Description copied from interface:AdminAPIEnable or disable a board. Find by logical triad coordinates.- Specified by:
- setBoardStateXYZin interface- AdminAPI
- Parameters:
- name- The name of the machine
- x- The X coordinate
- y- The Y coordinate
- z- The Z coordinate
- enabled- Whether the board should be set to the enabled state
- Returns:
- Whether the board is enabled
 
- 
getBoardStateCFBDescription copied from interface:AdminAPIFind board by physical coordinates and return its state.- Specified by:
- getBoardStateCFBin interface- AdminAPI
- Parameters:
- name- The name of the machine
- c- The cabinet number
- f- The frame number
- b- The board number
- Returns:
- Whether the board is enabled
 
- 
setBoardStateCFB@ManagedOperation public boolean setBoardStateCFB(String name, int c, int f, int b, boolean enabled) Description copied from interface:AdminAPIEnable or disable a board. Find by physical coordinates.- Specified by:
- setBoardStateCFBin interface- AdminAPI
- Parameters:
- name- The name of the machine
- c- The cabinet number
- f- The frame number
- b- The board number
- enabled- Whether the board should be set to the enabled state
- Returns:
- Whether the board is enabled
 
- 
getBoardStateAddressDescription copied from interface:AdminAPIFind board by IP address and return its state.- Specified by:
- getBoardStateAddressin interface- AdminAPI
- Parameters:
- name- The name of the machine
- address- The IP address of the board (dotted quad)
- Returns:
- Whether the board is enabled
 
- 
setBoardStateAddressDescription copied from interface:AdminAPIEnable or disable a board. Find by IP address.- Specified by:
- setBoardStateAddressin interface- AdminAPI
- Parameters:
- name- The name of the machine
- address- The IP address of the board (dotted quad)
- enabled- Whether the board should be set to the enabled state
- Returns:
- Whether the board is enabled
 
- 
listUsersDescription copied from interface:AdminAPIList the usernames and the URIs used to describe and manipulate them.
- 
createUserpublic jakarta.ws.rs.core.Response createUser(UserRecord providedUser, jakarta.ws.rs.core.UriInfo ui) Description copied from interface:AdminAPICreate a new user.- Specified by:
- createUserin interface- AdminAPI
- Parameters:
- providedUser- Description of user to create. Username must be unique.
- ui- For building URIs.
- Returns:
- REST response (CREATED on success)
 
- 
describeUserDescription copied from interface:AdminAPIRead a particular user's details.- Specified by:
- describeUserin interface- AdminAPI
- Parameters:
- id- The ID of the user
- ui- For building URIs.
- Returns:
- Description of the user.
 
- 
updateUserpublic UserRecord updateUser(int id, UserRecord providedUser, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security) Description copied from interface:AdminAPIUpdate a particular user's details.- Specified by:
- updateUserin interface- AdminAPI
- Parameters:
- id- The ID of the user
- providedUser- What to set the details to.- nullfields are ignored.
- ui- For building URIs.
- security- Used to check who the current user actually is.
- Returns:
- The updated user details.
 
- 
deleteUserDescription copied from interface:AdminAPIDelete a user.- Specified by:
- deleteUserin interface- AdminAPI
- Parameters:
- id- The ID of the user
- security- Used to check who the current user actually is.
- Returns:
- Description of what user was deleted.
 
- 
listGroupsDescription copied from interface:AdminAPIList the groups and the URIs used to describe and manipulate them.- Specified by:
- listGroupsin interface- AdminAPI
- Parameters:
- ui- For building URIs.
- Returns:
- A sorted map from group name to details-handling URI
 
- 
createGroupDescription copied from interface:AdminAPICreate a new group.- Specified by:
- createGroupin interface- AdminAPI
- Parameters:
- group- Description of group to create. Group name must be unique.
- ui- For building URIs.
- Returns:
- REST response (CREATED on success)
 
- 
describeGroupDescription copied from interface:AdminAPIRead a particular group's details.- Specified by:
- describeGroupin interface- AdminAPI
- Parameters:
- groupId- The ID of the group
- ui- For building URIs.
- Returns:
- Description of the group.
 
- 
updateGroupDescription copied from interface:AdminAPIUpdate a particular group's details. This particularly includes the name and the quota, but excludes the memberships; those are separate resources.- Specified by:
- updateGroupin interface- AdminAPI
- Parameters:
- groupId- The ID of the group
- group- The description of the group to update to be like.
- ui- For building URIs.
- Returns:
- Description of the group.
 
- 
deleteGroupDescription copied from interface:AdminAPIDelete a group.- Specified by:
- deleteGroupin interface- AdminAPI
- Parameters:
- groupId- The ID of the group
- Returns:
- Description of what group was deleted
 
- 
addMemberpublic jakarta.ws.rs.core.Response addMember(int groupId, MemberRecord request, jakarta.ws.rs.core.UriInfo ui) Description copied from interface:AdminAPIAdd a user to a group.
- 
describeMemberDescription copied from interface:AdminAPIRead a particular group's details.- Specified by:
- describeMemberin interface- AdminAPI
- Parameters:
- groupId- The ID of the group
- memberId- The ID of the membership.
- ui- For building URIs.
- Returns:
- Description of the membership.
 
- 
removeMemberpublic jakarta.ws.rs.core.Response removeMember(int groupId, int memberId) Description copied from interface:AdminAPIDelete a membership of a group.- Specified by:
- removeMemberin interface- AdminAPI
- Parameters:
- groupId- The ID of the group
- memberId- The ID of the membership
- Returns:
- REST response
 
 
-