@Test public void deleteConfiguredTimestampingService() throws TimestampingServiceNotFoundException { TspType tspType = TestUtils.createTspType(TSA_1_URL, TSA_1_NAME); assertEquals(1, serverConfService.getConfiguredTimestampingServices().size()); systemService.deleteConfiguredTimestampingService(tspType); assertEquals(0, serverConfService.getConfiguredTimestampingServices().size()); }
public void deleteConfiguredTimestampingService(TspType tspTypeToDelete) throws TimestampingServiceNotFoundException { auditLog(tspTypeToDelete); List<TspType> configuredTimestampingServices = getConfiguredTimestampingServices(); Optional<TspType> delete = configuredTimestampingServices.stream() .filter(tsp -> tspTypeToDelete.getName().equals(tsp.getName()) && tspTypeToDelete.getUrl().equals(tsp.getUrl())) .findFirst(); if (!delete.isPresent()) { throw new TimestampingServiceNotFoundException(getExceptionMessage(tspTypeToDelete.getName(), tspTypeToDelete.getUrl(), "not found") ); } configuredTimestampingServices.remove(delete.get()); }
SystemService { public void deleteConfiguredTimestampingService(TspType tspTypeToDelete) throws TimestampingServiceNotFoundException { auditLog(tspTypeToDelete); List<TspType> configuredTimestampingServices = getConfiguredTimestampingServices(); Optional<TspType> delete = configuredTimestampingServices.stream() .filter(tsp -> tspTypeToDelete.getName().equals(tsp.getName()) && tspTypeToDelete.getUrl().equals(tsp.getUrl())) .findFirst(); if (!delete.isPresent()) { throw new TimestampingServiceNotFoundException(getExceptionMessage(tspTypeToDelete.getName(), tspTypeToDelete.getUrl(), "not found") ); } configuredTimestampingServices.remove(delete.get()); } }
SystemService { public void deleteConfiguredTimestampingService(TspType tspTypeToDelete) throws TimestampingServiceNotFoundException { auditLog(tspTypeToDelete); List<TspType> configuredTimestampingServices = getConfiguredTimestampingServices(); Optional<TspType> delete = configuredTimestampingServices.stream() .filter(tsp -> tspTypeToDelete.getName().equals(tsp.getName()) && tspTypeToDelete.getUrl().equals(tsp.getUrl())) .findFirst(); if (!delete.isPresent()) { throw new TimestampingServiceNotFoundException(getExceptionMessage(tspTypeToDelete.getName(), tspTypeToDelete.getUrl(), "not found") ); } configuredTimestampingServices.remove(delete.get()); } @Autowired  SystemService(GlobalConfService globalConfService, ServerConfService serverConfService,
            AnchorRepository anchorRepository, ConfigurationVerifier configurationVerifier,
            CurrentSecurityServerId currentSecurityServerId,
            AuditDataHelper auditDataHelper); }
SystemService { public void deleteConfiguredTimestampingService(TspType tspTypeToDelete) throws TimestampingServiceNotFoundException { auditLog(tspTypeToDelete); List<TspType> configuredTimestampingServices = getConfiguredTimestampingServices(); Optional<TspType> delete = configuredTimestampingServices.stream() .filter(tsp -> tspTypeToDelete.getName().equals(tsp.getName()) && tspTypeToDelete.getUrl().equals(tsp.getUrl())) .findFirst(); if (!delete.isPresent()) { throw new TimestampingServiceNotFoundException(getExceptionMessage(tspTypeToDelete.getName(), tspTypeToDelete.getUrl(), "not found") ); } configuredTimestampingServices.remove(delete.get()); } @Autowired  SystemService(GlobalConfService globalConfService, ServerConfService serverConfService,
            AnchorRepository anchorRepository, ConfigurationVerifier configurationVerifier,
            CurrentSecurityServerId currentSecurityServerId,
            AuditDataHelper auditDataHelper); List<TspType> getConfiguredTimestampingServices(); void addConfiguredTimestampingService(TspType tspTypeToAdd); void deleteConfiguredTimestampingService(TspType tspTypeToDelete); byte[] generateInternalCsr(String distinguishedName); AnchorFile getAnchorFile(); AnchorFile getAnchorFileFromBytes(byte[] anchorBytes, boolean shouldVerifyAnchorInstance); void uploadInitialAnchor(byte[] anchorBytes); void replaceAnchor(byte[] anchorBytes); boolean isAnchorImported(); byte[] readAnchorFile(); String getAnchorFilenameForDownload(); }
SystemService { public void deleteConfiguredTimestampingService(TspType tspTypeToDelete) throws TimestampingServiceNotFoundException { auditLog(tspTypeToDelete); List<TspType> configuredTimestampingServices = getConfiguredTimestampingServices(); Optional<TspType> delete = configuredTimestampingServices.stream() .filter(tsp -> tspTypeToDelete.getName().equals(tsp.getName()) && tspTypeToDelete.getUrl().equals(tsp.getUrl())) .findFirst(); if (!delete.isPresent()) { throw new TimestampingServiceNotFoundException(getExceptionMessage(tspTypeToDelete.getName(), tspTypeToDelete.getUrl(), "not found") ); } configuredTimestampingServices.remove(delete.get()); } @Autowired  SystemService(GlobalConfService globalConfService, ServerConfService serverConfService,
            AnchorRepository anchorRepository, ConfigurationVerifier configurationVerifier,
            CurrentSecurityServerId currentSecurityServerId,
            AuditDataHelper auditDataHelper); List<TspType> getConfiguredTimestampingServices(); void addConfiguredTimestampingService(TspType tspTypeToAdd); void deleteConfiguredTimestampingService(TspType tspTypeToDelete); byte[] generateInternalCsr(String distinguishedName); AnchorFile getAnchorFile(); AnchorFile getAnchorFileFromBytes(byte[] anchorBytes, boolean shouldVerifyAnchorInstance); void uploadInitialAnchor(byte[] anchorBytes); void replaceAnchor(byte[] anchorBytes); boolean isAnchorImported(); byte[] readAnchorFile(); String getAnchorFilenameForDownload();  }