]> 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 04:03:11 +0000 (21:03 -0700)
committerRichard Millet <remillet@yahoo.com>
Tue, 25 Aug 2020 04:03:11 +0000 (21:03 -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
services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/TestBatchJob.java

index 5397df703eef79df0cd9c9e1a05a2374364b74d7..fbf2a7a5c00e39581567cd09581fc370a12ebcf5 100644 (file)
@@ -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);
        }
-
 }
index 4ceaefbe1cc7a299a1a2d65cca9de42599b76019..9f279cef47ccd78b74554c8579bcf73c6dde91ad 100644 (file)
@@ -69,15 +69,6 @@ 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());
-               throw new java.lang.UnsupportedOperationException(errMsg);
-       }
-
        protected String getFieldXml(Map<String, String> fields, String fieldName) {
                return getFieldXml(fieldName, fields.get(fieldName));
        }
index a6979ae43002af7fb4983dc00cc9feee9b638a2d..bb2a0d8daf757b7b87832794fababe10ca8247f0 100644 (file)
@@ -300,7 +300,7 @@ public class BatchDocumentModelHandler extends NuxeoDocumentModelHandler<BatchCo
                                batchInstance.run(batchCommon);
                        } catch (UnsupportedOperationException t) {
                                // Support for run() will be deprecated in a future release.  See DRYD-878
-                               logger.debug(t.getMessage());
+                               logger.info(t.getMessage());
                                batchInstance.run();
                        }
 
index 58e75f036067c7fc4afcdf1bacc7f40092affca2..1c27139a09b7cf7eb08ed3dabb8d250176a782f3 100644 (file)
@@ -3,7 +3,6 @@ package org.collectionspace.services.batch.nuxeo;
 import java.util.Arrays;
 
 import org.collectionspace.services.batch.AbstractBatchInvocable;
-import org.collectionspace.services.batch.BatchCommon;
 
 public class TestBatchJob extends AbstractBatchInvocable {
 
@@ -16,10 +15,5 @@ public class TestBatchJob extends AbstractBatchInvocable {
        @Override
        public void run() {
                // An empty batch job used just for testing.
-       }
-       
-       @Override
-       public void run(BatchCommon batchCommon) {
-               // An empty batch job used just for testing.
-       }
+       }       
 }