@Override
    public void unregisterClient(final Client client, final IAsyncResultHandler<Void> handler) {
        try {
            final Client lclient = lookupClient(client.getOrganizationId(), client.getClientId(), client.getVersion());
            final String id = getClientId(lclient);

            DeleteRequest deleteRequest = new DeleteRequest(getIndexPrefixWithJoiner() + EsConstants.INDEX_CLIENTS)
                    .id(id)
                    .setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);

            DeleteResponse response = getClient().delete(deleteRequest, RequestOptions.DEFAULT);
            if (response.status().equals(RestStatus.OK)) {
                handler.handle(AsyncResultImpl.create((Void) null));
            } else {
                handler.handle(AsyncResultImpl.create(new ClientNotFoundException(Messages.i18n.format("EsRegistry.ClientNotFound")))); //$NON-NLS-1$
            }
        } catch (IOException e) {
            handler.handle(AsyncResultImpl.create(new PublishingException(Messages.i18n.format("EsRegistry.ErrorUnregisteringClient"), e), Void.class)); //$NON-NLS-1$
        } catch (RuntimeException e) {
            handler.handle(AsyncResultImpl.create(e));
        }
    }
@see io.apiman.gateway.engine.IRegistry#unregisterClient(io.apiman.gateway.engine.beans.Client, io.apiman.gateway.engine.async.IAsyncResultHandler)
gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/EsRegistry.java