@GET @Path("modelHistory") @Produces(MediaType.APPLICATION_JSON) public List<ModelProvenanceElement> getModelHistory() { ServiceTemplateId serviceTemplateId = new ServiceTemplateId(new QName(provenanceId)); String qNameWithComponentVersionOnly = VersionUtils.getQNameWithComponentVersionOnly(serviceTemplateId); try { return getAccountabilityManager() .getHistory(qNameWithComponentVersionOnly) .exceptionally(error -> null) .get(); } catch (InterruptedException | ExecutionException | AccountabilityException e) { LOGGER.error("Cannot get history of model. Reason: {}", e.getMessage()); throw createException(e); } }
@GET @Path("fileHistory") @Produces(MediaType.APPLICATION_JSON) public List<FileProvenanceElement> getFileHistory(@QueryParam("fileId") String fileId) { ServiceTemplateId serviceTemplateId = new ServiceTemplateId(new QName(provenanceId)); String qNameWithComponentVersionOnly = VersionUtils.getQNameWithComponentVersionOnly(serviceTemplateId); Objects.requireNonNull(fileId); String fileIdDecoded = Util.URLdecode(fileId); try { return getAccountabilityManager() .getHistory(qNameWithComponentVersionOnly, fileIdDecoded) .exceptionally(error -> null) .get(); } catch (InterruptedException | ExecutionException | AccountabilityException e) { LOGGER.error("Cannot history of file {}. Reason: {}", fileId, e.getMessage()); throw createException(e); } }