org.ow2.jasmine.probe.shell
Class JasmineProbeCommand

java.lang.Object
  extended by org.ow2.jasmine.probe.shell.JasmineProbeCommand
Direct Known Subclasses:
IndicatorCreateCommand, IndicatorListCommand, IndicatorRemoveCommand, OutputCreateCommand, OutputListCommand, OutputRemoveCommand, ProbeCreateCommand, ProbeListCommand, ProbeRemoveCommand, ProbeStartCommand, ProbeStopCommand, TargetCreateCommand, TargetListCommand, TargetRemoveCommand

public abstract class JasmineProbeCommand
extends java.lang.Object

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

Author:
danesa

Constructor Summary
JasmineProbeCommand()
           
 
Method Summary
protected  void createIndicator(java.lang.String commandName, org.ow2.jasmine.probe.JasmineIndicator indicator, java.io.PrintStream out, java.io.PrintStream err)
           
abstract  java.lang.String getName()
           
 JasmineProbeCommandParams getParams()
           
abstract  org.ow2.jasmine.probe.JasmineProbeManager getProbeManager()
           
 java.lang.String getProperties()
          By default, there are no properties.
 java.lang.String getRequiredOptions()
          To be extended by commands having required options
 java.lang.String getUsage()
          Returns the usage string for the command.
protected  boolean parseOptions(java.lang.String line, java.io.PrintStream out, java.io.PrintStream err)
          Called by all the commands that have parameters
protected  java.util.Map<java.lang.String,java.lang.String> parseProperties(java.util.Collection<org.ow2.jasmine.probe.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(java.lang.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 java.lang.String getName()

getProbeManager

public abstract org.ow2.jasmine.probe.JasmineProbeManager getProbeManager()

setParams

public void setParams(JasmineProbeCommandParams params)

getParams

public JasmineProbeCommandParams getParams()

parseOptions

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

Parameters:
line -
out -
err -
Returns:

getProperties

public java.lang.String getProperties()
By default, there are no properties. To be extended by the sub-class corresponding to commands with properties.

Returns:

getUsage

public java.lang.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 java.lang.String getRequiredOptions()
To be extended by commands having required options

Returns:

parseProperties

protected java.util.Map<java.lang.String,java.lang.String> parseProperties(java.util.Collection<org.ow2.jasmine.probe.JasminePropertyInfo> propsInfo,
                                                                           JasmineProbeCommandParams params)
                                                                    throws org.ow2.jasmine.probe.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:
org.ow2.jasmine.probe.JasmineProbeException

validParam

protected boolean validParam(java.lang.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(java.lang.String commandName,
                               org.ow2.jasmine.probe.JasmineIndicator indicator,
                               java.io.PrintStream out,
                               java.io.PrintStream err)


Copyright © 2011 OW2 Consortium. All Rights Reserved.