@Override
public ResponseDefinition handleRequest(Request request) {
notifier().info("Received request to " + request.getUrl() + " with body " + request.getBodyAsString());
AdminTask adminTask = AdminTasks.taskFor(request.getMethod(), withoutAdminRoot(request.getUrl()));
return adminTask.execute(admin, request);
}
private static String withoutAdminRoot(String url) {
return url.replace(ADMIN_CONTEXT_ROOT, "");
}