From fdb1d8a25f00dc3325387d5ba4b22cabec6f4af5 Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Mon, 18 May 2015 10:25:00 +0000
Subject: [PATCH] SSDM-1809 : Share is now configurable on the ingestion
 service properties file

SVN: 33986
---
 .../server/plugins/standard/IngestionService.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IngestionService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IngestionService.java
index 32346a57153..8c9287ff5e8 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IngestionService.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/plugins/standard/IngestionService.java
@@ -75,7 +75,9 @@ public abstract class IngestionService<T extends DataSetInformation> extends Agg
 {
 
     private static final String AGGREGATION_SERVICE_SCRATCH_DIR_NAME = "aggregation-service";
-
+    
+    private static final String AGGREGATION_SERVICE_SHARE_ID = "share-id";
+    
     private static final long serialVersionUID = 1L;
 
     private static IMailClient getMailClientFromProperties(Properties dssProperties)
@@ -115,6 +117,8 @@ public abstract class IngestionService<T extends DataSetInformation> extends Agg
                 getMailClientFromProperties(dssProperties));
     }
 
+    private String shareId;
+    
     /**
      * Internal constructor that allows explicit configuration of all services. Used in testing.
      * 
@@ -131,6 +135,7 @@ public abstract class IngestionService<T extends DataSetInformation> extends Agg
         this.dssProperties = dssProperties;
         this.openBisService = openBisService;
         this.mailClient = mailClient;
+        this.shareId = dssProperties.getProperty(AGGREGATION_SERVICE_SHARE_ID);
     }
 
     @Override
@@ -373,8 +378,11 @@ public abstract class IngestionService<T extends DataSetInformation> extends Agg
 
     protected String getShareId()
     {
-        // hard coded to share 1 -- could be made configurable in the future.
-        return "1";
+        if(this.shareId != null) {
+            return this.shareId;
+        } else {
+            return "1";
+        }
     }
 
     protected boolean shouldNotifySuccessfulRegistration()
-- 
GitLab