Class DataSet
- java.lang.Object
-
- ch.systemsx.cisd.openbis.dss.client.api.v1.DataSet
-
public class DataSet extends java.lang.Object
A class that provides uniform access to data set metadata (from the openBIS AS) and data (from the openBIS DSS).
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DataSet()
DataSet(IOpenbisServiceFacade facade, IDssComponent dssComponent, DataSet metadata, IDataSetDss dataSetDss)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.util.List<java.lang.String>
getChildrenCodes()
java.lang.String
getCode()
java.util.List<DataSet>
getContainedDataSets()
java.util.List<DataSet>
getContainerDataSets()
DataSet
getContainerOrNull()
Deprecated.IDataSetDss
getDataSetDss()
Internal accessor, made public for testing, but clients should not need it.java.lang.String
getDataSetTypeCode()
java.lang.String
getExperimentIdentifier()
ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem
getExternalDataManagementSystem()
java.lang.String
getExternalDataSetCode()
java.lang.String
getExternalDataSetLink()
java.io.InputStream
getFile(java.lang.String path)
java.io.File
getLinkOrCopyOfContent(java.lang.String overrideStoreRootPathOrNull, java.io.File downloadDir, java.lang.String pathInDataSet)
java.io.File
getLinkOrCopyOfContents(java.lang.String overrideStoreRootPathOrNull, java.io.File downloadDir)
java.util.List<java.lang.String>
getParentCodes()
DataSet
getPrimaryDataSetOrNull()
Returns the primary data set.java.util.HashMap<java.lang.String,java.lang.String>
getProperties()
java.util.Date
getRegistrationDate()
java.util.EnumSet<DataSet.Connections>
getRetrievedConnections()
java.lang.String
getSampleIdentifierOrNull()
java.lang.String
getSessionURLForFile(java.lang.String path)
java.lang.String
getURLForFileWithTimeout(java.lang.String path, long validityDurationInSeconds)
int
hashCode()
boolean
isContainerDataSet()
boolean
isLinkDataSet()
boolean
knowsContainer()
Returnstrue
, if result ofgetContainerOrNull()
can be trusted andfalse
, if it cannot be trusted because the server is too old to deliver this information.FileInfoDssDTO[]
listFiles(java.lang.String startPath, boolean isRecursive)
java.lang.String
toString()
java.lang.String
tryGetInternalPathInDataStore()
java.io.File
tryLinkToContents(java.lang.String overrideStoreRootPathOrNull)
-
-
-
Constructor Detail
-
DataSet
protected DataSet()
-
DataSet
public DataSet(IOpenbisServiceFacade facade, IDssComponent dssComponent, DataSet metadata, IDataSetDss dataSetDss)
Constructor.- Parameters:
facade
- The facade used to get access to the server.metadata
- The metadata. May be null if not available at construction time.dataSetDss
- The data. May be null if not available at construction time.
-
-
Method Detail
-
getCode
public java.lang.String getCode()
- See Also:
DataSet.getCode()
-
getExperimentIdentifier
public java.lang.String getExperimentIdentifier()
- See Also:
DataSet.getExperimentIdentifier()
-
getSampleIdentifierOrNull
public java.lang.String getSampleIdentifierOrNull()
- See Also:
DataSet.getSampleIdentifierOrNull()
-
getDataSetTypeCode
public java.lang.String getDataSetTypeCode()
- See Also:
DataSet.getDataSetTypeCode()
-
getRegistrationDate
public java.util.Date getRegistrationDate()
- See Also:
DataSet.getRegistrationDate()
-
getProperties
public java.util.HashMap<java.lang.String,java.lang.String> getProperties()
- See Also:
DataSet.getProperties()
-
getRetrievedConnections
public java.util.EnumSet<DataSet.Connections> getRetrievedConnections()
- See Also:
DataSet.getRetrievedConnections()
-
getParentCodes
public java.util.List<java.lang.String> getParentCodes()
- See Also:
DataSet.getParentCodes()
-
getChildrenCodes
public java.util.List<java.lang.String> getChildrenCodes()
- See Also:
DataSet.getChildrenCodes()
-
isContainerDataSet
public boolean isContainerDataSet()
- See Also:
DataSet.isContainerDataSet()
-
isLinkDataSet
public boolean isLinkDataSet()
- See Also:
DataSet.isLinkDataSet()
-
getExternalDataSetCode
public java.lang.String getExternalDataSetCode()
- See Also:
DataSet.getExternalDataSetCode()
-
getExternalDataSetLink
public java.lang.String getExternalDataSetLink()
- See Also:
DataSet.getExternalDataSetLink()
-
getExternalDataManagementSystem
public ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalDataManagementSystem getExternalDataManagementSystem()
-
getContainerOrNull
@Deprecated public DataSet getContainerOrNull()
Deprecated.- See Also:
DataSet.getContainerOrNull()
-
knowsContainer
public boolean knowsContainer()
Returnstrue
, if result ofgetContainerOrNull()
can be trusted andfalse
, if it cannot be trusted because the server is too old to deliver this information.
-
getContainedDataSets
public java.util.List<DataSet> getContainedDataSets()
- See Also:
DataSet.getContainedDataSets()
-
getContainerDataSets
public java.util.List<DataSet> getContainerDataSets()
- See Also:
DataSet.getContainerDataSets()
-
getPrimaryDataSetOrNull
public DataSet getPrimaryDataSetOrNull()
Returns the primary data set. For a non-container data set, this is itself. For a container data set, this is the one contained data set that is considered primary.- Returns:
- The data set that is considered primary, or null if the primary data set cannot be determined.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
DataSet.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
DataSet.hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
DataSet.toString()
-
listFiles
public FileInfoDssDTO[] listFiles(java.lang.String startPath, boolean isRecursive) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Parameters:
startPath
-isRecursive
-- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.listFiles(java.lang.String, boolean)
-
getFile
public java.io.InputStream getFile(java.lang.String path) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Parameters:
path
-- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.getFile(java.lang.String)
-
tryLinkToContents
public java.io.File tryLinkToContents(java.lang.String overrideStoreRootPathOrNull) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Parameters:
overrideStoreRootPathOrNull
-- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.tryLinkToContents(java.lang.String)
-
getLinkOrCopyOfContents
public java.io.File getLinkOrCopyOfContents(java.lang.String overrideStoreRootPathOrNull, java.io.File downloadDir) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Parameters:
overrideStoreRootPathOrNull
-downloadDir
-- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.getLinkOrCopyOfContents(java.lang.String, java.io.File)
-
getLinkOrCopyOfContent
public java.io.File getLinkOrCopyOfContent(java.lang.String overrideStoreRootPathOrNull, java.io.File downloadDir, java.lang.String pathInDataSet) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Parameters:
overrideStoreRootPathOrNull
-downloadDir
-pathInDataSet
-- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.getLinkOrCopyOfContent(java.lang.String, java.io.File, java.lang.String)
-
getSessionURLForFile
public java.lang.String getSessionURLForFile(java.lang.String path) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.getSessionURLForFile(java.lang.String)
-
getURLForFileWithTimeout
public java.lang.String getURLForFileWithTimeout(java.lang.String path, long validityDurationInSeconds) throws java.lang.IllegalArgumentException, ch.systemsx.cisd.common.exceptions.InvalidSessionException
- Throws:
java.lang.IllegalArgumentException
ch.systemsx.cisd.common.exceptions.InvalidSessionException
- See Also:
IDataSetDss.getURLForFileWithTimeout(String, long)
-
tryGetInternalPathInDataStore
public java.lang.String tryGetInternalPathInDataStore()
-
getDataSetDss
public IDataSetDss getDataSetDss()
Internal accessor, made public for testing, but clients should not need it.
-
-