Search in sources :

Example 1 with EtcdKeyDeleteRequest

use of mousio.etcd4j.requests.EtcdKeyDeleteRequest in project camel by apache.

the class EtcdKeysProducer method processDel.

private void processDel(EtcdClient client, String path, boolean dir, Exchange exchange) throws Exception {
    EtcdKeyDeleteRequest request = client.delete(path);
    setRequestTimeout(request, exchange);
    setRequestRecursive(request, exchange);
    if (dir) {
        request.dir();
    }
    try {
        exchange.getIn().setHeader(EtcdConstants.ETCD_NAMESPACE, getNamespace());
        exchange.getIn().setBody(request.send().get());
    } catch (TimeoutException e) {
        throw new ExchangeTimedOutException(exchange, configuration.getTimeout());
    }
}
Also used : EtcdKeyDeleteRequest(mousio.etcd4j.requests.EtcdKeyDeleteRequest) ExchangeTimedOutException(org.apache.camel.ExchangeTimedOutException) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

TimeoutException (java.util.concurrent.TimeoutException)1 EtcdKeyDeleteRequest (mousio.etcd4j.requests.EtcdKeyDeleteRequest)1 ExchangeTimedOutException (org.apache.camel.ExchangeTimedOutException)1