@GET @Path("/namespaces") public void getAllNamespaces(HttpRequest request, HttpResponder responder) throws Exception { // return keytab URI without version responder.sendJson(HttpResponseStatus.OK, GSON.toJson(namespaceAdmin.list().stream() .map(meta -> new NamespaceMeta.Builder(meta).buildWithoutKeytabURIVersion()) .collect(Collectors.toList()))); }
@GET @Path("/namespaces") public void getAllNamespaces(HttpRequest request, HttpResponder responder) throws Exception { // return keytab URI without version responder.sendJson(HttpResponseStatus.OK, GSON.toJson(namespaceAdmin.list().stream() .map(meta -> new NamespaceMeta.Builder(meta).buildWithoutKeytabURIVersion()) .collect(Collectors.toList()))); }
@GET @Path("/namespaces/{namespace-id}") public void getNamespace(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId) throws Exception { // return keytab URI without version NamespaceMeta ns = new NamespaceMeta.Builder(namespaceAdmin.get(new NamespaceId(namespaceId))).buildWithoutKeytabURIVersion(); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(ns)); }
@GET @Path("/namespaces/{namespace-id}") public void getNamespace(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId) throws Exception { // return keytab URI without version NamespaceMeta ns = new NamespaceMeta.Builder(namespaceAdmin.get(new NamespaceId(namespaceId))).buildWithoutKeytabURIVersion(); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(ns)); }