com.github.charlemaznable.vertx.diamond.DiamondZookeeperClusterManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-diamond-config Show documentation
Show all versions of vertx-diamond-config Show documentation
Vertx Configuration Util by Diamond.
The newest version!
package com.github.charlemaznable.vertx.diamond;
import io.vertx.core.json.JsonObject;
import io.vertx.spi.cluster.zookeeper.ZookeeperClusterManager;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.n3r.diamond.client.cache.ParamsAppliable;
import static com.github.charlemaznable.vertx.diamond.VertxDiamondElf.getVertxClusterConfigStoneByApplyParams;
import static org.apache.commons.lang3.StringUtils.isBlank;
@Slf4j
public final class DiamondZookeeperClusterManager extends ZookeeperClusterManager implements ParamsAppliable {
@Override
public void applyParams(String[] params) {
val configStone = getVertxClusterConfigStoneByApplyParams(params);
if (isBlank(configStone)) return; // none diamond or blank diamond or error params
// read diamond stone
try {
this.setConfig(new JsonObject(configStone));
} catch (Exception e) {
log.error("Failed to set config", e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy