From b23ff0e5ff8cf68c53ec80d03464dd06900e4c29 Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Mon, 11 Mar 2013 09:49:56 +0000
Subject: [PATCH] SP-543 BIS-355 add method to list sample identifiers

SVN: 28575
---
 .../dss/generic/server/EncapsulatedOpenBISService.java |  8 ++++++++
 .../generic/shared/IEncapsulatedOpenBISService.java    | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/EncapsulatedOpenBISService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/EncapsulatedOpenBISService.java
index dfce62c935e..97eb8f7cfdd 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/EncapsulatedOpenBISService.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/server/EncapsulatedOpenBISService.java
@@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.dss.generic.server;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.log4j.Logger;
@@ -256,6 +257,13 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
         return service.tryGetSampleIdentifier(session.getSessionToken(), samplePermID);
     }
 
+    @Override
+    public Map<String, SampleIdentifier> listSampleIdentifiers(List<String> samplePermID)
+            throws UserFailureException
+    {
+        return service.listSamplesByPermId(session.getSessionToken(), samplePermID);
+    }
+
     @Override
     public ExperimentType getExperimentType(String experimentTypeCode) throws UserFailureException
     {
diff --git a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/IEncapsulatedOpenBISService.java b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/IEncapsulatedOpenBISService.java
index 06d1109d65c..d3cf704bdb1 100644
--- a/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/IEncapsulatedOpenBISService.java
+++ b/datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/IEncapsulatedOpenBISService.java
@@ -18,6 +18,7 @@ package ch.systemsx.cisd.openbis.dss.generic.shared;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 import ch.systemsx.cisd.common.exceptions.UserFailureException;
 import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
@@ -133,6 +134,15 @@ public interface IEncapsulatedOpenBISService extends IEncapsulatedBasicOpenBISSe
     @ManagedAuthentication
     public SampleIdentifier tryGetSampleIdentifier(String samplePermID) throws UserFailureException;
 
+    /**
+     * Tries to get the sample identifier for the sample with specified permanent ID.
+     * 
+     * @return <code>null</code> if nothing found.
+     */
+    @ManagedAuthentication
+    public Map<String, SampleIdentifier> listSampleIdentifiers(List<String> samplePermID)
+            throws UserFailureException;
+
     /**
      * For given (@code name} and {@code ownerId} returns the corresponding {@link Metaproject}
      */
-- 
GitLab