diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDbModifyingAggregationService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDbModifyingAggregationService.java index ac6abcb0b6865c195509f0b822c4aefd120012d5..d32774197876d64f4900d6ec827a70c70082a45c 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDbModifyingAggregationService.java +++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractDbModifyingAggregationService.java @@ -223,14 +223,8 @@ public abstract class AbstractDbModifyingAggregationService<T extends DataSetInf NoOpDelegate delegate = new NoOpDelegate(preStagingUsage); - @SuppressWarnings("unchecked") - IDataSetRegistrationDetailsFactory<T> registrationDetailsFactory = - (IDataSetRegistrationDetailsFactory<T>) new DefaultDataSetRegistrationDetailsFactory( - getRegistratorState(), null); - DataSetRegistrationService<T> service = - new DataSetRegistrationService<T>(this, incoming, registrationDetailsFactory, - cleanUpAction, delegate); + createRegistrationService(incoming, cleanUpAction, delegate); return service; } catch (IOException e) @@ -239,6 +233,23 @@ public abstract class AbstractDbModifyingAggregationService<T extends DataSetInf } } + /** + * Create a registration service using the given parameters. Subclasses may override. + */ + protected DataSetRegistrationService<T> createRegistrationService(DataSetFile incoming, + IDelegatedActionWithResult<Boolean> cleanUpAction, NoOpDelegate delegate) + { + @SuppressWarnings("unchecked") + IDataSetRegistrationDetailsFactory<T> registrationDetailsFactory = + (IDataSetRegistrationDetailsFactory<T>) new DefaultDataSetRegistrationDetailsFactory( + getRegistratorState(), null); + + DataSetRegistrationService<T> service = + new DataSetRegistrationService<T>(this, incoming, registrationDetailsFactory, + cleanUpAction, delegate); + return service; + } + /** * The file the registration infrastructure should treat as the incoming file in the dropbox. */