30 lines
717 B
Java
30 lines
717 B
Java
|
package eu.mikroskeem.utils.etcdconnector;
|
||
|
|
||
|
import mousio.client.retry.RetryOnce;
|
||
|
import mousio.etcd4j.EtcdClient;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.net.URI;
|
||
|
|
||
|
public class EtcdConnector extends EtcdConnectorBase {
|
||
|
/**
|
||
|
* Sets up EtcdConnector against
|
||
|
* Etcd server with no encryption
|
||
|
*
|
||
|
* @param etcdUrls url(s) where to connect to
|
||
|
*/
|
||
|
public EtcdConnector(URI... etcdUrls) throws IOException {
|
||
|
super();
|
||
|
|
||
|
/* Initialize client */
|
||
|
initClient(etcdUrls);
|
||
|
|
||
|
/* Test client */
|
||
|
testEtcd();
|
||
|
}
|
||
|
|
||
|
@Override void initClient(URI... urls){
|
||
|
etcdClient = new EtcdClient(urls);
|
||
|
etcdClient.setRetryHandler(new RetryOnce(5000));
|
||
|
}
|
||
|
}
|