Class CertificateResource


  • @RestController
    @RequestMapping("/api")
    public class CertificateResource
    extends Object
    REST controller for managing Certificate.
    • Constructor Detail

      • CertificateResource

        public CertificateResource​(CertificateService certificateService)
    • Method Detail

      • createCertificate

        @PostMapping("/certificates")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<Certificate> createCertificate​(@Valid @RequestBody
                                                                                      @Valid Certificate certificate)
                                                                               throws URISyntaxException
        POST /certificates : Create a new certificate.
        Parameters:
        certificate - the certificate to create.
        Returns:
        the ResponseEntity with status 201 (Created) and with body the new certificate, or with status 400 (Bad Request) if the certificate has already an ID.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • updateCertificate

        @PutMapping("/certificates")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<Certificate> updateCertificate​(@Valid @RequestBody
                                                                                      @Valid Certificate certificate)
                                                                               throws URISyntaxException
        PUT /certificates : Updates an existing certificate.
        Parameters:
        certificate - the certificate to update.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the updated certificate, or with status 400 (Bad Request) if the certificate is not valid, or with status 500 (Internal Server Error) if the certificate couldn't be updated.
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • getAllCertificates

        @GetMapping("/certificates")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<List<Certificate>> getAllCertificates​(org.springframework.data.domain.Pageable pageable)
        GET /certificates : get all the certificates.
        Parameters:
        pageable - the pagination information.
        Returns:
        the ResponseEntity with status 200 (OK) and the list of certificates in body.
      • getCertificate

        @GetMapping("/certificates/{id}")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<Certificate> getCertificate​(@PathVariable
                                                                                   Long id)
        GET /certificates/:id : get the "id" certificate.
        Parameters:
        id - the id of the certificate to retrieve.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the certificate, or with status 404 (Not Found).
      • deleteCertificate

        @DeleteMapping("/certificates/{id}")
        @PreAuthorize("hasRole(\"ROLE_ADMIN\")")
        public org.springframework.http.ResponseEntity<Void> deleteCertificate​(@PathVariable
                                                                               Long id)
        DELETE /certificates/:id : delete the "id" certificate.
        Parameters:
        id - the id of the certificate to delete.
        Returns:
        the ResponseEntity with status 204 (NO_CONTENT).