org.objectweb.dsrg.sofa.cushion
Interface ActionInterface

All Known Implementing Classes:
CommitAction, CompileAction, DeleteAction, DeployAction, ExecuteScriptAction, ExportAction, HelpAction, CheckerAction, CheckoutAction, ImportAction, JPFCheckAction, NewAction, OsgiAction, PrepareAssemblyAction, PrepareDeplPlanAction, PrintAction, RemoveAction, RepositoryDumpAction, StatusAction, TagAction, UpdateAction, UploadBundlesAction

public interface ActionInterface

Interface for Cushion actions. When Cushion is invoked it performs an action that is given as the first command-line parameter. These actions comprise 'help', 'new', 'commit', 'checkout', etc. Each action represented by a class implementing this interface. Actions also have to be registered in action-register.xml located in package org.objectweb.dsrg.sofa.cushion.actionreg.

Author:
Tomas Bures <bures@dsrg.mff.cuni.cz>

Field Summary
static int ACTION_ERROR
          Return value of perform(String[], java.io.PrintStream) indicating error during action performing.
static int BAD_PARAMETERS
          Return value of perform(String[], java.io.PrintStream) indicating invalid parameters.
static int NOT_ENOUGH_PARAMETERS
          Return value of perform(String[], java.io.PrintStream) indicating lack of parameters.
static int SUCCESS
          Return value of perform(String[], java.io.PrintStream) indicating success.
static int TOO_MANY_PARAMETERS
          Return value of perform(String[], java.io.PrintStream) indicating too many parameters supplied.
 
Method Summary
 int perform(java.lang.String[] args, java.io.PrintStream out)
          Executes the action.
 void printHelp(java.lang.StringBuffer msg)
          Gives a help message.
 void printUsage(java.lang.StringBuffer msg)
          Gives an usage message.
 

Field Detail

NOT_ENOUGH_PARAMETERS

static final int NOT_ENOUGH_PARAMETERS
Return value of perform(String[], java.io.PrintStream) indicating lack of parameters.

See Also:
Constant Field Values

TOO_MANY_PARAMETERS

static final int TOO_MANY_PARAMETERS
Return value of perform(String[], java.io.PrintStream) indicating too many parameters supplied.

See Also:
Constant Field Values

BAD_PARAMETERS

static final int BAD_PARAMETERS
Return value of perform(String[], java.io.PrintStream) indicating invalid parameters.

See Also:
Constant Field Values

ACTION_ERROR

static final int ACTION_ERROR
Return value of perform(String[], java.io.PrintStream) indicating error during action performing.

See Also:
Constant Field Values

SUCCESS

static final int SUCCESS
Return value of perform(String[], java.io.PrintStream) indicating success.

See Also:
Constant Field Values
Method Detail

printHelp

void printHelp(java.lang.StringBuffer msg)
Gives a help message.

The method is used by action 'help'.

Parameters:
msg - Contains the help message after the invocation of the method.

printUsage

void printUsage(java.lang.StringBuffer msg)
Gives an usage message.

The method is when insufficient parameters were supplied, which is indicated by return value NOT_ENOUGH_PARAMETERS, TOO_MANY_PARAMETERS or BAD_PARAMETERS.

Parameters:
msg - Contains the help message after the invocation of the method.

perform

int perform(java.lang.String[] args,
            java.io.PrintStream out)
Executes the action.

Parameters:
args - Command-line arguments to Cushion (except the first one containing the action name).
out - std output for the task