From b867b6c22022cc8bbbba1273c7e1a26e9dd4d900 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 24 Mar 2010 10:38:34 +0000
Subject: [PATCH] [LMS-1453] fixed dependency problems

SVN: 15257
---
 .../ch/systemsx/cisd/etlserver/ETLDaemon.java |  4 +-
 .../openbis/dss/generic/DataStoreServer.java  |  3 +-
 .../AbstractArchiverProcessingPlugin.java     |  2 +
 .../standard/IDataSetStatusUpdater.java       | 35 --------------
 .../QueueingDataSetStatusUpdaterService.java  | 48 ++++++++++++++-----
 .../dto}/DataSetCodeWithStatus.java           |  2 +-
 6 files changed, 42 insertions(+), 52 deletions(-)
 delete mode 100644 datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IDataSetStatusUpdater.java
 rename datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/{server/plugins/standard => shared}/QueueingDataSetStatusUpdaterService.java (89%)
 rename datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/{server/plugins/standard => shared/dto}/DataSetCodeWithStatus.java (95%)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/ETLDaemon.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/ETLDaemon.java
index 297c4683c72..5e5304dff65 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/ETLDaemon.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/ETLDaemon.java
@@ -61,10 +61,10 @@ import ch.systemsx.cisd.common.utilities.SystemExit;
 import ch.systemsx.cisd.etlserver.validation.DataSetValidator;
 import ch.systemsx.cisd.etlserver.validation.IDataSetValidator;
 import ch.systemsx.cisd.openbis.dss.BuildAndEnvironmentInfo;
-import ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.DataSetCodeWithStatus;
-import ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.QueueingDataSetStatusUpdaterService;
 import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
+import ch.systemsx.cisd.openbis.dss.generic.shared.QueueingDataSetStatusUpdaterService;
 import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider;
+import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetCodeWithStatus;
 import ch.systemsx.cisd.openbis.dss.generic.shared.utils.PropertyParametersUtil;
 import ch.systemsx.cisd.openbis.generic.shared.IServer;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance;
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/DataStoreServer.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/DataStoreServer.java
index 2b9e794e379..9417b8aefa0 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/DataStoreServer.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/DataStoreServer.java
@@ -26,7 +26,7 @@ import ch.systemsx.cisd.common.logging.LogFactory;
 import ch.systemsx.cisd.common.logging.LogInitializer;
 import ch.systemsx.cisd.etlserver.ETLDaemon;
 import ch.systemsx.cisd.openbis.dss.generic.server.CommandQueueLister;
-import ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.QueueingDataSetStatusUpdaterService;
+import ch.systemsx.cisd.openbis.dss.generic.shared.QueueingDataSetStatusUpdaterService;
 
 /**
  * Main class starting {@link ch.systemsx.cisd.openbis.dss.generic.server.DataStoreServer},
@@ -89,4 +89,5 @@ public class DataStoreServer
         ch.systemsx.cisd.openbis.dss.generic.server.DataStoreServer.main(args);
         ETLDaemon.main(args);
     }
+
 }
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractArchiverProcessingPlugin.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractArchiverProcessingPlugin.java
index 999ed84f97e..5c46632b3fe 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractArchiverProcessingPlugin.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/AbstractArchiverProcessingPlugin.java
@@ -29,6 +29,8 @@ import ch.systemsx.cisd.common.logging.LogFactory;
 import ch.systemsx.cisd.openbis.dss.generic.server.ProcessDatasetsCommand;
 import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.IArchiverTask;
 import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.ProcessingStatus;
+import ch.systemsx.cisd.openbis.dss.generic.shared.QueueingDataSetStatusUpdaterService;
+import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetCodeWithStatus;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivizationStatus;
 import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription;
 
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IDataSetStatusUpdater.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IDataSetStatusUpdater.java
deleted file mode 100644
index 0ef749a23fa..00000000000
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IDataSetStatusUpdater.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 ETH Zuerich, CISD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
-
-import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivizationStatus;
-
-/**
- * A role that can update data set status.
- * 
- * @author Piotr Buczek
- */
-public interface IDataSetStatusUpdater
-{
-    /**
-     * Updates status of data set with given code.
-     * 
-     * @param dataSetCode code of data set to be updated
-     * @param newStatus status to be set
-     */
-    public void updateDataSetStatus(String dataSetCode, DataSetArchivizationStatus newStatus);
-}
\ No newline at end of file
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/QueueingDataSetStatusUpdaterService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/QueueingDataSetStatusUpdaterService.java
similarity index 89%
rename from datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/QueueingDataSetStatusUpdaterService.java
rename to datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/QueueingDataSetStatusUpdaterService.java
index 64fcd966ece..b6daff9bcfa 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/QueueingDataSetStatusUpdaterService.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/QueueingDataSetStatusUpdaterService.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
+package ch.systemsx.cisd.openbis.dss.generic.shared;
 
 import java.io.File;
 import java.util.List;
@@ -31,7 +31,7 @@ import ch.systemsx.cisd.common.collections.RecordBasedQueuePersister;
 import ch.systemsx.cisd.common.filesystem.ICloseable;
 import ch.systemsx.cisd.common.logging.LogCategory;
 import ch.systemsx.cisd.common.logging.LogFactory;
-import ch.systemsx.cisd.openbis.dss.generic.shared.ServiceProvider;
+import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetCodeWithStatus;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetArchivizationStatus;
 
 /**
@@ -86,17 +86,7 @@ public class QueueingDataSetStatusUpdaterService
      */
     public static synchronized final void start(final File queueFile, TimingParameters parameters)
     {
-        updater = new IDataSetStatusUpdater()
-            {
-                public void updateDataSetStatus(String dataSetCode,
-                        DataSetArchivizationStatus newStatus)
-                {
-                    ServiceProvider.getOpenBISService().updateDataSetStatus(dataSetCode, newStatus);
-                    operationLog
-                            .info("Data Set " + dataSetCode + " changed status to " + newStatus);
-                }
-
-            };
+        updater = createDataSetStatusUpdater();
         final PersistentExtendedBlockingQueueDecorator<DataSetCodeWithStatus> persistentQueue =
                 ExtendedBlockingQueueFactory.createPersistRecordBased(queueFile,
                         INITIAL_RECORD_SIZE);
@@ -113,6 +103,7 @@ public class QueueingDataSetStatusUpdaterService
                             final DataSetCodeWithStatus dataSet = queue.peekWait();
                             updater.updateDataSetStatus(dataSet.getDataSetCode(), dataSet
                                     .getStatus());
+                            Thread.sleep(10000);
                             // Note: this is the only consumer of this queue.
                             queue.take();
                         }
@@ -129,6 +120,21 @@ public class QueueingDataSetStatusUpdaterService
         thread.start();
     }
 
+    private static IDataSetStatusUpdater createDataSetStatusUpdater()
+    {
+        return new IDataSetStatusUpdater()
+            {
+                public void updateDataSetStatus(String dataSetCode,
+                        DataSetArchivizationStatus newStatus)
+                {
+                    ServiceProvider.getOpenBISService().updateDataSetStatus(dataSetCode, newStatus);
+                    operationLog
+                            .info("Data Set " + dataSetCode + " changed status to " + newStatus);
+                }
+
+            };
+    }
+
     /**
      * Schedules update of given data set. If operation fails the updating thread will exit.
      */
@@ -211,4 +217,20 @@ public class QueueingDataSetStatusUpdaterService
         // Cannot be instantiated.
     }
 
+    /**
+     * A role that can update data set status.
+     * 
+     * @author Piotr Buczek
+     */
+    public interface IDataSetStatusUpdater
+    {
+        /**
+         * Updates status of data set with given code.
+         * 
+         * @param dataSetCode code of data set to be updated
+         * @param newStatus status to be set
+         */
+        public void updateDataSetStatus(String dataSetCode, DataSetArchivizationStatus newStatus);
+    }
+
 }
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DataSetCodeWithStatus.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/dto/DataSetCodeWithStatus.java
similarity index 95%
rename from datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DataSetCodeWithStatus.java
rename to datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/dto/DataSetCodeWithStatus.java
index d16e8138e4e..d50ee66faf5 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/DataSetCodeWithStatus.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/dto/DataSetCodeWithStatus.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard;
+package ch.systemsx.cisd.openbis.dss.generic.shared.dto;
 
 import java.io.Serializable;
 
-- 
GitLab