|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.whirr.command.Command org.apache.whirr.command.AbstractClusterCommand
public abstract class AbstractClusterCommand
An abstract command for interacting with clusters.
Field Summary | |
---|---|
protected ClusterControllerFactory |
factory
|
protected joptsimple.OptionParser |
parser
|
protected ClusterStateStoreFactory |
stateStoreFactory
|
Constructor Summary | |
---|---|
AbstractClusterCommand(String name,
String description,
ClusterControllerFactory factory)
|
|
AbstractClusterCommand(String name,
String description,
ClusterControllerFactory factory,
ClusterStateStoreFactory stateStoreFactory)
|
Method Summary | |
---|---|
protected ClusterController |
createClusterController(String serviceName)
Create the specified service |
protected ClusterStateStore |
createClusterStateStore(ClusterSpec spec)
Create the cluster state store object |
protected Cluster |
getCluster(ClusterSpec clusterSpec,
ClusterController controller)
Get the cluster instance together with NodeMetadata (through API calls) |
protected ClusterSpec |
getClusterSpec(joptsimple.OptionSet optionSet)
Load the cluster spec by parsing the command line option set |
protected void |
printErrorAndHelpHint(PrintStream stream,
Throwable e)
Print command execution error and a hint to help the user get more help |
protected void |
printProviderInfo(PrintStream out,
PrintStream err,
ClusterSpec clusterSpec,
joptsimple.OptionSet optionSet)
|
void |
printUsage(PrintStream stream)
Print a generic usage indication for commands |
Methods inherited from class org.apache.whirr.command.Command |
---|
getDescription, getName, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClusterControllerFactory factory
protected ClusterStateStoreFactory stateStoreFactory
protected joptsimple.OptionParser parser
Constructor Detail |
---|
public AbstractClusterCommand(String name, String description, ClusterControllerFactory factory)
public AbstractClusterCommand(String name, String description, ClusterControllerFactory factory, ClusterStateStoreFactory stateStoreFactory)
Method Detail |
---|
protected ClusterSpec getClusterSpec(joptsimple.OptionSet optionSet) throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationException
protected Cluster getCluster(ClusterSpec clusterSpec, ClusterController controller) throws IOException, InterruptedException
IOException
InterruptedException
protected ClusterController createClusterController(String serviceName)
protected ClusterStateStore createClusterStateStore(ClusterSpec spec)
protected void printProviderInfo(PrintStream out, PrintStream err, ClusterSpec clusterSpec, joptsimple.OptionSet optionSet)
protected void printErrorAndHelpHint(PrintStream stream, Throwable e)
public void printUsage(PrintStream stream) throws IOException
printUsage
in class Command
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |