From: Richard Millet Date: Tue, 25 Aug 2020 04:03:11 +0000 (-0700) Subject: DRYD-878: Added support for older run method to prevent a required version bump. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=d970b8bb138e6ee2b3aa4a427444573565f0550d;p=tmp%2Fjakarta-migration.git DRYD-878: Added support for older run method to prevent a required version bump. --- 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 5397df703..fbf2a7a5c 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,10 +235,13 @@ public abstract class AbstractBatchInvocable implements BatchInvocable { @Override public abstract void run(); - + + /** + * Subclasses should override this method. See DRYD-878 + */ @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."); + String errMsg = String.format("%s class does not support run(BatchCommon batchCommon) method.", getClass().getName()); + throw new java.lang.UnsupportedOperationException(errMsg); } - } 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 4ceaefbe1..9f279cef4 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,15 +69,6 @@ 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()); - throw new java.lang.UnsupportedOperationException(errMsg); - } - protected String getFieldXml(Map fields, String fieldName) { return getFieldXml(fieldName, fields.get(fieldName)); } 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 a6979ae43..bb2a0d8da 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 @@ -300,7 +300,7 @@ public class BatchDocumentModelHandler extends NuxeoDocumentModelHandler