Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void transfusion(RequestInitiatingMigration request) {
- URI senderURI = URI.create(request.getSender());
- URI receiverURI = URI.create(request.getReceiver());
- tarantoolClient.graphql(TdgJsonUtils.paginationQuery(request), senderURI.getHost(), senderURI.getPort())
- .onSuccess(httpResp -> {
- List<JsonObject> mutations = TdgJsonUtils.convertToListMutations(httpResp.bodyAsJsonObject(), request);
- String cursor = TdgJsonUtils.getLastCursor(httpResp.bodyAsJsonObject(), request);
- while (!cursor.equals("empty")) {
- JsonObject response = tarantoolClient.graphql(
- TdgJsonUtils.paginationQuery(request, cursor), senderURI.getHost(), senderURI.getPort())
- .result().bodyAsJsonObject();
- mutations.addAll(TdgJsonUtils.convertToListMutations(response, request));
- cursor = TdgJsonUtils.getLastCursor(response, request);
- }
- for (JsonObject mutation : mutations) {
- tarantoolClient.mutation(mutation, receiverURI.getHost(), receiverURI.getPort(), request.getToken());
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement