class GeometryBufferCommand implements CommandHasRequest<GeometryBufferRequest, GeometryBufferResponse> {

	@Override
	public void execute(GeometryBufferRequest request, GeometryBufferResponse response) throws Exception {
		List<org.geomajas.geometry.Geometry> clientGeometries = request.getGeometries();
		if (clientGeometries == null || clientGeometries.size() == 0) {
			throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "request");
		}

		// Convert to internal, apply buffer and convert back to DTO
		List<org.geomajas.geometry.Geometry> result = new ArrayList<org.geomajas.geometry.Geometry>();
		double buffer = request.getBufferDistance();
		int quadrantSegments = request.getQuadrantSegments();
		for (Geometry clientGeometry : clientGeometries) {
			result.add(converter.toDto(converter.toInternal(clientGeometry).buffer(buffer, quadrantSegments)));
		}
		response.setGeometries(result);
	}

}