]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-878: Added support for older run method to prevent a required version bump.
authorRichard Millet <remillet@yahoo.com>
Tue, 25 Aug 2020 02:07:47 +0000 (19:07 -0700)
committerRichard Millet <remillet@yahoo.com>
Tue, 25 Aug 2020 02:07:47 +0000 (19:07 -0700)
services/batch/service/src/main/java/org/collectionspace/services/batch/AbstractBatchInvocable.java
services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/AbstractBatchJob.java
services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/BatchDocumentModelHandler.java

index 961e806fc1dd8ae458a804362c07dcd78f64e45d..5397df703eef79df0cd9c9e1a05a2374364b74d7 100644 (file)
@@ -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.");
+       }
+
 }
index ef24d0e6f56f135ecfd5b97ec963e44a8c3a382f..4ceaefbe1cc7a299a1a2d65cca9de42599b76019 100644 (file)
@@ -69,6 +69,9 @@ public abstract class AbstractBatchJob extends AbstractBatchInvocable {
         return (Set<T>) 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());
index 20fb1a55ee9712f15f8c5cbe9802245bef3654a8..a6979ae43002af7fb4983dc00cc9feee9b638a2d 100644 (file)
@@ -296,7 +296,14 @@ public class BatchDocumentModelHandler extends NuxeoDocumentModelHandler<BatchCo
                                }
                        }
 
-                       batchInstance.run(batchCommon);
+                       try {
+                               batchInstance.run(batchCommon);
+                       } catch (UnsupportedOperationException t) {
+                               // Support for run() will be deprecated in a future release.  See DRYD-878
+                               logger.debug(t.getMessage());
+                               batchInstance.run();
+                       }
+
                        int status = batchInstance.getCompletionStatus();
                        if (status == Invocable.STATUS_ERROR) {
                                InvocationError error = batchInstance.getErrorInfo();