public abstract class Module
extends java.util.Observable
Modifier | Constructor and Description |
---|---|
protected |
Module(java.lang.String name)
Superconstructor for modules using this constructor
has no required command line options and no command line input.
|
protected |
Module(java.lang.String[] args,
java.lang.String name)
Superconstructor for modules not requiring command line options.
|
protected |
Module(java.lang.String[] args,
java.lang.String name,
Options options)
Superconstructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
execute()
Performs the actions provieded my the implementing module.
|
protected abstract Options |
getActionOptions(java.lang.String actionName)
Required for the command line help system.
|
java.lang.String[] |
getArgs() |
CommandLine |
getCommandLine() |
java.lang.String |
getModuleName() |
Options |
getOptions() |
void |
notifyListeners(int percent) |
void |
notifyListeners(int processed,
int total) |
void |
notifyListeners(int processed,
int total,
java.lang.String description) |
void |
notifyListeners(int percent,
java.lang.String description) |
void |
notifyListeners(java.lang.String description) |
void |
parseArgs()
Parse the command line and, if requested, print the command line help.
|
protected abstract void |
parseParams()
Method to handle parameter value parsing in subclasses.
|
abstract boolean |
requiresConnection()
Tells the caller if this module requires connection to the repository.
|
protected Module(java.lang.String[] args, java.lang.String name, Options options)
args
- (String[]) Current command lien input.name
- (String) The modules name.options
- (Options) The command line options required by the module.protected Module(java.lang.String[] args, java.lang.String name)
args
- (String[]) Current command lien input.name
- (String) The modules name.protected Module(java.lang.String name)
name
- (String) The modules name.public abstract boolean requiresConnection()
protected abstract void parseParams() throws java.lang.Exception
java.lang.Exception
- Is thrown when command line values fail to pass the required validation.protected abstract Options getActionOptions(java.lang.String actionName) throws java.lang.Exception
actionName
- (String) Name of the submodule called in the command line.java.lang.Exception
- Error retrieving the requestes informations.public abstract void execute() throws java.lang.Exception
java.lang.Exception
- General errror declaration for subclasses.public void notifyListeners(int percent)
public void notifyListeners(java.lang.String description)
public void notifyListeners(int percent, java.lang.String description)
public void notifyListeners(int processed, int total, java.lang.String description)
public void notifyListeners(int processed, int total)
public final CommandLine getCommandLine()
public final Options getOptions()
public final java.lang.String getModuleName()
public final java.lang.String[] getArgs()
public final void parseArgs() throws java.lang.Exception
java.lang.Exception
- Errors that occurred during the validation of the command lien input.