Class SubmissionController
- java.lang.Object
-
- app.coronawarn.server.services.submission.controller.SubmissionController
-
@RestController @RequestMapping("/version/v1") @Validated public class SubmissionController extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
SUBMISSION_ROUTE
The route to the submission endpoint (version agnostic).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getFakeDelay()
Gets the current fake delay.void
persistDiagnosisKeysPayload(SubmissionPayload protoBufDiagnosisKeys)
Persists the diagnosis keys contained in the specified request payload.org.springframework.web.context.request.async.DeferredResult<org.springframework.http.ResponseEntity<Void>>
submitDiagnosisKey(SubmissionPayload exposureKeys, Integer fake, String tan)
Handles diagnosis key submission requests.
-
-
-
Field Detail
-
SUBMISSION_ROUTE
public static final String SUBMISSION_ROUTE
The route to the submission endpoint (version agnostic).- See Also:
- Constant Field Values
-
-
Method Detail
-
submitDiagnosisKey
@PostMapping("/diagnosis-keys") public org.springframework.web.context.request.async.DeferredResult<org.springframework.http.ResponseEntity<Void>> submitDiagnosisKey(@ValidSubmissionPayload @RequestBody SubmissionPayload exposureKeys, @RequestHeader("cwa-fake") Integer fake, @RequestHeader("cwa-authorization") String tan)
Handles diagnosis key submission requests.- Parameters:
exposureKeys
- The unmarshalled protocol buffers submission payload.fake
- A header flag, marking fake requests.tan
- A tan for diagnosis verification.- Returns:
- An empty response body.
-
persistDiagnosisKeysPayload
public void persistDiagnosisKeysPayload(SubmissionPayload protoBufDiagnosisKeys)
Persists the diagnosis keys contained in the specified request payload.- Parameters:
protoBufDiagnosisKeys
- Diagnosis keys that were specified in the request.- Throws:
IllegalArgumentException
- in case the given collection contains null.
-
getFakeDelay
public Double getFakeDelay()
Gets the current fake delay. Used for monitoring.- Returns:
- the current fake delay
-
-