Class ControlCommand
- java.lang.Object
-
- org.apache.zookeeper.server.controller.ControlCommand
-
public class ControlCommand extends Object
Set of commands that this controller can execute. Commands are comprised of an action and an optional parameter specific to that action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ControlCommand.Action
Actions available to the controller
-
Field Summary
Fields Modifier and Type Field Description static String
ENDPOINT
static String
ENDPOINT_PREFIX
-
Constructor Summary
Constructors Constructor Description ControlCommand(ControlCommand.Action action)
ControlCommand(ControlCommand.Action action, String param)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
createCommandUri(ControlCommand.Action action, String parameter)
Create a REST command uri.ControlCommand.Action
getAction()
protected String
getParameter()
static ControlCommand
parseUri(String commandUri)
Parse a Uri into the required Command action and parameter.
-
-
-
Field Detail
-
ENDPOINT
public static final String ENDPOINT
- See Also:
- Constant Field Values
-
ENDPOINT_PREFIX
public static final String ENDPOINT_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ControlCommand
public ControlCommand(ControlCommand.Action action)
-
ControlCommand
public ControlCommand(ControlCommand.Action action, String param)
-
-
Method Detail
-
getAction
public ControlCommand.Action getAction()
-
getParameter
protected String getParameter()
-
createCommandUri
public static String createCommandUri(ControlCommand.Action action, String parameter)
Create a REST command uri.- Parameters:
action
- The 'verb' of the command.parameter
- The optional parameter.- Returns:
- A string to send to the server as the end of the Uri.
-
parseUri
public static ControlCommand parseUri(String commandUri)
Parse a Uri into the required Command action and parameter.- Parameters:
commandUri
- the properly formatted Uri.
-
-