Source:
private CompletionStage<RestResponse> updateTakeOffline(RestRequest request) { NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); String cacheName = request.variables().get("cacheName"); String site = request.variables().get("site"); Cache<?, ?> cache = invocationHelper.getRestCacheManager().getCache(cacheName, request); XSiteAdminOperations xsiteAdmin = cache.getAdvancedCache().getComponentRegistry().getComponent(XSiteAdminOperations.class); if (!xsiteAdmin.checkSite(site)) { return CompletableFuture.completedFuture(responseBuilder.status(NOT_FOUND.code()).build()); } byte[] byteContent = request.contents().rawContent(); if (byteContent == null || byteContent.length == 0) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.BAD_REQUEST.code()).build()); } TakeOfflineConfiguration current = xsiteAdmin.getOfflineStatus(site).getTakeOffline(); TakeOffline takeOffline; try { takeOffline = invocationHelper.getMapper().readValue(byteContent, TakeOffline.class); } catch (IOException e) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR).build()); } if (takeOffline.afterFailures == current.afterFailures() && takeOffline.minTimeToWait == current.minTimeToWait()) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.NOT_MODIFIED.code()).build()); } return CompletableFuture.supplyAsync(() -> { String status = xsiteAdmin.amendTakeOffline(site, takeOffline.afterFailures, takeOffline.minTimeToWait); if (!status.equals(XSiteAdminOperations.SUCCESS)) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR.code()).entity(site); } return responseBuilder.build(); }, invocationHelper.getExecutor()); }

Target:
private CompletionStage<RestResponse> updateTakeOffline(RestRequest request) { NettyRestResponse.Builder responseBuilder = new NettyRestResponse.Builder(); String site = request.variables().get("site"); XSiteAdminOperations xsiteAdmin = getxsiteAdmin(request); if (!xsiteAdmin.checkSite(site)) { return CompletableFuture.completedFuture(responseBuilder.status(NOT_FOUND.code()).build()); } byte[] byteContent = request.contents().rawContent(); if (byteContent == null || byteContent.length == 0) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.BAD_REQUEST.code()).build()); } TakeOfflineConfiguration current = xsiteAdmin.getOfflineStatus(site).getTakeOffline(); TakeOffline takeOffline; try { takeOffline = invocationHelper.getMapper().readValue(byteContent, TakeOffline.class); } catch (IOException e) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.BAD_REQUEST).build()); } if (takeOffline.afterFailures == current.afterFailures() && takeOffline.minTimeToWait == current.minTimeToWait()) { return CompletableFuture.completedFuture(responseBuilder.status(HttpResponseStatus.NOT_MODIFIED.code()).build()); } return CompletableFuture.supplyAsync(() -> { String status = xsiteAdmin.amendTakeOffline(site, takeOffline.afterFailures, takeOffline.minTimeToWait); if (!status.equals(XSiteAdminOperations.SUCCESS)) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR.code()).entity(site); } return responseBuilder.build(); }, invocationHelper.getExecutor()); }