public class CLI
extends java.lang.Object
implements java.lang.Runnable
CLIParser
class for parsing the user input.Modifier and Type | Field and Description |
---|---|
protected ExtractionController |
controller |
Constructor and Description |
---|
CLI(ExtractionController controller)
Constructor called by the
ExtractionController to start the
command line interface at application start. |
Modifier and Type | Method and Description |
---|---|
protected void |
addFile(java.lang.String filePath)
Add a file to the default profile
|
protected void |
addFileToProfile(java.lang.String file,
java.lang.String profileUUID)
|
protected void |
addModuleToProfile(java.lang.String moduleName,
java.lang.String profileUUID)
Adds an to a
Profile , when the
user types "addModule [MODULE] [PROFILE_UUID]" whereas [MODULE] is the
name of the GenericModule that serves as template for the
AbstractModule . |
void |
createProfileFromTemplate(java.lang.String[] args)
Creates a
Profile from a ProfileTemplate , when the user
types "template2profile [TEMPLATE_NAME]" |
protected void |
enableModule(java.lang.String moduleName,
java.lang.String profileUUID,
boolean enable)
TODO: problem if there are more then one modules with the same name,
because of the identification via module name.
|
protected void |
enableProfile(java.lang.String profileUUID,
boolean enable)
Enables or disables a
Profile , when the user types
"enable [PROFILE_UUID]". |
protected void |
removeFileFromProfile(java.lang.String file,
java.lang.String profileUUID)
|
void |
removeModuleFromProfile(java.lang.String moduleName,
java.lang.String profileUUID)
TODO: problem if there are more then one modules with the same name,
because of the identification via module name.
|
void |
run()
run method of the cli thread that prints continuously the prompt and
executes entered user commands.
|
protected void |
selectAll(java.lang.String profileUUID,
boolean enable)
Method called to enable or disable all
AbstractModule s belonging
to a Profile . |
protected void |
showDescription(java.lang.String moduleName)
Shows the description of a
GenericModule , if the user types
"module [MODULE]" |
void |
showModuleConfiguration(java.lang.String moduleName,
java.lang.String profileUUID)
TODO: problem if there are more then one modules with the same name,
because of the identification via module name.
|
protected void |
showModules()
Show a list of all available
GenericModule s via CLI, if the
"modules" command is executed. |
protected void |
showProfile(java.lang.String profileUUID)
|
protected void |
showProfiles()
Shows a list of all current
Profile s, when the user types
"profiles". |
void |
showTemplates()
Lists all available
ProfileTemplate s, when the user types
"templates" |
protected void |
status()
Method executed, if the "status" command was entered: View if continuous
extraction and daemon observation is active.
|
protected final ExtractionController controller
public CLI(ExtractionController controller)
ExtractionController
to start the
command line interface at application start.controller
- reference to the applications ExtractionController
public void run()
run
in interface java.lang.Runnable
protected void status()
protected void selectAll(java.lang.String profileUUID, boolean enable)
AbstractModule
s belonging
to a Profile
.profileUUID
- UUID of the Profile
enable
- flag if the modules should be enabled or disabledprotected void addFile(java.lang.String filePath)
filePath
- path to the file that should be addedprotected void showModules()
GenericModule
s via CLI, if the
"modules" command is executed.protected void showProfiles()
Profile
s, when the user types
"profiles".protected void showProfile(java.lang.String profileUUID)
UUID
- protected void removeFileFromProfile(java.lang.String file, java.lang.String profileUUID)
protected void addFileToProfile(java.lang.String file, java.lang.String profileUUID)
protected void enableModule(java.lang.String moduleName, java.lang.String profileUUID, boolean enable)
AbstractModule
, when the
user types "select [MODULE] [PROFILE_UUID]" or
"unselect [MODULE] [PROFILE_UUID]"moduleName
- name of the moduleprofileUUID
- UUID of the Profile
where the module belongs toenable
- flags whether the module should be enabled or disabled.protected void showDescription(java.lang.String moduleName)
GenericModule
, if the user types
"module [MODULE]"moduleName
- protected void addModuleToProfile(java.lang.String moduleName, java.lang.String profileUUID)
Profile
, when the
user types "addModule [MODULE] [PROFILE_UUID]" whereas [MODULE] is the
name of the GenericModule
that serves as template for the
AbstractModule
.moduleName
- name of the template GenericModule
profileUUID
- UUID of the Profile
where the module should be added.public void removeModuleFromProfile(java.lang.String moduleName, java.lang.String profileUUID)
AbstractModule
form a Profile
when the user
types "removeModule [MODULE] [PROFILE_UUID]"moduleName
- profileUUID
- public void showModuleConfiguration(java.lang.String moduleName, java.lang.String profileUUID)
AbstractModule
when the user types
"show [MODULE] [PROFILE_UUID]"moduleName
- name of the moduleprofileUUID
- UUID of the Profile
where the module belongs toprotected void enableProfile(java.lang.String profileUUID, boolean enable)
Profile
, when the user types
"enable [PROFILE_UUID]".profileUUID
- UUID of the profile, given by the userenable
- flag if the profile should be enabled, or disabled.public void showTemplates()
ProfileTemplate
s, when the user types
"templates"public void createProfileFromTemplate(java.lang.String[] args)
Profile
from a ProfileTemplate
, when the user
types "template2profile [TEMPLATE_NAME]"args
- user enter separated by spaces