Interface ISimpleOpenbisServiceFacade
-
- All Known Subinterfaces:
IOpenbisServiceFacade
- All Known Implementing Classes:
OpenbisServiceFacade
public interface ISimpleOpenbisServiceFacade
Provides a simplified view of an openBIS backend by allowing the following operations :1. basic listing for the common openBIS entities kinds: projects, experiments, samples, and data sets. 2. uploading datasets to openBIS 3. downloading data sets from openBIS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkSession()
Checks whether the session is alive.java.util.Map<java.lang.String,java.lang.String>
extractMetadata(NewDataSetDTO newDataset, java.io.File dataSetFile)
Extracts metadata from a file.DataSet
getDataSet(java.lang.String dataSetCode)
Return aDataSet
object for for the given code.java.util.List<DataSet>
getDataSets(java.util.List<java.lang.String> dataSetCodes)
ReturnDataSet
objects for given a set of codes.java.util.List<Experiment>
getExperiments(java.util.List<java.lang.String> experimentIdentifiers)
ReturnExperiment
objects for a set of given experiment identifiers.int
getMinorVersionInformationService()
Returns the minor version of the general information service.java.util.List<Sample>
getSamples(java.util.List<java.lang.String> sampleIdentifiers)
ReturnSample
objects for a set of given sample identifiers.java.util.List<Sample>
getSamples(java.util.List<java.lang.String> sampleIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
ReturnSample
objects for a set of given sample identifiers.java.util.List<SpaceWithProjectsAndRoleAssignments>
getSpacesWithProjects()
Return all spaces enriched with their projects and role assignments.java.util.List<DataSet>
listDataSetsForExperiment(java.lang.String experimentPermId)
Returns all data sets of specified experiment.java.util.List<DataSet>
listDataSetsForExperiments(java.util.List<java.lang.String> experimentIdentifiers)
Return all data sets for a given list of experiments identifiers.java.util.List<DataSet>
listDataSetsForSample(java.lang.String samplePermId)
Returns all data sets of specified sample.java.util.List<DataSet>
listDataSetsForSamples(java.util.List<java.lang.String> sampleIdentifiers)
Return all data sets for a given list of sample identifiers.java.util.List<DataSetType>
listDataSetTypes()
Returns all data set types available in openBIS.java.util.List<Experiment>
listExperimentsForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments for a given list of project identifiers.java.util.List<Experiment>
listExperimentsHavingDataSetsForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments having data sets for a given list of project identifiers.java.util.List<Experiment>
listExperimentsHavingSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments having samples for a given list of project identifiers.java.util.List<ExperimentType>
listExperimentTypes()
Returns all experiment types available in openBIS.java.util.List<Project>
listProjects()
Returns all available projects.java.util.List<Sample>
listSamplesForExperimentAndSampleType(java.lang.String experimentPermId, java.lang.String sampleType)
Returns all samples for specified experiment and of specified type.java.util.List<Sample>
listSamplesForExperiments(java.util.List<java.lang.String> experimentIdentifiers)
Return all samples for a given list of experiments identifiers.java.util.List<Sample>
listSamplesForExperiments(java.util.List<java.lang.String> experimentIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
Return all samples for a given list of experiments identifiers.java.util.List<Sample>
listSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all samples for a given list of project identifiers.java.util.List<Sample>
listSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
Return all samples for a given list of project identifiers.java.util.List<Sample>
listSamplesOfSample(java.lang.String samplePermId)
Returns all samples which are components or children of the specified sample.java.util.List<SampleType>
listSampleTypes()
Returns all sample types available in openBIS.java.util.List<Vocabulary>
listVocabularies()
Return all vocabularies available in openBIS together with the contained vocabulary terms.void
logout()
Logs out from openBIS and frees all associated resources on the server.DataSet
putDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile)
Upload a new data set to the DSS.java.util.List<ValidationError>
validateDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile)
Validates a data set.
-
-
-
Method Detail
-
getMinorVersionInformationService
int getMinorVersionInformationService()
Returns the minor version of the general information service.
-
listProjects
java.util.List<Project> listProjects()
Returns all available projects.
-
getSpacesWithProjects
java.util.List<SpaceWithProjectsAndRoleAssignments> getSpacesWithProjects()
Return all spaces enriched with their projects and role assignments.
-
getExperiments
java.util.List<Experiment> getExperiments(java.util.List<java.lang.String> experimentIdentifiers)
ReturnExperiment
objects for a set of given experiment identifiers. If some of the specified experiment identifiers does not exist in openBIS it will be silently ignored.
-
listExperimentsForProjects
java.util.List<Experiment> listExperimentsForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments for a given list of project identifiers. If some of the specified project identifiers does not exist in openBIS it will be silently ignored.
-
listExperimentsHavingSamplesForProjects
java.util.List<Experiment> listExperimentsHavingSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments having samples for a given list of project identifiers. If some of the specified project identifiers does not exist in openBIS it will be silently ignored.
-
listExperimentsHavingDataSetsForProjects
java.util.List<Experiment> listExperimentsHavingDataSetsForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all experiments having data sets for a given list of project identifiers. If some of the specified project identifiers does not exist in openBIS it will be silently ignored.
-
getSamples
java.util.List<Sample> getSamples(java.util.List<java.lang.String> sampleIdentifiers)
ReturnSample
objects for a set of given sample identifiers. If some of the specified sample identifiers does not exist in openBIS it will be silently ignored.
-
getSamples
java.util.List<Sample> getSamples(java.util.List<java.lang.String> sampleIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
ReturnSample
objects for a set of given sample identifiers. If some of the specified sample identifiers does not exist in openBIS it will be silently ignored.- Parameters:
sampleIdentifiers
- sample identifiers for which samples should be retrievedfetchOptions
- Options that control which parts of the samples are fetched.
-
listSamplesForExperiments
java.util.List<Sample> listSamplesForExperiments(java.util.List<java.lang.String> experimentIdentifiers)
Return all samples for a given list of experiments identifiers. If some of the specified experiment identifiers does not exist in openBIS it will be silently ignored.
-
listSamplesForExperiments
java.util.List<Sample> listSamplesForExperiments(java.util.List<java.lang.String> experimentIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
Return all samples for a given list of experiments identifiers. If some of the specified experiment identifiers does not exist in openBIS it will be silently ignored.- Parameters:
experimentIdentifiers
- experiment identifiers for which samples should be retrievedfetchOptions
- Options that control which parts of the samples are fetched.
-
listSamplesForExperimentAndSampleType
java.util.List<Sample> listSamplesForExperimentAndSampleType(java.lang.String experimentPermId, java.lang.String sampleType)
Returns all samples for specified experiment and of specified type.- Returns:
- an empty list if specified identifier and/or type do not exist.
-
listSamplesOfSample
java.util.List<Sample> listSamplesOfSample(java.lang.String samplePermId)
Returns all samples which are components or children of the specified sample.- Returns:
- an empty list if the specified sample does not exist.
-
listSamplesForProjects
java.util.List<Sample> listSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers)
Return all samples for a given list of project identifiers. If some of the specified project identifiers does not exist in openBIS it will be silently ignored.
-
listSamplesForProjects
java.util.List<Sample> listSamplesForProjects(java.util.List<java.lang.String> projectIdentifiers, java.util.EnumSet<SampleFetchOption> fetchOptions)
Return all samples for a given list of project identifiers. If some of the specified project identifiers does not exist in openBIS it will be silently ignored.- Parameters:
projectIdentifiers
- project identifiers for which samples should be retrievedfetchOptions
- Options that control which parts of the samples are fetched.
-
getDataSet
DataSet getDataSet(java.lang.String dataSetCode)
Return aDataSet
object for for the given code. If some of the specified data set code does not exist in openBIS, null will be returned.- Returns:
- The requested data set, or null if it does not exist.
-
getDataSets
java.util.List<DataSet> getDataSets(java.util.List<java.lang.String> dataSetCodes)
ReturnDataSet
objects for given a set of codes. If some of the specified data set codes does not exist in openBIS it will be silently ignored.
-
listDataSetsForExperiments
java.util.List<DataSet> listDataSetsForExperiments(java.util.List<java.lang.String> experimentIdentifiers)
Return all data sets for a given list of experiments identifiers. If some of the specified experiment identifiers does not exist in openBIS it will be silently ignored.
-
listDataSetsForExperiment
java.util.List<DataSet> listDataSetsForExperiment(java.lang.String experimentPermId)
Returns all data sets of specified experiment.- Returns:
- an empty list if the experiment does not exists.
-
listDataSetsForSamples
java.util.List<DataSet> listDataSetsForSamples(java.util.List<java.lang.String> sampleIdentifiers)
Return all data sets for a given list of sample identifiers. If some of the specified sample identifiers does not exist in openBIS it will be silently ignored.
-
listDataSetsForSample
java.util.List<DataSet> listDataSetsForSample(java.lang.String samplePermId)
Returns all data sets of specified sample.- Returns:
- an empty list if the sample does not exists.
-
listDataSetTypes
java.util.List<DataSetType> listDataSetTypes()
Returns all data set types available in openBIS.
-
listSampleTypes
java.util.List<SampleType> listSampleTypes()
Returns all sample types available in openBIS.
-
listExperimentTypes
java.util.List<ExperimentType> listExperimentTypes()
Returns all experiment types available in openBIS.
-
listVocabularies
java.util.List<Vocabulary> listVocabularies()
Return all vocabularies available in openBIS together with the contained vocabulary terms.
-
putDataSet
DataSet putDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile)
Upload a new data set to the DSS.- Parameters:
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data- Returns:
- A proxy to the newly added data set
-
validateDataSet
java.util.List<ValidationError> validateDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
Validates a data set.- Parameters:
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data- Returns:
- A list of validation errors. The list is empty if there were no validation errors.
- Throws:
java.lang.IllegalStateException
- Thrown if the user has not yet been authenticated.EnvironmentFailureException
- Thrown in cases where it is not possible to connect to the server.
-
extractMetadata
java.util.Map<java.lang.String,java.lang.String> extractMetadata(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
Extracts metadata from a file.- Parameters:
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data- Returns:
- Map of property name/value pairs.
- Throws:
java.lang.IllegalStateException
- Thrown if the user has not yet been authenticated.EnvironmentFailureException
- Thrown in cases where it is not possible to connect to the server.
-
checkSession
void checkSession() throws InvalidSessionException
Checks whether the session is alive.- Throws:
InvalidSessionException
- If the session is not alive.
-
logout
void logout()
Logs out from openBIS and frees all associated resources on the server.IMPORTANT NOTE: If clients fail to call this method after finishing interaction with openBIS, then their session will be kept on the server until it expires. It is considered a security risk to leave openBIS sessions open.
-
-