class DocumentResource {

    @GET
    @Path("/{id}")
    public Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id) {
        try {
            return Response.ok(queryStore.get(table, id)).build();
        } catch (QueryStoreException ex) {
            logger.error("Get error : ", ex);
            switch (ex.getErrorCode()) {
                case DOCUMENT_NOT_FOUND:
                    return Response.status(Response.Status.NOT_FOUND)
                            .entity(Collections.singletonMap("error", ex.getErrorCode()))
                            .build();
                case DOCUMENT_GET_ERROR:
                default:
                    return Response.serverError()
                            .entity(Collections.singletonMap("error", ex.getErrorCode()))
                            .build();

            }
        }
    }

    public  DocumentResource(QueryStore queryStore);

}