Class ZookeeperNodeRegister

java.lang.Object
com.alibaba.druid.pool.ha.node.ZookeeperNodeRegister

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

    • ZookeeperNodeRegister

      public ZookeeperNodeRegister()
  • Method Details

    • 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.
    • destroy

      public void destroy()
      See Also:
    • 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)