|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.systemsx.cisd.openbis.dss.client.api.v1.impl.DssComponent
public class DssComponent
Implementation of the IDssComponent interface. It is a facade for interacting with openBIS and multiple DSS servers.
The DssComponent manages a connection to openBIS (IETLLIMSService) as well as connections to data store servers (IDssServiceRpc) to present a simplified interface to downloading datasets.
Constructor Summary | |
---|---|
DssComponent(IGeneralInformationService service,
IRpcServiceFactory dssServiceFactory,
java.lang.String sessionTokenOrNull)
Constructor for clients that already have an IETLLIMSService; also used for testing. |
Method Summary | |
---|---|
void |
checkSession()
Checks whether the session is alive. |
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.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. |
static DssComponent |
tryCreate(java.lang.String sessionToken,
java.lang.String openBISUrl,
long timeoutInMillis)
Public factory method for creating a DssComponent for a user that has already been authenticated. |
static DssComponent |
tryCreate(java.lang.String user,
java.lang.String password,
java.lang.String openBISUrl,
long timeoutInMillis)
Public factory method for creating a DssComponent with a username and password. |
java.util.List<ValidationError> |
validateDataSet(NewDataSetDTO newDataset,
java.io.File dataSetFile)
Validate a data set. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DssComponent(IGeneralInformationService service, IRpcServiceFactory dssServiceFactory, java.lang.String sessionTokenOrNull)
service
- A proxy to the openBIS application server.dssServiceFactory
- A proxy to the DSS server.sessionTokenOrNull
- A session token, if the user has already logged in, or null
otherwise.Method Detail |
---|
public static DssComponent tryCreate(java.lang.String user, java.lang.String password, java.lang.String openBISUrl, long timeoutInMillis)
user
- The user namepassword
- The user's passwordopenBISUrl
- The URL to openBIStimeoutInMillis
- network timeout when connecting to remote servicespublic static DssComponent tryCreate(java.lang.String sessionToken, java.lang.String openBISUrl, long timeoutInMillis)
sessionToken
- The session token provided by authenticationopenBISUrl
- The URL to openBIStimeoutInMillis
- network timeout when connecting to remote servicespublic java.lang.String getSessionToken()
IDssComponent
getSessionToken
in interface IDssComponent
public void checkSession() throws InvalidSessionException
IDssComponent
checkSession
in interface IDssComponent
InvalidSessionException
- If the session is not alive.public IDataSetDss getDataSet(java.lang.String code) throws EnvironmentFailureException, java.lang.IllegalStateException
IDssComponent
getDataSet
in interface IDssComponent
EnvironmentFailureException
- Thrown in cases where it is not possible to connect to
the server.
java.lang.IllegalStateException
- Thrown if the user has not yet been authenticated.public void logout()
IDssComponent
logout
in interface IDssComponent
public IDataSetDss putDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
IDssComponent
putDataSet
in interface IDssComponent
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data
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.public java.util.List<ValidationError> validateDataSet(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
IDssComponent
validateDataSet
in interface IDssComponent
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data
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.public java.util.Map<java.lang.String,java.lang.String> extractMetadata(NewDataSetDTO newDataset, java.io.File dataSetFile) throws java.lang.IllegalStateException, EnvironmentFailureException
IDssComponent
extractMetadata
in interface IDssComponent
newDataset
- The new data set that should be registereddataSetFile
- A file or folder containing the data
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |