Class ZookeeperNodeRegister


  • public class ZookeeperNodeRegister
    extends Object
    A register which is used to register a node to an ephemeral node.
    Author:
    DigitalSonic
    • Constructor Detail

      • ZookeeperNodeRegister

        public ZookeeperNodeRegister()
    • Method Detail

      • init

        public void init()
        Init a CuratorFramework if there's no CuratorFramework provided.
      • register

        public boolean register​(String nodeId,
                                List<ZookeeperNodeInfo> payload)
        Register a Node which has a Properties as the payload.
         CAUTION: only one node can be registered,
                  if you want to register another one,
                  call deregister first
         
        Parameters:
        payload - The information used to generate the payload Properties
        Returns:
        true, register successfully; false, skip the registeration
      • deregister

        public void deregister()
        Close the current GroupMember.
      • setClient

        public void setClient​(org.apache.curator.framework.CuratorFramework client)
      • getClient

        public org.apache.curator.framework.CuratorFramework getClient()
      • getZkConnectString

        public String getZkConnectString()
      • setZkConnectString

        public void setZkConnectString​(String zkConnectString)
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)