From 3b46f58903ca709083923a8b70b4bab4e14ef9d2 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Mon, 24 Aug 2020 19:07:47 -0700 Subject: [PATCH] DRYD-878: Added support for older run method to prevent a required version bump. --- .../services/batch/AbstractBatchInvocable.java | 6 ++++++ .../services/batch/nuxeo/AbstractBatchJob.java | 3 +++ .../services/batch/nuxeo/BatchDocumentModelHandler.java | 9 ++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/services/batch/service/src/main/java/org/collectionspace/services/batch/AbstractBatchInvocable.java b/services/batch/service/src/main/java/org/collectionspace/services/batch/AbstractBatchInvocable.java index 961e806fc..5397df703 100644 --- a/services/batch/service/src/main/java/org/collectionspace/services/batch/AbstractBatchInvocable.java +++ b/services/batch/service/src/main/java/org/collectionspace/services/batch/AbstractBatchInvocable.java @@ -235,4 +235,10 @@ public abstract class AbstractBatchInvocable implements BatchInvocable { @Override public abstract void run(); + + @Override + public void run(BatchCommon batchCommon) { + throw new UnsupportedOperationException("This CollectionSpace batch-job/data-update class does not support the 'public void run(BatchCommon batchCommon)' method."); + } + } diff --git a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java index ef24d0e6f..4ceaefbe1 100644 --- a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java +++ b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java @@ -69,6 +69,9 @@ public abstract class AbstractBatchJob extends AbstractBatchInvocable { return (Set) list.stream().collect(Collectors.toSet()); } + /** + * Subclasses should override this method. See DRYD-878 + */ @Override public void run(BatchCommon batchCommon) { String errMsg = String.format("%s class does not support run(BatchCommon batchCommon) method.", getClass().getName()); diff --git a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/BatchDocumentModelHandler.java b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/BatchDocumentModelHandler.java index 20fb1a55e..a6979ae43 100644 --- a/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/BatchDocumentModelHandler.java +++ b/services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/BatchDocumentModelHandler.java @@ -296,7 +296,14 @@ public class BatchDocumentModelHandler extends NuxeoDocumentModelHandler