Skip to content

Commit be55105

Browse files
authored
Provide API for querying experiment information (#1121)
* Provide API for querying experiment information * Throw runtime exception
1 parent 87cd24c commit be55105

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

project-management/src/main/java/life/qbic/projectmanagement/application/api/AsyncProjectService.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ public interface AsyncProjectService {
110110
* the throw section below.
111111
*
112112
* @param request the actual {@link ProjectDeletionRequest}
113-
* @return a {@link Mono<ProjectDeletionResponse>} object publishing an {@link ProjectDeletionResponse} on success.
114-
* Exceptions are provided as {@link Mono#error(Throwable)}
113+
* @return a {@link Mono<ProjectDeletionResponse>} object publishing an
114+
* {@link ProjectDeletionResponse} on success. Exceptions are provided as
115+
* {@link Mono#error(Throwable)}
115116
* @throws UnknownRequestException if an unknown request has been used in the service call
116117
* @throws RequestFailedException if the request was not successfully executed
117118
* @throws AccessDeniedException if the user has insufficient rights
@@ -171,6 +172,22 @@ Mono<ProjectCreationResponse> create(ProjectCreationRequest request)
171172
Flux<ByteBuffer> roCrateSummary(String projectId)
172173
throws RequestFailedException, AccessDeniedException;
173174

175+
/**
176+
* Return a reactive stream of {@link ExperimentDescription} for a given project.
177+
* <p>
178+
* <b>Exceptions</b>
179+
* <p>
180+
* Exceptions are wrapped as {@link Mono#error(Throwable)} and are one of the types described in
181+
* the throw section below.
182+
* @param projectId the identifier of the project to get the experiments for
183+
* @return a {@link Flux} of {@link ExperimentDescription}. Exceptions are provided as
184+
* {@link Mono#error(Throwable)}.
185+
* @throws RequestFailedException in case the request cannot be processed
186+
* @throws AccessDeniedException in case of insufficient rights
187+
* @since 1.10.0
188+
*/
189+
Flux<ExperimentDescription> getExperiments(String projectId);
190+
174191
/**
175192
* Requests {@link SamplePreview} for a given experiment with pagination support.
176193
* <p>
@@ -827,6 +844,7 @@ record SampleRegistrationInformation(
827844
String experimentId,
828845
String projectId
829846
) implements ValidationRequestBody {
847+
830848
}
831849

832850
/**
@@ -866,7 +884,6 @@ record SampleUpdateInformation(
866884
}
867885

868886

869-
870887
record MeasurementRegistrationInformationNGS(
871888
Collection<String> sampleCodes,
872889
String organisationId, String instrumentCURI, String facility,
@@ -875,6 +892,7 @@ record MeasurementRegistrationInformationNGS(
875892
String indexI7, String indexI5,
876893
String comment
877894
) implements ValidationRequestBody {
895+
878896
}
879897

880898
record MeasurementUpdateInformationNGS(
@@ -887,6 +905,7 @@ record MeasurementUpdateInformationNGS(
887905
String sequencingRunProtocol, String samplePoolGroup,
888906
String indexI7, String indexI5,
889907
String comment) implements ValidationRequestBody {
908+
890909
}
891910

892911
record MeasurementRegistrationInformationPxP(
@@ -972,7 +991,9 @@ public ProjectUpdateRequest(String projectId, ProjectUpdateRequestBody requestBo
972991

973992
}
974993

975-
record ProjectDeletionRequest(String projectId, String requestId, ProjectDeletionRequestBody body) {
994+
record ProjectDeletionRequest(String projectId, String requestId,
995+
ProjectDeletionRequestBody body) {
996+
976997
public ProjectDeletionRequest {
977998
if (projectId == null) {
978999
throw new IllegalArgumentException("Project ID cannot be null");

project-management/src/main/java/life/qbic/projectmanagement/application/api/AsyncProjectServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ public Flux<ByteBuffer> roCrateSummary(String projectId) {
160160
original -> writeSecurityContextMany(original, securityContext));
161161
}
162162

163+
@Override
164+
public Flux<ExperimentDescription> getExperiments(String projectId) {
165+
throw new RuntimeException("Not yet implemented");
166+
}
167+
163168
// Requires the SecurityContext to work
164169
private Flux<ByteBuffer> getByteBufferFlux(String projectId) {
165170
var search = projectService.find(projectId);

0 commit comments

Comments
 (0)