Class CommandBase

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CommandBase​(java.util.List<java.lang.String> names)  
      protected CommandBase​(java.util.List<java.lang.String> names, boolean serverRequired)  
      protected CommandBase​(java.util.List<java.lang.String> names, boolean serverRequired, java.lang.String doc)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDoc()
      A string documenting this command (e.g., what it does, any arguments it takes).
      java.util.Set<java.lang.String> getNames()
      The set of all names that can be used to refer to this command (e.g., "configuration", "config", and "conf").
      java.lang.String getPrimaryName()
      The name that is returned with the command response and that appears in the list of all commands.
      protected CommandResponse initializeResponse()  
      boolean isServerRequired()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.zookeeper.server.admin.Command

        run
    • Constructor Detail

      • CommandBase

        protected CommandBase​(java.util.List<java.lang.String> names)
        Parameters:
        names - The possible names of this command, with the primary name first.
      • CommandBase

        protected CommandBase​(java.util.List<java.lang.String> names,
                              boolean serverRequired)
      • CommandBase

        protected CommandBase​(java.util.List<java.lang.String> names,
                              boolean serverRequired,
                              java.lang.String doc)
    • Method Detail

      • getPrimaryName

        public java.lang.String getPrimaryName()
        Description copied from interface: Command
        The name that is returned with the command response and that appears in the list of all commands. This should be a member of the set returned by getNames().
        Specified by:
        getPrimaryName in interface Command
      • getNames

        public java.util.Set<java.lang.String> getNames()
        Description copied from interface: Command
        The set of all names that can be used to refer to this command (e.g., "configuration", "config", and "conf").
        Specified by:
        getNames in interface Command
      • getDoc

        public java.lang.String getDoc()
        Description copied from interface: Command
        A string documenting this command (e.g., what it does, any arguments it takes).
        Specified by:
        getDoc in interface Command
      • isServerRequired

        public boolean isServerRequired()
        Specified by:
        isServerRequired in interface Command
        Returns:
        true if the command requires an active ZooKeeperServer or a synced peer in order to resolve
      • initializeResponse

        protected CommandResponse initializeResponse()
        Returns:
        A response with the command set to the primary name and the error set to null (these are the two entries that all command responses are required to include).