public interface IDssComponent
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:
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.
Modifier and Type | Method and Description |
---|---|
void |
checkSession()
Checks whether the session is alive.
|
boolean |
deleteSessionWorkspaceFile(java.lang.String path)
Delete a file or directory in the session workspace.
|
java.util.Map<java.lang.String,java.lang.String> |
extractMetadata(NewDataSetDTO newDataset,
java.io.File dataSetFile)
Tries to extract the data set property key-values (metadata) from the data.
|
IDataSetDss |
getDataSet(java.lang.String code)
Get a proxy to the data set designated by the given data set code.
|
java.io.InputStream |
getFileFromSessionWorkspace(java.lang.String filePath)
Downloads a file from the session workspace.
|
void |
getFileFromSessionWorkspace(java.lang.String filePath,
java.io.File localFile)
Downloads a file from the session workspace.
|
java.lang.String |
getSessionToken()
Returns the session token.
|
void |
logout()
Logs the current user out.
|
IDataSetDss |
putDataSet(NewDataSetDTO newDataset,
java.io.File dataSetFile)
Upload a new data set to the DSS.
|
void |
putFileToSessionWorkspace(java.lang.String directory,
java.io.File file)
Uploads a file to the session workspace.
|
void |
putFileToSessionWorkspace(java.lang.String filePath,
java.io.InputStream inputStream)
Uploads a file to the session workspace.
|
java.util.List<ValidationError> |
validateDataSet(NewDataSetDTO newDataset,
java.io.File dataSetFile)
Validate a data set.
|
void checkSession() throws InvalidSessionException
InvalidSessionException
- If the session is not alive.java.lang.String getSessionToken() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- Thrown if the user has not yet been authenticated.IDataSetDss getDataSet(java.lang.String code) throws java.lang.IllegalStateException, EnvironmentFailureException
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.IDataSetDss putDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException, ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the datajava.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.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
- If the file transfer fails.void putFileToSessionWorkspace(java.lang.String filePath, java.io.InputStream inputStream) throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
filePath
- The path (directory and name) of the file to upload.inputStream
- The content of the file to upload.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
- If the file transfer fails.void putFileToSessionWorkspace(java.lang.String directory, java.io.File file) throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
directory
- The directory in the session workspace where the file should be uploaded.file
- The file to upload.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
- If the file cannot be written.java.io.InputStream getFileFromSessionWorkspace(java.lang.String filePath) throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
filePath
- The path (directory and name) of the file to download.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
- If the file does not exist, is a directory or cannot be opened.void getFileFromSessionWorkspace(java.lang.String filePath, java.io.File localFile) throws ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
filePath
- The path (directory and name) of the file to download.localFile
- The local file to write the file from the session workspace to.ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked
- If the file does not exist.boolean deleteSessionWorkspaceFile(java.lang.String path)
true
if the path doesn't exist anymore.java.util.List<ValidationError> validateDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the datajava.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.java.util.Map<java.lang.String,java.lang.String> extractMetadata(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the datajava.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.void logout()