Class ClientsAjaxController


  • @RestController
    @RequestMapping("/ajax/clients")
    public class ClientsAjaxController
    extends java.lang.Object
    Controller to handle ajax request for IRIDA Clients.
    • 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 exists
        locale - 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 create
        locale - 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.