class SearchAttributesCommand implements CommandHasRequest<SearchAttributesRequest, SearchAttributesResponse> {

	@Override
	public void execute(SearchAttributesRequest request, SearchAttributesResponse response) throws Exception {
		String layerId = request.getLayerId();
		if (null == layerId) {
			throw new GeomajasException(ExceptionCode.PARAMETER_MISSING, "layer");
		}

		Filter filter = Filter.INCLUDE;
		if (request.getFilter() != null) {
			filter = filterService.parseFilter(request.getFilter());
		}

		List<Attribute<?>> attributes = layerService.getAttributes(layerId, request.getAttributePath(), filter);
		response.setAttributes(attributes);
	}

}