@Override
	public AggregateCountsResource retrieve(String name, Date from, Date to, Resolution resolution) {
		Assert.notNull(resolution, "Resolution must not be null");
		DateTime fromParam = (from == null) ? null : new DateTime(from.getTime());
		DateTime toParam = (to == null) ? null : new DateTime(to.getTime());

		String url = resources.get("aggregate-counters").toString() + "/{name}";
		String uriString = UriComponentsBuilder.fromUriString(url).queryParam("resolution", resolution.toString())
				.queryParam("from", fromParam).queryParam("to", toParam).build().toUriString();
		return restTemplate.getForObject(uriString, AggregateCountsResource.class, name);
	}
Implementation of the Aggregate Counter part of the metrics API.

@author Ilayaperumal Gopinathan
@author Paul Harris
spring-xd-rest-client/src/main/java/org/springframework/xd/rest/client/impl/AggregateCounterTemplate.java