Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Acceptance validation on the range of data being requested
- acceptableInterval(from, to, DeviceParameters.from(paramId).getResolution())
- .fold(
- failure -> asyncResponse
- .resume(status(422)
- .entity(asErrorReply(failure))
- .build())
- ,
- accepted -> runAsync(() -> {
- final OptionalLong deployment = activeDeploymentFrom(request);
- if (deployment.isPresent()) {
- log.info("Active deployment found within request: {}", deployment.getAsLong());
- FetchCriteria criteria = ... //Some fetching criteria is created
- readings
- .fetch(criteria)
- .thenApplyAsync(outcome -> replyWith(outcome.mapR(asApiReadings), asyncResponse), executor)
- .exceptionally(asyncResponse::resume);
- } else {
- log.warn("No active deployment nor subject was found within request");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement