ZooKeeperMain (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper

## Class ZooKeeperMain

- java.lang.Object
- - org.apache.zookeeper.ZooKeeperMain

-     @InterfaceAudience.Public
      public class ZooKeeperMain
      extends Object

  The command line client to ZooKeeper.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions` | `cl`
    `protected int` | `commandCount`
    `protected int` | `exitCode`
    `protected HashMap<Integer,String>` | `history`
    `protected String` | `host`
    `protected boolean` | `printWatches`
    `protected ZooKeeper` | `zk`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZooKeeperMain(String[] args)`
    `ZooKeeperMain(ZooKeeper zk)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addToHistory(int i, String cmd)` Makes a list of possible completions, either for commands or for zk nodes if the token to complete begins with /
    `protected void` | `connectToZK(String newHost)`
    `void` | `executeLine(String line)`
    `static List<String>` | `getCommands()`
    `boolean` | `getPrintWatches()`
    `protected String` | `getPrompt()`
    `static void` | `main(String[] args)`
    `static void` | `printMessage(String msg)`
    `protected boolean` | `processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)`
    `protected boolean` | `processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cl

          protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions cl

    - #### history

          protected HashMap<Integer,String> history

    - #### commandCount

          protected int commandCount

    - #### printWatches

          protected boolean printWatches

    - #### exitCode

          protected int exitCode

    - #### zk

          protected ZooKeeper zk

    - #### host

          protected String host

  - ### Constructor Detail

    - #### ZooKeeperMain

          public ZooKeeperMain(String[] args)
                        throws IOException,
                               InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### ZooKeeperMain

          public ZooKeeperMain(ZooKeeper zk)

  - ### Method Detail

    - #### getPrintWatches

          public boolean getPrintWatches()

    - #### addToHistory

          protected void addToHistory(int i,
                                      String cmd)

      Makes a list of possible completions, either for commands or for zk nodes if the token to complete begins with /

    - #### getCommands

          public static List<String> getCommands()

    - #### getPrompt

          protected String getPrompt()

    - #### printMessage

          public static void printMessage(String msg)

    - #### connectToZK

          protected void connectToZK(String newHost)
                              throws InterruptedException,
                                     IOException

      Throws:
        `InterruptedException`
        `IOException`

    - #### main

          public static void main(String[] args)
                           throws IOException,
                                  InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### executeLine

          public void executeLine(String line)
                           throws InterruptedException,
                                  IOException

      Throws:
        `InterruptedException`
        `IOException`

    - #### processCmd

          protected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
                                throws IOException,
                                       InterruptedException

      Throws:
        `IOException`
        `InterruptedException`

    - #### processZKCmd

          protected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
                                  throws CliException,
                                         IOException,
                                         InterruptedException

      Throws:
        `CliException`
        `IOException`
        `InterruptedException`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.