@POST @Path("/data/datasets/{name}/admin/exists") public void exists(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("name") String instanceName) { propagateUserId(request); NamespaceId namespace = new NamespaceId(namespaceId); try { DatasetId instanceId = namespace.dataset(instanceName); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(new DatasetAdminOpResponse(datasetAdminService.exists(instanceId), null))); } catch (NotFoundException e) { LOG.debug("Got handler exception", e); responder.sendString(HttpResponseStatus.NOT_FOUND, StringUtils.defaultIfEmpty(e.getMessage(), "")); } catch (Exception e) { LOG.error(getAdminOpErrorMessage("exists", instanceName), e); responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR, getAdminOpErrorMessage("exists", instanceName)); } }
@POST @Path("/data/datasets/{name}/admin/exists") public void exists(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("name") String instanceName) { propagateUserId(request); NamespaceId namespace = new NamespaceId(namespaceId); try { DatasetId instanceId = namespace.dataset(instanceName); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(new DatasetAdminOpResponse(datasetAdminService.exists(instanceId), null))); } catch (NotFoundException e) { LOG.debug("Got handler exception", e); responder.sendString(HttpResponseStatus.NOT_FOUND, StringUtils.defaultIfEmpty(e.getMessage(), "")); } catch (Exception e) { LOG.error(getAdminOpErrorMessage("exists", instanceName), e); responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR, getAdminOpErrorMessage("exists", instanceName)); } }