Interface IDataSetRegistrationTransaction

  • All Known Subinterfaces:
    IImagingDataSetRegistrationTransaction
    All Known Implementing Classes:
    DataSetRegistrationTransaction

    public interface IDataSetRegistrationTransaction
    Interface for a data set registration transaction. All actions that go through the transaction are committed atomically or rolledback.

    The working directory for a file operations is the incoming data set folder (or incoming directory if the data set is a simple file). Non-absolute paths are resolved relative to the working directory.

    New data sets are expected to have exactly one file or folder at the top level. When registered, it is this file or folder that is put into the store.

    • Method Detail

      • createNewDataSet

        IDataSet createNewDataSet()
        Create a new data set for registration in openBIS.
      • createNewDataSet

        IDataSet createNewDataSet​(java.lang.String dataSetType)
        Create a new data set with the specified code.
      • createNewDataSet

        IDataSet createNewDataSet​(java.lang.String dataSetType,
                                  DataSetKind datasetKindOrNull)
      • createNewDataSet

        IDataSet createNewDataSet​(java.lang.String dataSetType,
                                  java.lang.String dataSetCode)
        Create a new data set with the specified type and code.
      • createNewDataSet

        IDataSet createNewDataSet​(java.lang.String dataSetType,
                                  java.lang.String dataSetCode,
                                  DataSetKind datasetKindOrNull)
      • getDataSet

        IDataSetImmutable getDataSet​(java.lang.String dataSetCode)
        Get a data set from the openBIS AS. Returns null if the data set does not exist.
        Returns:
        A data set or null
      • getDataSetForUpdate

        IDataSetUpdatable getDataSetForUpdate​(java.lang.String dataSetCode)
        Get a data set from the openBIS AS for the purpose of modifying it. Returns null if the data set does not exist.
        Returns:
        A data set or null
      • getSample

        ISampleImmutable getSample​(java.lang.String sampleIdentifierString)
        Get a sample from the openBIS AS. Returns null if the sample does not exist.
        Returns:
        A sample or null
      • getSampleForUpdate

        ISample getSampleForUpdate​(java.lang.String sampleIdentifierString)
        Get a sample from the openBIS AS for the purpose of modifying it. Returns null if the sample does not exist.
        Returns:
        A sample or null
      • makeSampleMutable

        ISample makeSampleMutable​(ISampleImmutable sample)
        Given an immutable sample, make it mutable.
        Returns:
        A sample
      • createNewSample

        ISample createNewSample​(java.lang.String sampleIdentifierString,
                                java.lang.String sampleTypeCode)
        Create a new sample to register with the openBIS AS. The sample will have a permId.
        Parameters:
        sampleIdentifierString - The identifier for the new sample
        sampleTypeCode - The code of the type for the new sample
      • createNewSampleWithGeneratedCode

        ISample createNewSampleWithGeneratedCode​(java.lang.String spaceCode,
                                                 java.lang.String sampleTypeCode)
        Create a new sample to register with the openBIS AS. The sample will have a permId and automatically generated identifier
        Parameters:
        spaceCode - The space in which to create the new sample.
        sampleTypeCode - The code of the type for the new sample
      • getExperiment

        IExperimentImmutable getExperiment​(java.lang.String experimentIdentifierString)
        Get an experiment from the openBIS AS.
      • getExperimentForUpdate

        IExperimentUpdatable getExperimentForUpdate​(java.lang.String experimentIdentifierString)
        Get an experiment from the openBIS AS for the purpose of modifying it.
      • createNewExperiment

        IExperiment createNewExperiment​(java.lang.String experimentIdentifierString,
                                        java.lang.String experimentTypeCode)
        Create a new experiment to register with the openBIS AS. The experiment will have a permId.
        Parameters:
        experimentIdentifierString - The identifier for the new experiment
        experimentTypeCode - The code of the type for the new experiment
      • createNewProject

        IProject createNewProject​(java.lang.String projectIdentifier)
        Create a new project to register with the openBIS AS.
        Parameters:
        projectIdentifier - .
      • getProject

        IProjectImmutable getProject​(java.lang.String projectIdentifier)
        Get a project from the openBIS AS. Returns null if the project does not exist.
        Returns:
        A project or null
      • getProjectForUpdate

        IProject getProjectForUpdate​(java.lang.String projectIdentifierString)
        Get an project from the openBIS AS for the purpose of modifying it.
      • makeProjectMutable

        IProject makeProjectMutable​(IProjectImmutable project)
        Given an immutable project, make it mutable.
        Returns:
        A mutable project.
      • createNewSpace

        ISpace createNewSpace​(java.lang.String spaceCode,
                              java.lang.String spaceAdminUserIdOrNull)
        Create a new space to register with the openBIS AS.
        Parameters:
        spaceCode - the code of the space
        spaceAdminUserIdOrNull - the user id of the person, who will receive space admin priviliges.
      • getSpace

        ISpaceImmutable getSpace​(java.lang.String spaceCode)
        Get a space from the openBIS AS. Returns null if the space does not exist.
        Returns:
        A space or null
      • getMaterial

        IMaterialImmutable getMaterial​(java.lang.String materialCode,
                                       java.lang.String materialType)
        Get a material from the openBIS AS. Returns null if the material does not exist.
        Returns:
        A material or null
      • getMaterial

        IMaterialImmutable getMaterial​(java.lang.String identifier)
        Get a material from the openBIS AS. Returns null if the material does not exist.
        Returns:
        A material or null
      • getMaterialForUpdate

        IMaterial getMaterialForUpdate​(java.lang.String materialCode,
                                       java.lang.String materialType)
        Get a material from the openBIS AS for the purpose of modifying it. Returns null if the material does not exist.
        Returns:
        A material or null
      • getMaterialForUpdate

        IMaterial getMaterialForUpdate​(java.lang.String identifier)
        Get a material from the openBIS AS for the purpose of modifying it. Returns null if the material does not exist.
        Returns:
        A material or null
      • makeMaterialMutable

        IMaterial makeMaterialMutable​(IMaterialImmutable material)
        Given an immutable material, make it mutable.
        Returns:
        A material
      • createNewMaterial

        IMaterial createNewMaterial​(java.lang.String materialCode,
                                    java.lang.String materialType)
        Create a new material to register with the openBIS AS.
        Parameters:
        materialCode - the code of the material
        materialType - the type of the material
      • getExternalDataManagementSystem

        IExternalDataManagementSystemImmutable getExternalDataManagementSystem​(java.lang.String externalDataManagementSystemCode)
        Get an external data management system from the openBIS AS. Returns null if the object does not exist.
        Returns:
        external data management system or null
      • createNewMetaproject

        IMetaproject createNewMetaproject​(java.lang.String name,
                                          java.lang.String description)
        Creates the new metaproject for the current user. Only allowed when there is a user available.
      • createNewMetaproject

        IMetaproject createNewMetaproject​(java.lang.String name,
                                          java.lang.String description,
                                          java.lang.String ownerId)
        Creates the new metaproject for the specified user. Only allowed when there is no user available.
      • getMetaproject

        IMetaproject getMetaproject​(java.lang.String name)
        Only allowed when the user is available.
        Returns:
        metaproject with given name for current user.
      • getMetaproject

        IMetaproject getMetaproject​(java.lang.String name,
                                    java.lang.String ownerId)
        Only allowed when the user is not available.
        Returns:
        metaproject with given name for specified user.
      • getVocabulary

        IVocabularyImmutable getVocabulary​(java.lang.String code)
        Get the read-only vocabulary with given code
      • getVocabularyForUpdate

        IVocabulary getVocabularyForUpdate​(java.lang.String code)
        Get the vocabulary with given code
      • createNewVocabularyTerm

        IVocabularyTerm createNewVocabularyTerm()
        Creates a new vocabulary term, which has to be assigned to a IVocabulary.
      • moveFile

        java.lang.String moveFile​(java.lang.String src,
                                  IDataSet dst)
        Move a file from into the root of a data set.
        Parameters:
        src - The path of the file to move.
        dst - The data set to add the file to.
        Returns:
        The absolute path after the move.
      • moveFile

        java.lang.String moveFile​(java.lang.String src,
                                  IDataSet dst,
                                  java.lang.String dstInDataset)
        Move a file to a specified location in a data set. Any necessary intermediate folders are automatically created.
        Parameters:
        src - The path of the file to move.
        dst - The data set to add the file to.
        dstInDataset - The path of the file in the data set
        Returns:
        The absolute path after the move.
      • createNewDirectory

        java.lang.String createNewDirectory​(IDataSet dst,
                                            java.lang.String dirName)
        Create a new directory and return the path.
        Parameters:
        dst - The data set to add the file to.
        dirName - The name of the new file to create. (Can be a simple file or directory.)
        Returns:
        The absolute path of the new file.
      • createNewFile

        java.lang.String createNewFile​(IDataSet dst,
                                       java.lang.String fileName)
        Create a new empty file and return the path.
        Parameters:
        dst - The data set to add the file to.
        fileName - The name of the new file to create. (Can be a simple file or directory.)
        Returns:
        The absolute path of the new file.
      • createNewFile

        java.lang.String createNewFile​(IDataSet dst,
                                       java.lang.String dstInDataset,
                                       java.lang.String fileName)
        Create a new empty file and return the path.
        Parameters:
        dst - The data set to add the file to.
        dstInDataset - The path of the file in the data set
        fileName - The name of the new file to create. (Can be a simple file or directory.)
        Returns:
        The absolute path of the new file.
      • getSearchService

        ISearchService getSearchService()
        Retrieve the search service for this transaction. If the user is available for this transaction, then the search service results will be filtered for this user.
        Returns:
        The search service for this transaction.
      • getSearchServiceUnfiltered

        ISearchService getSearchServiceUnfiltered()
        Retrieve the search service for this transaction. It returns the results unfiltered by the user, even if the user is available.
        Returns:
        The search service for this transaction.
      • getSearchServiceFilteredForUser

        ISearchService getSearchServiceFilteredForUser​(java.lang.String userId)
        Retrieve the search service for this transaction. The search service results will be filtered for the specified user.
        Returns:
        The search service for this transaction.
      • getAuthorizationService

        IAuthorizationService getAuthorizationService()
        Returns:
        A service which can be used to get authorization information about a user.
      • getDatabaseQuery

        net.lemnik.eodsql.DynamicTransactionQuery getDatabaseQuery​(java.lang.String dataSourceName)
                                                            throws java.lang.IllegalArgumentException
        Gets a database query object for the data source with the specified name.

        After the rest of the transaction is committed, the queries are committed. Failures in these secondary queries are not fatal, but they are caught and the clients of the transaction are notified.

        Parameters:
        dataSourceName - The name of the data source to query against, as declared in the service.properties file.
        Returns:
        The query.
        Throws:
        java.lang.IllegalArgumentException
      • getRegistrationContext

        DataSetRegistrationContext getRegistrationContext()
        Return a registration context object which can be used to store information that needs to be accessed through the registration process.

        It is important to use the registration context, and not global variables, for communication between code in different parts of the registration process. This is because the registration process is not guaranteed to run in a single process.

        Returns:
        The context, a hash-map-like object.
      • getRegistratorContext

        @Deprecated
        ch.systemsx.cisd.etlserver.registrator.v1.AbstractOmniscientTopLevelDataSetRegistrator.OmniscientTopLevelDataSetRegistratorState getRegistratorContext()
        Deprecated.
        Should not be used. To get to the global state use getGlobalState instead
        Returns the service registrator context.
      • getIncoming

        java.io.File getIncoming()
        Returns:
        The logical incoming file.
      • getUserId

        java.lang.String getUserId()
        Get the id of the user on whose behalf this registration transaction is performed.
        Returns:
        A userId or null, if there is none.
      • setUserId

        void setUserId​(java.lang.String userIdOrNull)
        Set the id of the user on whose behalf this registration transaction is performed.
        Parameters:
        userIdOrNull - The id of a user or null if this transaction should be performed as the system (etlserver).