gerlowskija commented on code in PR #975: URL: https://github.com/apache/solr/pull/975#discussion_r953832066
########## solr/core/src/java/org/apache/solr/handler/configsets/ListConfigSetsAPI.java: ########## @@ -16,34 +16,54 @@ */ package org.apache.solr.handler.configsets; -import static org.apache.solr.client.solrj.SolrRequest.METHOD.GET; -import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_READ_PERM; - -import java.util.List; -import org.apache.solr.api.EndPoint; -import org.apache.solr.client.solrj.SolrResponse; -import org.apache.solr.cloud.OverseerSolrResponse; -import org.apache.solr.common.util.NamedList; +import org.apache.solr.api.JerseyResource; import org.apache.solr.core.CoreContainer; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.response.SolrQueryResponse; +import org.apache.solr.jersey.PermissionName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.HttpHeaders; +import java.lang.invoke.MethodHandles; + +import static org.apache.solr.security.PermissionNameProvider.Name.CONFIG_READ_PERM; /** * V2 API for adding or updating a single file within a configset. * * <p>This API (GET /v2/cluster/configs) is analogous to the v1 /admin/configs?action=LIST command. */ -public class ListConfigSetsAPI extends ConfigSetAPIBase { + +@Path("/cluster/configs") +public class ListConfigSetsAPI extends JerseyResource { + + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + @Context + public HttpHeaders headers; + + private final CoreContainer coreContainer; + + @Inject public ListConfigSetsAPI(CoreContainer coreContainer) { - super(coreContainer); + this.coreContainer = coreContainer; } - @EndPoint(method = GET, path = "/cluster/configs", permission = CONFIG_READ_PERM) - public void listConfigSet(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { - final NamedList<Object> results = new NamedList<>(); - List<String> configSetsList = configSetService.listConfigs(); - results.add("configSets", configSetsList); - SolrResponse response = new OverseerSolrResponse(results); - rsp.getValues().addAll(response.getResponse()); + + @GET + @Produces({"application/json", "application/javabin"}) + @PermissionName(CONFIG_READ_PERM) + public ListConfigsetsResponse listConfigSet() throws Exception { + log.info("CoreContainer={}, HttpHeaders.accept={}", coreContainer, (headers != null) ? headers.getAcceptableMediaTypes() : "null"); Review Comment: Agreed - this PR still has a lot of logging that I've added for myself as I'm working out some of the kinks, but that would have no place in the Solr codebase proper. I'll try to get into the habit of using 'NOCOMMIT' to mark these messages, as you suggested elsewhere. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org