Skip to content

Commit

Permalink
Merge pull request #6 from qbicsoftware/development
Browse files Browse the repository at this point in the history
Release PR
  • Loading branch information
KochTobi authored Apr 8, 2024
2 parents 97c75f9 + 7c025d1 commit 568f29a
Show file tree
Hide file tree
Showing 73 changed files with 1,899 additions and 359 deletions.
6 changes: 3 additions & 3 deletions measurement-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>life.qbic</groupId>
<artifactId>data-access-server</artifactId>
<artifactId>data-download-server</artifactId>
<version>0.1.0</version>
</parent>

<groupId>life.qbic.data-access</groupId>
<groupId>life.qbic.data-download</groupId>
<artifactId>measurement-provider</artifactId>
<version>0.1.0</version>
<packaging>jar</packaging>
Expand All @@ -23,7 +23,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>life.qbic.data_access.measurement.provider</Automatic-Module-Name>
<Automatic-Module-Name>life.qbic.data_download.measurement.provider</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package life.qbic.data_access.measurements.api;
package life.qbic.data_download.measurements.api;

import static java.util.Objects.requireNonNull;

Expand All @@ -7,12 +7,7 @@
import java.util.StringJoiner;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* A file with data
*/
public class DataFile {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package life.qbic.data_download.measurements.api;

/**
* Information about a file
*/
public record FileInfo(String path, long length, long crc32, long registrationMillis, long lastModifiedMillis) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package life.qbic.data_download.measurements.api;

/**
* A measurement
*/
public record Measurement(MeasurementId id, MeasurementInfo info, MeasurementData data) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package life.qbic.data_download.measurements.api;

import java.io.InputStream;

/**
* Measurement data
*/
public interface MeasurementData {
InputStream stream();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package life.qbic.data_download.measurements.api;

/**
* Provides measurement data given a measurement
*/
public interface MeasurementDataProvider {

MeasurementData loadData(MeasurementId measurementId);

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package life.qbic.data_access.measurements.api;
package life.qbic.data_download.measurements.api;

import java.io.InputStream;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* Reads measurement data
*/
public interface MeasurementDataReader extends AutoCloseable {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package life.qbic.data_access.measurements.api;
package life.qbic.data_download.measurements.api;

public interface MeasurementFinder {
MeasurementInfo findById(MeasurementId measurementId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package life.qbic.data_access.measurements.api;
package life.qbic.data_download.measurements.api;

/**
* The ID of a measurement.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package life.qbic.data_download.measurements.api;

/**
* Information about a measurement
*/
public record MeasurementInfo(long size, int fileCount) {

}
4 changes: 2 additions & 2 deletions measurement-provider/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module life.qbic.data_access.measurements {
exports life.qbic.data_access.measurements.api;
module life.qbic.data_download.measurements {
exports life.qbic.data_download.measurements.api;
}
8 changes: 4 additions & 4 deletions openbis-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

<parent>
<groupId>life.qbic</groupId>
<artifactId>data-access-server</artifactId>
<artifactId>data-download-server</artifactId>
<version>0.1.0</version>
</parent>

<groupId>life.qbic.data-access</groupId>
<groupId>life.qbic.data-download</groupId>
<artifactId>openbis-connector</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>
Expand Down Expand Up @@ -64,7 +64,7 @@
<classifier>r1700646105</classifier>
</dependency>
<dependency>
<groupId>life.qbic.data-access</groupId>
<groupId>life.qbic.data-download</groupId>
<artifactId>measurement-provider</artifactId>
<version>0.1.0</version>
</dependency>
Expand All @@ -84,7 +84,7 @@
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>life.qbic.data_access.openbis.connector</Automatic-Module-Name>
<Automatic-Module-Name>life.qbic.data_download.openbis.connector</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
Expand Down
8 changes: 4 additions & 4 deletions openbis-connector/src/main/java/deactivated.module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//import life.qbic.data_access.measurements.api.MeasurementDataReader;
//import life.qbic.data_access.openbis.DatasetFileStreamReaderImpl;
//import life.qbic.data_download.measurements.api.MeasurementDataReader;
//import life.qbic.data_download.openbis.DatasetFileStreamReaderImpl;
//
///**
// * TODO!
Expand All @@ -9,8 +9,8 @@
// *
// * @since <version tag>
// */
//module life.qbic.data_access.openbis {
// requires life.qbic.data_access.measurements;
//module life.qbic.data_download.openbis {
// requires life.qbic.data_download.measurements;
// requires spring.context;
// requires spring.beans;
// requires org.slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
package life.qbic.data_access.openbis;
package life.qbic.data_download.openbis;

import ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi;
import ch.ethz.sis.openbis.generic.dssapi.v3.IDataStoreServerApi;
import ch.systemsx.cisd.common.spring.HttpInvokerUtils;
import java.time.Duration;
import java.time.temporal.ChronoUnit;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* A provider for openbis apis v3
*/
public class ApiV3 {

private static final Duration TIMEOUT = Duration.of(5, ChronoUnit.DAYS);

private ApiV3() {
//hide the implicit constructor
}

public static IApplicationServerApi applicationServer(String url) {
return HttpInvokerUtils.createServiceStub(IApplicationServerApi.class, url + IApplicationServerApi.SERVICE_URL, 100_000L);
return HttpInvokerUtils.createServiceStub(IApplicationServerApi.class, url + IApplicationServerApi.SERVICE_URL, TIMEOUT.toMillis());
}
public static IDataStoreServerApi dataStoreServer(String url) {
return HttpInvokerUtils.createStreamSupportingServiceStub(IDataStoreServerApi.class, url + IDataStoreServerApi.SERVICE_URL, 100_000L);
return HttpInvokerUtils.createStreamSupportingServiceStub(IDataStoreServerApi.class, url + IDataStoreServerApi.SERVICE_URL, TIMEOUT.toMillis());
}

}
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package life.qbic.data_access.openbis;
package life.qbic.data_download.openbis;

import static java.util.Objects.nonNull;

import ch.ethz.sis.openbis.generic.asapi.v3.dto.datastore.DataStore;
import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.download.DataSetFileDownload;
import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.download.DataSetFileDownloadReader;
import java.io.InputStream;
import life.qbic.data_access.measurements.api.DataFile;
import life.qbic.data_access.measurements.api.FileInfo;
import life.qbic.data_access.measurements.api.MeasurementDataReader;
import java.util.Optional;
import life.qbic.data_download.measurements.api.DataFile;
import life.qbic.data_download.measurements.api.FileInfo;
import life.qbic.data_download.measurements.api.MeasurementDataReader;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* Reads openbis data streams
*/
public class DatasetFileStreamReaderImpl implements MeasurementDataReader {

private DataSetFileDownloadReader dataSetFileDownloadReader;
public DatasetFileStreamReaderImpl() {
private final String ignoredPrefix;

public DatasetFileStreamReaderImpl(String ignoredPrefix) {
dataSetFileDownloadReader = null;
this.ignoredPrefix = Optional.ofNullable(ignoredPrefix).orElse("");
}


Expand Down Expand Up @@ -56,7 +55,7 @@ public DataFile nextDataFile() {
.toEpochMilli() : -1;
long lastModifiedMillis = nonNull(dataStore) ? dataStore.getModificationDate().toInstant()
.toEpochMilli() : -1;
FileInfo fileInfo = new FileInfo(fileDownload.getDataSetFile().getPath(),
FileInfo fileInfo = new FileInfo(fileDownload.getDataSetFile().getPath().replaceFirst(ignoredPrefix, ""),
fileDownload.getDataSetFile().getFileLength(),
Integer.toUnsignedLong(fileDownload.getDataSetFile().getChecksumCRC32()),
creationMillis,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package life.qbic.data_access.openbis;
package life.qbic.data_download.openbis;

import static java.util.Objects.requireNonNull;
import static java.util.function.Predicate.not;
Expand All @@ -20,23 +20,18 @@
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import life.qbic.data_access.measurements.api.MeasurementData;
import life.qbic.data_access.measurements.api.MeasurementDataProvider;
import life.qbic.data_access.measurements.api.MeasurementFinder;
import life.qbic.data_access.measurements.api.MeasurementId;
import life.qbic.data_access.measurements.api.MeasurementInfo;
import life.qbic.data_access.openbis.SessionFactory.OpenBisSession;
import life.qbic.data_download.measurements.api.MeasurementData;
import life.qbic.data_download.measurements.api.MeasurementDataProvider;
import life.qbic.data_download.measurements.api.MeasurementFinder;
import life.qbic.data_download.measurements.api.MeasurementId;
import life.qbic.data_download.measurements.api.MeasurementInfo;
import life.qbic.data_download.openbis.SessionFactory.OpenBisSession;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* A connector to the openBIS system.
*/
@Component("openbisConnector")
public class OpenBisConnector implements MeasurementFinder, MeasurementDataProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package life.qbic.data_access.openbis;
package life.qbic.data_download.openbis;

import static java.util.Objects.requireNonNull;
import static org.slf4j.LoggerFactory.getLogger;
Expand All @@ -10,12 +10,7 @@
import org.springframework.stereotype.Service;

/**
* TODO!
* <b>short description</b>
*
* <p>detailed description</p>
*
* @since <version tag>
* Creates openbis sessions
*/
@Service("openbisSessionFactory")
public class SessionFactory {
Expand Down
Loading

0 comments on commit 568f29a

Please sign in to comment.