Class OpenbisServiceFacade

    • Method Detail

      • tryCreate

        public static IOpenbisServiceFacade tryCreate​(java.lang.String username,
                                                      java.lang.String password,
                                                      java.lang.String openbisUrl,
                                                      long timeoutInMillis)
      • tryCreate

        public static IOpenbisServiceFacade tryCreate​(java.lang.String sessionToken,
                                                      java.lang.String openbisUrl,
                                                      long timeoutInMillis)
      • getExperiments

        public java.util.List<Experiment> getExperiments​(java.util.List<java.lang.String> experimentIdentifiers)
                                                  throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Return Experiment 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.
        Specified by:
        getExperiments in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listExperimentsForProjects

        public java.util.List<Experiment> listExperimentsForProjects​(java.util.List<java.lang.String> projectIdentifiers)
                                                              throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listExperimentsForProjects in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listExperimentsHavingSamplesForProjects

        public java.util.List<Experiment> listExperimentsHavingSamplesForProjects​(java.util.List<java.lang.String> projectIdentifiers)
                                                                           throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listExperimentsHavingSamplesForProjects in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listExperimentsHavingDataSetsForProjects

        public java.util.List<Experiment> listExperimentsHavingDataSetsForProjects​(java.util.List<java.lang.String> projectIdentifiers)
                                                                            throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listExperimentsHavingDataSetsForProjects in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • getSamples

        public java.util.List<Sample> getSamples​(java.util.List<java.lang.String> sampleIdentifiers)
                                          throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Return Sample 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.
        Specified by:
        getSamples in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • getSamples

        public java.util.List<Sample> getSamples​(java.util.List<java.lang.String> sampleIdentifiers,
                                                 java.util.EnumSet<SampleFetchOption> fetchOptions)
        Description copied from interface: ISimpleOpenbisServiceFacade
        Return Sample 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.
        Specified by:
        getSamples in interface ISimpleOpenbisServiceFacade
        Parameters:
        sampleIdentifiers - sample identifiers for which samples should be retrieved
        fetchOptions - Options that control which parts of the samples are fetched.
      • listSamplesForExperiments

        public java.util.List<Sample> listSamplesForExperiments​(java.util.List<java.lang.String> experimentIdentifiers)
                                                         throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listSamplesForExperiments in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listSamplesForExperiments

        public java.util.List<Sample> listSamplesForExperiments​(java.util.List<java.lang.String> experimentIdentifiers,
                                                                java.util.EnumSet<SampleFetchOption> fetchOptions)
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listSamplesForExperiments in interface ISimpleOpenbisServiceFacade
        Parameters:
        experimentIdentifiers - experiment identifiers for which samples should be retrieved
        fetchOptions - Options that control which parts of the samples are fetched.
      • listSamplesForProjects

        public java.util.List<Sample> listSamplesForProjects​(java.util.List<java.lang.String> projectIdentifiers)
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listSamplesForProjects in interface ISimpleOpenbisServiceFacade
      • listSamplesForProjects

        public java.util.List<Sample> listSamplesForProjects​(java.util.List<java.lang.String> projectIdentifiers,
                                                             java.util.EnumSet<SampleFetchOption> fetchOptions)
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listSamplesForProjects in interface ISimpleOpenbisServiceFacade
        Parameters:
        projectIdentifiers - project identifiers for which samples should be retrieved
        fetchOptions - Options that control which parts of the samples are fetched.
      • getDataSet

        public DataSet getDataSet​(java.lang.String dataSetCode)
                           throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Return a DataSet object for for the given code. If some of the specified data set code does not exist in openBIS, null will be returned.
        Specified by:
        getDataSet in interface ISimpleOpenbisServiceFacade
        Returns:
        The requested data set, or null if it does not exist.
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • getDataSets

        public java.util.List<DataSet> getDataSets​(java.util.List<java.lang.String> dataSetCodes)
                                            throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Return DataSet 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.
        Specified by:
        getDataSets in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listDataSetsForExperiments

        public java.util.List<DataSet> listDataSetsForExperiments​(java.util.List<java.lang.String> experimentIdentifiers)
                                                           throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listDataSetsForExperiments in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • listDataSetsForSamples

        public java.util.List<DataSet> listDataSetsForSamples​(java.util.List<java.lang.String> sampleIdentifiers)
                                                       throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.
        Specified by:
        listDataSetsForSamples in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • getDataSetDss

        public IDataSetDss getDataSetDss​(java.lang.String code)
                                  throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • putDataSet

        public DataSet putDataSet​(NewDataSetDTO newDataset,
                                  java.io.File dataSetFile)
                           throws ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Upload a new data set to the DSS.
        Specified by:
        putDataSet in interface ISimpleOpenbisServiceFacade
        Parameters:
        newDataset - The new data set that should be registered
        dataSetFile - A file or folder containing the data
        Returns:
        A proxy to the newly added data set
        Throws:
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
      • validateDataSet

        public java.util.List<ValidationError> validateDataSet​(NewDataSetDTO newDataset,
                                                               java.io.File dataSetFile)
                                                        throws java.lang.IllegalStateException,
                                                               ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Validates a data set.
        Specified by:
        validateDataSet in interface ISimpleOpenbisServiceFacade
        Parameters:
        newDataset - The new data set that should be registered
        dataSetFile - 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.
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException - Thrown in cases where it is not possible to connect to the server.
      • extractMetadata

        public java.util.Map<java.lang.String,​java.lang.String> extractMetadata​(NewDataSetDTO newDataset,
                                                                                      java.io.File dataSetFile)
                                                                               throws java.lang.IllegalStateException,
                                                                                      ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Extracts metadata from a file.
        Specified by:
        extractMetadata in interface ISimpleOpenbisServiceFacade
        Parameters:
        newDataset - The new data set that should be registered
        dataSetFile - 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.
        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException - Thrown in cases where it is not possible to connect to the server.
      • checkSession

        public void checkSession()
                          throws ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Description copied from interface: ISimpleOpenbisServiceFacade
        Checks whether the session is alive.
        Specified by:
        checkSession in interface ISimpleOpenbisServiceFacade
        Throws:
        ch.systemsx.cisd.common.exceptions.InvalidSessionException - If the session is not alive.
      • logout

        public void logout()
        Description copied from interface: ISimpleOpenbisServiceFacade
        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.

        Specified by:
        logout in interface ISimpleOpenbisServiceFacade
      • searchForSamples

        public java.util.List<Sample> searchForSamples​(SearchCriteria searchCriteria)
        Description copied from interface: IOpenbisServiceFacade
        Return all samples that match the search criteria. This is a short cut for
         searchForSamples(searchCritera, EnumSet.of(SampleFetchOption.PROPERTIES))
         
        Specified by:
        searchForSamples in interface IOpenbisServiceFacade
        Parameters:
        searchCriteria - The sample metadata values to be matched against.
      • addAdHocVocabularyTerm

        public void addAdHocVocabularyTerm​(ch.systemsx.cisd.openbis.generic.shared.basic.TechId vocabularyId,
                                           java.lang.String code,
                                           java.lang.String label,
                                           java.lang.String description,
                                           java.lang.Long previousTermOrdinal)
        Description copied from interface: IOpenbisServiceFacade
        Adds new ad-hoc terms to a vocabulary starting from specified ordinal + 1.
        Specified by:
        addAdHocVocabularyTerm in interface IOpenbisServiceFacade
        Parameters:
        vocabularyId - The id of vocabulary which should be extended.
        code - Code of new vocabulary term.
        label - Label of new vocabulary term.
        description - Free text describing new vocabulary term.
        previousTermOrdinal - new vocabulary term will be placed right after vocabulary term with given ordinal number.
      • addAdHocVocabularyTerm

        public void addAdHocVocabularyTerm​(java.lang.Long vocabularyId,
                                           NewVocabularyTerm term)
        Description copied from interface: IOpenbisServiceFacade
        Adds new ad-hoc terms to a vocabulary starting from specified ordinal + 1.
        Specified by:
        addAdHocVocabularyTerm in interface IOpenbisServiceFacade
        Parameters:
        vocabularyId - The id of vocabulary which should be extended.
        term - the vocabulary term to be added.