Skip to content
Snippets Groups Projects
Commit 15cbeb42 authored by felmer's avatar felmer
Browse files

SE-178 extend Service in order to get data set type property types and data sets

SVN: 13958
parent 28fcb414
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,8 @@ import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.PluginTaskProvi
import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.generic.shared.IETLLIMSService;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypeWithVocabularyTerms;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
......@@ -196,9 +198,9 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
return service.tryGetSampleWithExperiment(sessionToken, sampleIdentifier);
}
private void primRegisterSample(NewSample newSample)
private long primRegisterSample(NewSample newSample)
{
service.registerSample(sessionToken, newSample);
return service.registerSample(sessionToken, newSample);
}
private final void primRegisterDataSet(final DataSetInformation dataSetInformation,
......@@ -295,19 +297,47 @@ public final class EncapsulatedOpenBISService implements IEncapsulatedOpenBISSer
return service.getSampleType(sessionToken, sampleTypeCode);
}
}
synchronized public DataSetTypeWithVocabularyTerms getDataSetType(String dataSetTypeCode)
{
checkSessionToken();
try
{
return service.getDataSetType(sessionToken, dataSetTypeCode);
} catch (InvalidSessionException ex)
{
authenticate();
return service.getDataSetType(sessionToken, dataSetTypeCode);
}
}
synchronized public List<ExternalData> listDataSetsBySampleID(long sampleID,
boolean showOnlyDirectlyConnected)
{
checkSessionToken();
TechId id = new TechId(sampleID);
try
{
return service.listDataSetsBySampleID(sessionToken, id, showOnlyDirectlyConnected);
} catch (InvalidSessionException ex)
{
authenticate();
return service.listDataSetsBySampleID(sessionToken, id, showOnlyDirectlyConnected);
}
}
synchronized public void registerSample(NewSample newSample) throws UserFailureException
synchronized public long registerSample(NewSample newSample) throws UserFailureException
{
assert newSample != null : "Unspecified sample.";
checkSessionToken();
try
{
primRegisterSample(newSample);
return primRegisterSample(newSample);
} catch (final InvalidSessionException ex)
{
authenticate();
primRegisterSample(newSample);
return primRegisterSample(newSample);
}
}
......
......@@ -21,6 +21,7 @@ import java.util.List;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
import ch.systemsx.cisd.openbis.generic.shared.IETLLIMSService;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypeWithVocabularyTerms;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
......@@ -56,12 +57,12 @@ 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.
......@@ -77,10 +78,27 @@ public interface IEncapsulatedOpenBISService
public SampleType getSampleType(String sampleTypeCode) throws UserFailureException;
/**
* Registers the specified sample.
* Returns the data set type together with assigned property types for the specified data set
* type code.
*/
public DataSetTypeWithVocabularyTerms getDataSetType(String dataSetTypeCode);
/**
* Lists all data sets of the specified sample ID.
*
* @param showOnlyDirectlyConnected If <code>true</code> only directly connected data sets are
* returned.
*/
public void registerSample(final NewSample newSample) throws UserFailureException;
public List<ExternalData> listDataSetsBySampleID(long sampleID,
boolean showOnlyDirectlyConnected) throws UserFailureException;
/**
* Registers the specified sample.
*
* @return the technical ID of the new sample
*/
public long registerSample(final NewSample newSample) throws UserFailureException;
/**
* Registers the specified data.
* <p>
......
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