org.apache.whirr.cli.command
Class RoleLifecycleCommand
java.lang.Object
org.apache.whirr.command.Command
org.apache.whirr.command.AbstractClusterCommand
org.apache.whirr.cli.command.RoleLifecycleCommand
- Direct Known Subclasses:
- ConfigureServicesCommand, RestartServicesCommand, StartServicesCommand, StopServicesCommand
public abstract class RoleLifecycleCommand
- extends AbstractClusterCommand
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RoleLifecycleCommand
public RoleLifecycleCommand(String name,
String description,
ClusterControllerFactory factory,
ClusterStateStoreFactory stateStoreFactory)
runLifecycleStep
public abstract int runLifecycleStep(ClusterSpec clusterSpec,
ClusterController controller,
joptsimple.OptionSet optionSet)
throws IOException,
InterruptedException
- Implement this method to trigger the relevant role lifecycle action
- Throws:
IOException
InterruptedException
run
public int run(InputStream in,
PrintStream out,
PrintStream err,
List<String> args)
throws Exception
- Specified by:
run
in class Command
- Throws:
Exception
getTargetRolesOrEmpty
protected Set<String> getTargetRolesOrEmpty(joptsimple.OptionSet optionSet)
- Get the list of targeted roles for this command or an empty set
getTargetInstanceIdsOrEmpty
protected Set<String> getTargetInstanceIdsOrEmpty(joptsimple.OptionSet optionSet)
- Get the list of targeted instance IDs for this command or an empty set
printUsage
public void printUsage(PrintStream stream)
throws IOException
- Print a generic usage indication for this class of commands
- Overrides:
printUsage
in class AbstractClusterCommand
- Throws:
IOException
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.