Skip to content
Snippets Groups Projects
Commit 2f6f494e authored by felmer's avatar felmer
Browse files

LMS-1219 Extends IEncapsulatedOpenBISService with listSamples method

SVN: 12875
parent f717f6b7
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample;
import ch.systemsx.cisd.openbis.generic.shared.dto.DataStoreServerInfo;
import ch.systemsx.cisd.openbis.generic.shared.dto.DatastoreServiceDescriptions;
......@@ -182,6 +183,11 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
{
return service.tryToGetExperiment(sessionToken, experimentIdentifier);
}
private List<Sample> primListSamples(ListSampleCriteria criteria)
{
return service.listSamples(sessionToken, criteria);
}
private final Sample primTryGetSampleWithExperiment(final SampleIdentifier sampleIdentifier)
{
......@@ -238,6 +244,21 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
}
}
synchronized public List<Sample> listSamples(ListSampleCriteria criteria)
{
assert criteria != null : "Unspecifed criteria.";
checkSessionToken();
try
{
return primListSamples(criteria);
} catch (InvalidSessionException ex)
{
authenticate();
return primListSamples(criteria);
}
}
synchronized public final Sample tryGetSampleWithExperiment(
final SampleIdentifier sampleIdentifier)
{
......
......@@ -26,6 +26,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ListSampleCriteria;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample;
import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria;
import ch.systemsx.cisd.openbis.generic.shared.dto.NewExternalData;
......@@ -54,6 +55,11 @@ public interface IEncapsulatedOpenBISService
public Experiment tryToGetExperiment(ExperimentIdentifier experimentIdentifier)
throws UserFailureException;
/**
* Gets all sample in accordance to the specified criteria.
*/
public List<Sample> listSamples(final ListSampleCriteria criteria) throws UserFailureException;
/**
* Gets a sample with the specified identifier. Sample is enriched with properties and the
* experiment with properties.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment