Class CommandBase
- java.lang.Object
-
- org.apache.zookeeper.server.admin.CommandBase
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
GetCommand,PostCommand
public abstract class CommandBase extends Object implements Command
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommandBase(List<String> names)protectedCommandBase(List<String> names, boolean serverRequired)protectedCommandBase(List<String> names, boolean serverRequired, AuthRequest authRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthRequestgetAuthRequest()Set<String>getNames()The set of all names that can be used to refer to this command (e.g., "configuration", "config", and "conf").StringgetPrimaryName()The name that is returned with the command response and that appears in the list of all commands.protected CommandResponseinitializeResponse()booleanisServerRequired()
-
-
-
Constructor Detail
-
CommandBase
protected CommandBase(List<String> names)
- Parameters:
names- The possible names of this command, with the primary name first.
-
CommandBase
protected CommandBase(List<String> names, boolean serverRequired, AuthRequest authRequest)
-
-
Method Detail
-
getPrimaryName
public String getPrimaryName()
Description copied from interface:CommandThe 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:
getPrimaryNamein interfaceCommand
-
getNames
public Set<String> getNames()
Description copied from interface:CommandThe set of all names that can be used to refer to this command (e.g., "configuration", "config", and "conf").
-
isServerRequired
public boolean isServerRequired()
- Specified by:
isServerRequiredin interfaceCommand- Returns:
- true if the command requires an active ZooKeeperServer or a synced peer in order to resolve
-
getAuthRequest
public AuthRequest getAuthRequest()
- Specified by:
getAuthRequestin interfaceCommand- Returns:
- AuthRequest associated to the command. Null means auth check is not required.
-
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).
-
-