Class ControlCommand
- java.lang.Object
-
- org.apache.zookeeper.server.controller.ControlCommand
-
public class ControlCommand extends java.lang.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 java.lang.String
ENDPOINT
static java.lang.String
ENDPOINT_PREFIX
-
Constructor Summary
Constructors Constructor Description ControlCommand(ControlCommand.Action action)
ControlCommand(ControlCommand.Action action, java.lang.String param)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
createCommandUri(ControlCommand.Action action, java.lang.String parameter)
Create a REST command uri.ControlCommand.Action
getAction()
protected java.lang.String
getParameter()
static ControlCommand
parseUri(java.lang.String commandUri)
Parse a Uri into the required Command action and parameter.
-
-
-
Field Detail
-
ENDPOINT
public static final java.lang.String ENDPOINT
- See Also:
- Constant Field Values
-
ENDPOINT_PREFIX
public static final java.lang.String ENDPOINT_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ControlCommand
public ControlCommand(ControlCommand.Action action)
-
ControlCommand
public ControlCommand(ControlCommand.Action action, java.lang.String param)
-
-
Method Detail
-
getAction
public ControlCommand.Action getAction()
-
getParameter
protected java.lang.String getParameter()
-
createCommandUri
public static java.lang.String createCommandUri(ControlCommand.Action action, java.lang.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(java.lang.String commandUri)
Parse a Uri into the required Command action and parameter.- Parameters:
commandUri
- the properly formatted Uri.
-
-