@Test @WithMockUser(authorities = { "DELETE_TSP" }) public void deleteConfiguredTimestampingService() { ResponseEntity<Void> response = systemApiController .deleteConfiguredTimestampingService(TestUtils.createTimestampingService(TSA_1_URL, TSA_1_NAME)); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); }
@Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) public ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService) { try { systemService.deleteConfiguredTimestampingService(timestampingServiceConverter .convert(timestampingService)); } catch (TimestampingServiceNotFoundException e) { throw new BadRequestException(e); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); }
SystemApiController implements SystemApi { @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) public ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService) { try { systemService.deleteConfiguredTimestampingService(timestampingServiceConverter .convert(timestampingService)); } catch (TimestampingServiceNotFoundException e) { throw new BadRequestException(e); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } }
SystemApiController implements SystemApi { @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) public ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService) { try { systemService.deleteConfiguredTimestampingService(timestampingServiceConverter .convert(timestampingService)); } catch (TimestampingServiceNotFoundException e) { throw new BadRequestException(e); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  SystemApiController(InternalTlsCertificateService internalTlsCertificateService,
            CertificateDetailsConverter certificateDetailsConverter, SystemService systemService,
            TimestampingServiceConverter timestampingServiceConverter, AnchorConverter anchorConverter,
            VersionService versionService, VersionConverter versionConverter, CsrFilenameCreator csrFilenameCreator,
            AuditDataHelper auditDataHelper); }
SystemApiController implements SystemApi { @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) public ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService) { try { systemService.deleteConfiguredTimestampingService(timestampingServiceConverter .convert(timestampingService)); } catch (TimestampingServiceNotFoundException e) { throw new BadRequestException(e); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  SystemApiController(InternalTlsCertificateService internalTlsCertificateService,
            CertificateDetailsConverter certificateDetailsConverter, SystemService systemService,
            TimestampingServiceConverter timestampingServiceConverter, AnchorConverter anchorConverter,
            VersionService versionService, VersionConverter versionConverter, CsrFilenameCreator csrFilenameCreator,
            AuditDataHelper auditDataHelper); @Override @PreAuthorize("hasAuthority('EXPORT_INTERNAL_TLS_CERT')") ResponseEntity<Resource> downloadSystemCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_INTERNAL_TLS_CERT')") ResponseEntity<CertificateDetails> getSystemCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_VERSION')") ResponseEntity<Version> systemVersion(); @Override @PreAuthorize("hasAuthority('GENERATE_INTERNAL_TLS_KEY_CERT')") @AuditEventMethod(event = GENERATE_INTERNAL_TLS_KEY_CERT) ResponseEntity<Void> generateSystemTlsKeyAndCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_TSPS')") ResponseEntity<List<TimestampingService>> getConfiguredTimestampingServices(); @Override @PreAuthorize("hasAuthority('ADD_TSP')") @AuditEventMethod(event = ADD_TSP) ResponseEntity<TimestampingService> addConfiguredTimestampingService(
            TimestampingService timestampingServiceToAdd); @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService); @Override @PreAuthorize("hasAuthority('GENERATE_INTERNAL_TLS_CSR')") @AuditEventMethod(event = GENERATE_INTERNAL_TLS_CSR) ResponseEntity<Resource> generateSystemCertificateRequest(DistinguishedName distinguishedName); @Override @PreAuthorize("hasAuthority('IMPORT_INTERNAL_TLS_CERT')") @AuditEventMethod(event = IMPORT_INTERNAL_TLS_CERT) ResponseEntity<CertificateDetails> importSystemCertificate(Resource certificateResource); @Override @PreAuthorize("hasAuthority('VIEW_ANCHOR')") ResponseEntity<Anchor> getAnchor(); @Override @PreAuthorize("hasAuthority('DOWNLOAD_ANCHOR')") ResponseEntity<Resource> downloadAnchor(); @Override @PreAuthorize("hasAuthority('UPLOAD_ANCHOR')") @AuditEventMethod(event = UPLOAD_ANCHOR) ResponseEntity<Void> replaceAnchor(Resource anchorResource); @Override @PreAuthorize("hasAuthority('UPLOAD_ANCHOR')") ResponseEntity<Anchor> previewAnchor(Boolean verifyInstance, Resource anchorResource); @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") @AuditEventMethod(event = INIT_ANCHOR) ResponseEntity<Void> uploadInitialAnchor(Resource anchorResource); }
SystemApiController implements SystemApi { @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) public ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService) { try { systemService.deleteConfiguredTimestampingService(timestampingServiceConverter .convert(timestampingService)); } catch (TimestampingServiceNotFoundException e) { throw new BadRequestException(e); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Autowired  SystemApiController(InternalTlsCertificateService internalTlsCertificateService,
            CertificateDetailsConverter certificateDetailsConverter, SystemService systemService,
            TimestampingServiceConverter timestampingServiceConverter, AnchorConverter anchorConverter,
            VersionService versionService, VersionConverter versionConverter, CsrFilenameCreator csrFilenameCreator,
            AuditDataHelper auditDataHelper); @Override @PreAuthorize("hasAuthority('EXPORT_INTERNAL_TLS_CERT')") ResponseEntity<Resource> downloadSystemCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_INTERNAL_TLS_CERT')") ResponseEntity<CertificateDetails> getSystemCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_VERSION')") ResponseEntity<Version> systemVersion(); @Override @PreAuthorize("hasAuthority('GENERATE_INTERNAL_TLS_KEY_CERT')") @AuditEventMethod(event = GENERATE_INTERNAL_TLS_KEY_CERT) ResponseEntity<Void> generateSystemTlsKeyAndCertificate(); @Override @PreAuthorize("hasAuthority('VIEW_TSPS')") ResponseEntity<List<TimestampingService>> getConfiguredTimestampingServices(); @Override @PreAuthorize("hasAuthority('ADD_TSP')") @AuditEventMethod(event = ADD_TSP) ResponseEntity<TimestampingService> addConfiguredTimestampingService(
            TimestampingService timestampingServiceToAdd); @Override @PreAuthorize("hasAuthority('DELETE_TSP')") @AuditEventMethod(event = DELETE_TSP) ResponseEntity<Void> deleteConfiguredTimestampingService(TimestampingService timestampingService); @Override @PreAuthorize("hasAuthority('GENERATE_INTERNAL_TLS_CSR')") @AuditEventMethod(event = GENERATE_INTERNAL_TLS_CSR) ResponseEntity<Resource> generateSystemCertificateRequest(DistinguishedName distinguishedName); @Override @PreAuthorize("hasAuthority('IMPORT_INTERNAL_TLS_CERT')") @AuditEventMethod(event = IMPORT_INTERNAL_TLS_CERT) ResponseEntity<CertificateDetails> importSystemCertificate(Resource certificateResource); @Override @PreAuthorize("hasAuthority('VIEW_ANCHOR')") ResponseEntity<Anchor> getAnchor(); @Override @PreAuthorize("hasAuthority('DOWNLOAD_ANCHOR')") ResponseEntity<Resource> downloadAnchor(); @Override @PreAuthorize("hasAuthority('UPLOAD_ANCHOR')") @AuditEventMethod(event = UPLOAD_ANCHOR) ResponseEntity<Void> replaceAnchor(Resource anchorResource); @Override @PreAuthorize("hasAuthority('UPLOAD_ANCHOR')") ResponseEntity<Anchor> previewAnchor(Boolean verifyInstance, Resource anchorResource); @Override @PreAuthorize("hasAuthority('INIT_CONFIG')") @AuditEventMethod(event = INIT_ANCHOR) ResponseEntity<Void> uploadInitialAnchor(Resource anchorResource); static final String INTERNAL_KEY_CERT_INTERRUPTED; static final String ANCHOR_FILE_NOT_FOUND; }