Class ClientsAjaxController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.ajax.ClientsAjaxController
-
@RestController @RequestMapping("/ajax/clients") public class ClientsAjaxController extends java.lang.Object
Controller to handle ajax request for IRIDA Clients.
-
-
Constructor Summary
Constructors Constructor Description ClientsAjaxController(UIClientService service, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<AjaxResponse>
createClient(CreateUpdateClientDetails request, java.util.Locale locale)
Create a new client.void
deleteClient(java.lang.Long id)
Delete a clientvoid
deleteClientTokens(java.lang.Long id)
Revoke all tokens for a client given its identifierorg.springframework.http.ResponseEntity<TableResponse<ClientTableModel>>
getClientsList(ClientTableRequest request)
Get a page in the clients listing table based on the table request.void
regenerateClientSecret(java.lang.Long id)
Create a secret for a clientorg.springframework.http.ResponseEntity<AjaxResponse>
updateClient(CreateUpdateClientDetails request, java.util.Locale locale)
Update the details of a clientorg.springframework.http.ResponseEntity<java.lang.String>
validateClientName(java.lang.String clientId, java.util.Locale locale)
Check to see if the client identifier that a user wants to use for a new client is not already used
-
-
-
Constructor Detail
-
ClientsAjaxController
@Autowired public ClientsAjaxController(UIClientService service, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
getClientsList
@RequestMapping("/list") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<TableResponse<ClientTableModel>> getClientsList(@RequestBody ClientTableRequest request)
Get a page in the clients listing table based on the table request.- Parameters:
request
- Information about the current location in the Clients table- Returns:
- The current page of the clients table
-
deleteClientTokens
@DeleteMapping("/revoke") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public void deleteClientTokens(@RequestParam java.lang.Long id)
Revoke all tokens for a client given its identifier- Parameters:
id
- Identifier for a specific client
-
validateClientName
@RequestMapping("/validate") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<java.lang.String> validateClientName(@RequestParam java.lang.String clientId, java.util.Locale locale)
Check to see if the client identifier that a user wants to use for a new client is not already used- Parameters:
clientId
- Name to check if existslocale
- Users current locale- Returns:
- Http response indicating if the client id is valid.
-
createClient
@PostMapping @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<AjaxResponse> createClient(@RequestBody CreateUpdateClientDetails request, java.util.Locale locale)
Create a new client.- Parameters:
request
- Details about the client to createlocale
- users current locale- Returns:
- Http response containing the result
-
updateClient
@PutMapping @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public org.springframework.http.ResponseEntity<AjaxResponse> updateClient(@RequestBody CreateUpdateClientDetails request, java.util.Locale locale)
Update the details of a client- Parameters:
request
- Updated details about a client.locale
- Current users locale- Returns:
- Client id if success or an error message if there was an error during the update
-
deleteClient
@DeleteMapping @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public void deleteClient(@RequestParam java.lang.Long id)
Delete a client- Parameters:
id
- identifier for a client to delete
-
regenerateClientSecret
@PutMapping("/secret") @PreAuthorize("hasRole(\'ROLE_ADMIN\')") public void regenerateClientSecret(@RequestParam java.lang.Long id)
Create a secret for a client- Parameters:
id
- identifier for the client to update.
-
-