From 6833cf5228a25389926148526a339f944e4214ce Mon Sep 17 00:00:00 2001 From: grapigeau Date: Tue, 10 Sep 2024 08:53:07 -0400 Subject: [PATCH] cleanup chandges --- plugin-nabu/pom.xml | 6 -- .../gsi/shesmu/nabu/ArchiveCaseAction.java | 4 -- .../on/oicr/gsi/shesmu/nabu/NabuPlugin.java | 61 ------------------- 3 files changed, 71 deletions(-) diff --git a/plugin-nabu/pom.xml b/plugin-nabu/pom.xml index 2306d3079..020a0b06b 100644 --- a/plugin-nabu/pom.xml +++ b/plugin-nabu/pom.xml @@ -26,12 +26,6 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - - ca.on.oicr.gsi - shesmu-plugin-guanyin - 1.34.3-SNAPSHOT - compile - shesmu-plugin-nabu diff --git a/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/ArchiveCaseAction.java b/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/ArchiveCaseAction.java index fcfc06f0d..7aadc718a 100644 --- a/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/ArchiveCaseAction.java +++ b/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/ArchiveCaseAction.java @@ -22,8 +22,6 @@ public class ArchiveCaseAction extends JsonParameterisedAction { private final Definer owner; - private final ObjectNode parameters; - private final ObjectNode rootParameters = MAPPER.createObjectNode(); static final ObjectMapper MAPPER = new ObjectMapper(); private List errors = List.of(); public String caseId; @@ -48,7 +46,6 @@ public class ArchiveCaseAction extends JsonParameterisedAction { public ArchiveCaseAction(Definer owner) { super("nabu-plugin"); this.owner = owner; - parameters = rootParameters.putObject("parameters"); } @ActionParameter @@ -245,7 +242,6 @@ public ObjectNode toJson(ObjectMapper mapper) { limsIds.forEach(node.putArray("limsIds")::add); workflowRunIdsForOffsiteArchive.forEach(node.putArray("workflowRunIdsForOffsiteArchive")::add); workflowRunIdsForVidarrArchival.forEach(node.putArray("workflowRunIdsForVidarrArchival")::add); - node.set("parameters", parameters); return node; } } diff --git a/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/NabuPlugin.java b/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/NabuPlugin.java index c405f9079..32d8790d8 100644 --- a/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/NabuPlugin.java +++ b/plugin-nabu/src/main/java/ca/on/oicr/gsi/shesmu/nabu/NabuPlugin.java @@ -61,67 +61,6 @@ private Stream caseArchives(String baseUrl) : Optional.of(ca.getWorkflowRunIdsForVidarrArchival()))); } - // private Stream newCaseArchive(String baseUrl, NabuCaseArchiveDto - // cArchive) - // throws IOException, InterruptedException { - // - // final var builder = HttpRequest.newBuilder(URI.create(baseUrl + "/case")); - // final var wfrIdsForOffsiteArchiveString = - // cArchive.getWorkflowRunIdsForOffsiteArchive().stream() - // .collect(Collectors.joining("','", "'", "'")); - // final var wfrIdsForVidarrArchivalString = - // cArchive.getWorkflowRunIdsForVidarrArchival().stream() - // .collect(Collectors.joining("','", "'", "'")); - // final var request = - // String.format( - // "{ \"caseIdentifier\":%s, \"requisitionId\":%s, \"limsIds\":%s, - // \"workflowRunIdsForOffsiteArchive\":[%s]," - // + " \"workflowRunIdsForVidarrArchival\":[%s]}", - // cArchive.getCaseIdentifier(), - // cArchive.getRequisitionId(), - // cArchive.getLimsIds(), - // wfrIdsForOffsiteArchiveString, - // wfrIdsForVidarrArchivalString); - // final var response = - // HTTP_CLIENT.send( - // builder - // .header("Content-Type", "application/json") - // .POST(BodyPublishers.ofString(request)) - // .build(), - // new JsonListBodyHandler<>(MAPPER, NabuCaseArchiveDto.class)); - // if (response.statusCode() / 100 != 2) { - // return response - // .body() - // .get() - // .map( - // ca -> - // new NabuCaseArchiveValue( - // ca.getCaseFilesUnloaded() == null - // ? Optional.empty() - // : Optional.of(Instant.parse(ca.getCaseFilesUnloaded())), - // ca.getCaseIdentifier(), - // Optional.ofNullable(ca.getCommvaultBackupJobId()), - // Instant.parse(ca.getCreated()), - // ca.getFilesCopiedToOffsiteArchiveStagingDir() == null - // ? Optional.empty() - // : Optional.of( - // Instant.parse(ca.getFilesCopiedToOffsiteArchiveStagingDir())), - // ca.getFilesLoadedIntoVidarrArchival() == null - // ? Optional.empty() - // : - // Optional.of(Instant.parse(ca.getFilesLoadedIntoVidarrArchival())), - // ca.getLimsIds(), - // Instant.parse(ca.getModified()), - // ca.getRequisitionId(), - // ca.getWorkflowRunIdsForOffsiteArchive(), - // ca.getWorkflowRunIdsForVidarrArchival() == null - // ? Optional.empty() - // : Optional.of(ca.getWorkflowRunIdsForVidarrArchival()))); - // } else { - // throw new IOException(); - // } - // } - @Override protected Stream fetch(Instant lastUpdated) throws Exception { if (config.isEmpty()) {