org.ow2.jasmine.probe.shell
Class JasmineProbeCommand

java.lang.Object
  extended by org.ow2.jasmine.probe.shell.JasmineProbeCommand
Direct Known Subclasses:
IndicatorChangeCommand, IndicatorCreateCommand, IndicatorInfoCommand, IndicatorListCommand, IndicatorPropertiesCommand, IndicatorRemoveCommand, IndicatorTypesCommand, OutputChangeCommand, OutputCreateCommand, OutputListCommand, OutputPropertiesCommand, OutputRemoveCommand, OutputTypesCommand, ProbeChangeCommand, ProbeConfigLoadCommand, ProbeConfigSaveCommand, ProbeCreateCommand, ProbeListCommand, ProbeRemoveCommand, ProbeStartCommand, ProbeStopCommand, TargetCreateCommand, TargetListCommand, TargetRemoveCommand

public abstract class JasmineProbeCommand
extends Object

Common code for all JasmineProbe Commands. Contains command line parsing.

Author:
danesa

Constructor Summary
JasmineProbeCommand()
           
 
Method Summary
protected  void createIndicator(String commandName, JasmineIndicator indicator, PrintStream out, PrintStream err)
           
protected  void createOutput(String commandName, JasmineOutput output, PrintStream out, PrintStream err)
           
abstract  String getName()
           
 JasmineProbeCommandParams getParams()
           
abstract  JasmineProbeManager getProbeManager()
           
 String getRequiredOptions()
          To be extended by commands having required options
 String getUsage()
          Returns the usage string for the command.
protected  boolean parseOptions(String line, PrintStream out, PrintStream err)
          Called by all the commands that have parameters
protected  Map<String,String> parseProperties(Collection<JasminePropertyInfo> propsInfo, JasmineProbeCommandParams params)
          Construct a properties Map, where the keys are property names provided by propsInfo and the values of the properties should be read from the command parameters
 void setParams(JasmineProbeCommandParams params)
           
protected  boolean validParam(String param)
          Verify that the command parameter has the following format : paramName=paramValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasmineProbeCommand

public JasmineProbeCommand()
Method Detail

getName

public abstract String getName()

getProbeManager

public abstract JasmineProbeManager getProbeManager()

setParams

public void setParams(JasmineProbeCommandParams params)

getParams

public JasmineProbeCommandParams getParams()

parseOptions

protected boolean parseOptions(String line,
                               PrintStream out,
                               PrintStream err)
Called by all the commands that have parameters

Parameters:
line -
out -
err -
Returns:

getUsage

public String getUsage()
Returns the usage string for the command. The usage string is a short string that illustrates how to use the command on the command line. This information is used when generating command help information.

Returns:
the usage string for the command.

getRequiredOptions

public String getRequiredOptions()
To be extended by commands having required options

Returns:

parseProperties

protected Map<String,String> parseProperties(Collection<JasminePropertyInfo> propsInfo,
                                             JasmineProbeCommandParams params)
                                      throws JasmineProbeException
Construct a properties Map, where the keys are property names provided by propsInfo and the values of the properties should be read from the command parameters

Parameters:
propsInfo - contains the properties description
params - contains the command parameters
Returns:
the resulting properties map
Throws:
JasmineProbeException

validParam

protected boolean validParam(String param)
Verify that the command parameter has the following format : paramName=paramValue

Parameters:
param -
Returns:
true if format ok, false if the format is wrong

createIndicator

protected void createIndicator(String commandName,
                               JasmineIndicator indicator,
                               PrintStream out,
                               PrintStream err)

createOutput

protected void createOutput(String commandName,
                            JasmineOutput output,
                            PrintStream out,
                            PrintStream err)


Copyright © 2013 OW2 Consortium. All Rights Reserved.