Class ZConfig

java.lang.Object
org.zeromq.ZConfig

public class ZConfig extends Object

Lets applications load, work with, and save configuration files. This is a minimal implementation of the ZeroMQ Property Language, which is a simple structured text format for configuration files.

Here is an example ZPL stream and corresponding config structure:


       context
           iothreads = 1
           verbose = 1      #   Ask for a trace
       main
           type = zqueue    #  ZMQ_DEVICE type
           frontend
               option
                   hwm = 1000
                   swap = 25000000     #  25MB
               bind = 'inproc://addr1'
               bind = 'ipc://addr2'
           backend
               bind = inproc://addr3
  

  
   root                    Down = child
   |                     Across = next
   v
   context-->main
   |         |
   |         v
   |       type=queue-->frontend-->backend
   |                      |          |
   |                      |          v
   |                      |        bind=inproc://addr3
   |                      v
   |                    option-->bind=inproc://addr1-->bind=ipc://addr2
   |                      |
   |                      v
   |                    hwm=1000-->swap=25000000
   v
   iothreads=1-->verbose=false

It can put and get values and save and load them to disk:


ZConfig conf = new ZConfig("root", null);
conf.put("/curve/public-key","abcdef");
String val = conf.get("/curve/public-key","fallback-defaultkey");
conf.save("test.cert");
ZConfig loaded = ZConfig.load("test.cert");