ping performance
This commit is contained in:
parent
36cd75218e
commit
b774235903
1 changed files with 35 additions and 35 deletions
|
@ -274,53 +274,53 @@ public class ExamAPI_V1_Controller {
|
||||||
.ok()
|
.ok()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// @RequestMapping(
|
|
||||||
// path = API.EXAM_API_PING_ENDPOINT,
|
|
||||||
// method = RequestMethod.POST,
|
|
||||||
// consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
|
||||||
// produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
||||||
// public CompletableFuture<ResponseEntity<String>> ping(
|
|
||||||
// @RequestHeader(name = API.EXAM_API_SEB_CONNECTION_TOKEN, required = true) final String connectionToken,
|
|
||||||
// @RequestParam(name = API.EXAM_API_PING_TIMESTAMP, required = true) final long timestamp,
|
|
||||||
// @RequestParam(name = API.EXAM_API_PING_NUMBER, required = false) final int pingNumber) {
|
|
||||||
//
|
|
||||||
// return CompletableFuture.supplyAsync(
|
|
||||||
// () -> {
|
|
||||||
// final String notifyPing = this.sebClientConnectionService
|
|
||||||
// .notifyPing(connectionToken, timestamp, pingNumber);
|
|
||||||
// if (notifyPing == null) {
|
|
||||||
// return EMPTY_PING_RESPONSE;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return ResponseEntity
|
|
||||||
// .ok()
|
|
||||||
// .body(notifyPing);
|
|
||||||
// },
|
|
||||||
// this.executor);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@RequestMapping(
|
@RequestMapping(
|
||||||
path = API.EXAM_API_PING_ENDPOINT,
|
path = API.EXAM_API_PING_ENDPOINT,
|
||||||
method = RequestMethod.POST,
|
method = RequestMethod.POST,
|
||||||
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
||||||
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||||
public ResponseEntity<String> ping(
|
public CompletableFuture<ResponseEntity<String>> ping(
|
||||||
@RequestHeader(name = API.EXAM_API_SEB_CONNECTION_TOKEN, required = true) final String connectionToken,
|
@RequestHeader(name = API.EXAM_API_SEB_CONNECTION_TOKEN, required = true) final String connectionToken,
|
||||||
@RequestParam(name = API.EXAM_API_PING_TIMESTAMP, required = true) final long timestamp,
|
@RequestParam(name = API.EXAM_API_PING_TIMESTAMP, required = true) final long timestamp,
|
||||||
@RequestParam(name = API.EXAM_API_PING_NUMBER, required = false) final int pingNumber) {
|
@RequestParam(name = API.EXAM_API_PING_NUMBER, required = false) final int pingNumber) {
|
||||||
|
|
||||||
final String instruction = this.sebClientConnectionService
|
return CompletableFuture.supplyAsync(
|
||||||
.notifyPing(connectionToken, timestamp, pingNumber);
|
() -> {
|
||||||
|
final String notifyPing = this.sebClientConnectionService
|
||||||
|
.notifyPing(connectionToken, timestamp, pingNumber);
|
||||||
|
if (notifyPing == null) {
|
||||||
|
return EMPTY_PING_RESPONSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (instruction == null) {
|
return ResponseEntity
|
||||||
return EMPTY_PING_RESPONSE;
|
.ok()
|
||||||
}
|
.body(notifyPing);
|
||||||
|
},
|
||||||
return ResponseEntity
|
this.executor);
|
||||||
.ok()
|
|
||||||
.body(instruction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RequestMapping(
|
||||||
|
// path = API.EXAM_API_PING_ENDPOINT,
|
||||||
|
// method = RequestMethod.POST,
|
||||||
|
// consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
|
||||||
|
// produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||||
|
// public ResponseEntity<String> ping(
|
||||||
|
// @RequestHeader(name = API.EXAM_API_SEB_CONNECTION_TOKEN, required = true) final String connectionToken,
|
||||||
|
// @RequestParam(name = API.EXAM_API_PING_TIMESTAMP, required = true) final long timestamp,
|
||||||
|
// @RequestParam(name = API.EXAM_API_PING_NUMBER, required = false) final int pingNumber) {
|
||||||
|
//
|
||||||
|
// final String instruction = this.sebClientConnectionService
|
||||||
|
// .notifyPing(connectionToken, timestamp, pingNumber);
|
||||||
|
//
|
||||||
|
// if (instruction == null) {
|
||||||
|
// return EMPTY_PING_RESPONSE;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return ResponseEntity
|
||||||
|
// .ok()
|
||||||
|
// .body(instruction);
|
||||||
|
// }
|
||||||
|
|
||||||
@RequestMapping(
|
@RequestMapping(
|
||||||
path = API.EXAM_API_EVENT_ENDPOINT,
|
path = API.EXAM_API_EVENT_ENDPOINT,
|
||||||
method = RequestMethod.POST,
|
method = RequestMethod.POST,
|
||||||
|
|
Loading…
Reference in a new issue