diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java index ff2efa703cde49dcc6c4632dccef9f9f4e317320..0ec86114c659506aeb3777a1b891593b0a6e37a8 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java +++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommand.java @@ -92,8 +92,7 @@ class UploadingCommand implements IDataSetCommand { } - public void finished(boolean successful, List<String> warningMessages, - List<Throwable> exceptions) + public void finished(boolean successful) { if (successful) { @@ -105,21 +104,22 @@ class UploadingCommand implements IDataSetCommand { operationLog.warn("Uploading of zip file " + zipFile + " has been aborted or failed."); - for (String warningMessage : warningMessages) - { - operationLog.warn(warningMessage); - - } - for (Throwable throwable : exceptions) - { - notificationLog.error("An error occured during uploading of zip file " - + zipFile + ".", throwable); - } sendEMail("Uploading of zip file " + zipFile.getName() + " with requested data sets failed."); } } + public void exceptionOccured(Throwable throwable) + { + notificationLog.error("An error occured during uploading of zip file " + zipFile + ".", + throwable); + } + + public void warningOccured(String warningMessage) + { + operationLog.warn(warningMessage); + } + } private static final class MetaDataBuilder diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommandTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommandTest.java index d424d19cc85f5b250b78f088a95c9ec1c371231d..8924fd8e0f4a54be6c0bbafa26af96cdf307477f 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommandTest.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/dss/generic/server/UploadingCommandTest.java @@ -300,8 +300,7 @@ public class UploadingCommandTest extends AssertJUnit { public Object invoke(Invocation invocation) throws Throwable { - listener[0].finished(true, Collections.<String> emptyList(), - Collections.<Throwable> emptyList()); + listener[0].finished(true); return null; } }); @@ -357,8 +356,7 @@ public class UploadingCommandTest extends AssertJUnit { public Object invoke(Invocation invocation) throws Throwable { - listener[0].finished(true, Collections.<String> emptyList(), - Collections.<Throwable> emptyList()); + listener[0].finished(true); return null; } }); @@ -388,13 +386,13 @@ public class UploadingCommandTest extends AssertJUnit { one(factory).createCIFEXComponent(); will(returnValue(cifex)); - + one(cifex).login(uploadContextNoPasswordNotAuthenticated.getUserID(), uploadContextNoPasswordNotAuthenticated.getPassword()); will(throwException(new AuthorizationFailureException("forget it!"))); } }); - + logRecorder.resetLogContent(); commandAdminSessionNotAuthenticated.execute(STORE); } finally @@ -452,8 +450,7 @@ public class UploadingCommandTest extends AssertJUnit { public Object invoke(Invocation invocation) throws Throwable { - listener[0].finished(false, Collections.<String> emptyList(), - Collections.<Throwable> emptyList()); + listener[0].finished(false); return null; } });