public void handlePost(RestRequest request, RestChannel channel) {
		Map<String,Boolean> agentState = nodeAgent.agentState();
		if(request.param("all") != null){
			Boolean state = request.paramAsBoolean("all", Boolean.FALSE);
			for(String agent: agentState.keySet()){
				nodeAgent.setState(agent, state);
			}
		}else{
			for(String agentName : agentState.keySet()){
				if(request.param(agentName) != null){
					nodeAgent.setState(agentName, request.paramAsBoolean(agentName, Boolean.FALSE));
				}
			}
		}
		
		if(request.param("refreshInterval") != null)
			Configuration.getInstance().put("refreshInterval", request.paramAsLong("refreshInterval", 10L));
		
		try {
			XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
			channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}