class Consul {

    public boolean writeSessionData(final String name, final String data, final String sessionId) {
        final Response response = httpClient
                .target(endpoint)
                .path("/v1/kv/").path(name)
                .queryParam("acquire", sessionId)
                .request()
                .put(Entity.text(data));
        if (response.getStatus() != Response.Status.OK.getStatusCode()) {
            LOG.log(Level.WARNING, "Could not write value " + name + "=" + data
                    + " for session " + sessionId + " got response " + response.getStatus()
                    + " but expected 200. Consul Agent says " + response.readEntity(String.class));
            return false;
        }
        if (response.readEntity(String.class).equals("true")) {
            return true;
        }
        return false;
    }

    public  Consul(final String endpoint);

}