Zookeeper Configuration

Access to Zookeeper through Commons-Configuration Interface

License

License

Categories

Categories

Configuration Application Layer Libs config
GroupId

GroupId

com.github.ja-fra.zk-configuration
ArtifactId

ArtifactId

zkconfig
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Zookeeper Configuration
Access to Zookeeper through Commons-Configuration Interface
Project URL

Project URL

https://github.com/ja-fra/zk-configuration
Source Code Management

Source Code Management

https://github.com/ja-fra/zk-configuration.git

Download zkconfig

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.ja-fra.zk-configuration/zkconfig/ -->
<dependency>
    <groupId>com.github.ja-fra.zk-configuration</groupId>
    <artifactId>zkconfig</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.ja-fra.zk-configuration/zkconfig/
implementation 'com.github.ja-fra.zk-configuration:zkconfig:0.1.0'
// https://jarcasting.com/artifacts/com.github.ja-fra.zk-configuration/zkconfig/
implementation ("com.github.ja-fra.zk-configuration:zkconfig:0.1.0")
'com.github.ja-fra.zk-configuration:zkconfig:jar:0.1.0'
<dependency org="com.github.ja-fra.zk-configuration" name="zkconfig" rev="0.1.0">
  <artifact name="zkconfig" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.ja-fra.zk-configuration', module='zkconfig', version='0.1.0')
)
libraryDependencies += "com.github.ja-fra.zk-configuration" % "zkconfig" % "0.1.0"
[com.github.ja-fra.zk-configuration/zkconfig "0.1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.zookeeper : zookeeper jar 3.4.5
commons-configuration : commons-configuration jar 1.10
com.google.guava : guava jar 14.0.1
ch.qos.logback : logback-classic jar 1.0.13

runtime (1)

Group / Artifact Type Version
org.slf4j : jcl-over-slf4j jar 1.7.5

test (3)

Group / Artifact Type Version
junit : junit jar 4.11
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

zk-configuration

zk-configuration provides access to a configuration settings stored in a ZooKeeper ensemble via the Commons Configuration API.

Usage

String zkConnection = "localhost:2181"; // ZooKeeper connection string
                                        // use normal zk connection string here
int zkTimeout = 5000; // timeout
                      // used for zkSessionTimeout and initial connectionTimeout
String zkRoot = "/config"; // path where to read/store the configuration
                           // will be (recursively) created as needed.

String key = "my-key";
// Constructor will block until connection is established
Configuration config = new ZookeeperConfiguration(zkConnection, zkTimeout, zkRoot);

// Use the Configuration object like any other Commons-Configuration implementation.
String val = config.getString(key);

config.setProperty(key, "Foo");

config.addProperty(key, "Bar");

List<?> vals = config.getList(key);

config.clearProperty(key);

How to get it

<dependency>
    <groupId>com.github.ja-fra.zk-configuration</groupId>
    <artifactId>zkconfig</artifactId>
    <version>0.1.0</version>
</dependency>

License

zk-configuration is licensed under the Apache Software License, Version 2.0.

Versions

Version
0.1.0