Interface IDssComponent

  • All Known Implementing Classes:
    DssComponent

    public interface IDssComponent
    A component that manages a connection to openBIS and 1 or more data store servers.

    The component is a kind of state machine. In the initial state, only login is allowed. After login, other operations may be called. Thus clients should follow the following usage pattern:

    1. login
    2. ...do stuff...
    3. logout

    The IDssComponent itself is designed to be used in a single thread, though it may return objects that can be used in multiple threads. Documentation for the return values clarifies their level of thread safety.

    • Method Detail

      • checkSession

        void checkSession()
                   throws ch.systemsx.cisd.common.exceptions.InvalidSessionException
        Checks whether the session is alive.
        Throws:
        ch.systemsx.cisd.common.exceptions.InvalidSessionException - If the session is not alive.
      • getSessionToken

        java.lang.String getSessionToken()
                                  throws java.lang.IllegalStateException
        Returns the session token.
        Returns:
        The session token for an authenticated user.
        Throws:
        java.lang.IllegalStateException - Thrown if the user has not yet been authenticated.
      • getDataSet

        IDataSetDss getDataSet​(java.lang.String code)
                        throws java.lang.IllegalStateException,
                               ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Get a proxy to the data set designated by the given data set code.
        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.
      • putDataSet

        IDataSetDss putDataSet​(NewDataSetDTO newDataset,
                               java.io.File dataSetFile)
                        throws java.lang.IllegalStateException,
                               ch.systemsx.cisd.common.exceptions.EnvironmentFailureException,
                               IOExceptionUnchecked
        Upload a new data set to the DSS.
        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:
        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.
        IOExceptionUnchecked - If the file transfer fails.
      • putFileToSessionWorkspace

        void putFileToSessionWorkspace​(java.lang.String filePath,
                                       java.io.InputStream inputStream)
                                throws IOExceptionUnchecked
        Uploads a file to the session workspace.
        Parameters:
        filePath - The path (directory and name) of the file to upload.
        inputStream - The content of the file to upload.
        Throws:
        IOExceptionUnchecked - If the file transfer fails.
      • putFileToSessionWorkspace

        void putFileToSessionWorkspace​(java.lang.String directory,
                                       java.io.File file)
                                throws IOExceptionUnchecked
        Uploads a file to the session workspace.
        Parameters:
        directory - The directory in the session workspace where the file should be uploaded.
        file - The file to upload.
        Throws:
        IOExceptionUnchecked - If the file cannot be written.
      • getFileFromSessionWorkspace

        java.io.InputStream getFileFromSessionWorkspace​(java.lang.String filePath)
                                                 throws IOExceptionUnchecked
        Downloads a file from the session workspace.
        Parameters:
        filePath - The path (directory and name) of the file to download.
        Returns:
        outputStream The content of the file to download.
        Throws:
        IOExceptionUnchecked - If the file does not exist, is a directory or cannot be opened.
      • getFileFromSessionWorkspace

        void getFileFromSessionWorkspace​(java.lang.String filePath,
                                         java.io.File localFile)
                                  throws IOExceptionUnchecked
        Downloads a file from the session workspace.
        Parameters:
        filePath - The path (directory and name) of the file to download.
        localFile - The local file to write the file from the session workspace to.
        Throws:
        IOExceptionUnchecked - If the file does not exist.
      • deleteSessionWorkspaceFile

        boolean deleteSessionWorkspaceFile​(java.lang.String path)
        Delete a file or directory in the session workspace.
        Returns:
        true if the path doesn't exist anymore.
      • validateDataSet

        java.util.List<ValidationError> validateDataSet​(NewDataSetDTO newDataset,
                                                        java.io.File dataSetFile)
                                                 throws java.lang.IllegalStateException,
                                                        ch.systemsx.cisd.common.exceptions.EnvironmentFailureException
        Validate a data set.
        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

        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
        Tries to extract the data set property key-values (metadata) from the data. The extracted metadata can be used by clients to minimize the input needed when uploading data sets.
        Parameters:
        newDataset - The new data set that should be registered
        dataSetFile - A file or folder containing the data
        Returns:
        A map of extracted property-key values
        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.
      • logout

        void logout()
        Logs the current user out.