use of org.infinispan.tasks.TaskManager in project infinispan by infinispan.
the class LoggingResource method setLogger.
private CompletionStage<RestResponse> setLogger(RestRequest request) {
TaskManager taskManager = invocationHelper.getServer().getTaskManager();
String loggerName = request.variables().get("loggerName");
String level = request.getParameter("level");
List<String> appenders = request.parameters().get("appender");
if (level == null && appenders == null) {
return completedFuture(new NettyRestResponse.Builder().status(HttpResponseStatus.BAD_REQUEST).build());
}
return taskManager.runTask("@@logging@set", new TaskContext().addOptionalParameter("loggerName", loggerName).addOptionalParameter("level", level).addOptionalParameter("appenders", appenders).subject(request.getSubject())).handle((o, t) -> handle(t));
}
Aggregations