edu.ntnu.item.jt.system
Class Frontend

java.lang.Object
  extended by edu.ntnu.item.jt.system.Frontend
Direct Known Subclasses:
GUIFrontend

public class Frontend
extends Object

Provides a frontend to the application for the user. Can be extended to implement new types of UI as they are written (using inheritance and modifying the getInstance() function).

Author:
Jøran Vagnby Lillesand

Field Summary
static boolean debug
           
static int UI_GUI
           
static int UI_SHELL
           
static boolean verbose
           
 
Constructor Summary
protected Frontend()
          Private constructor.
 
Method Summary
 void displayAnalysisToolsResult(ArrayList<DynamicAnalysisResult> results)
           
 void displayError(String message)
          Display errors regarding the system.
 void displayInfo(String message)
          Display information regarding the system.
 void displayScanResults(ArrayList<ScanResult> results)
          Displays the result of a scan to the user.
 void displayUpdateResults(ArrayList<AVUpdateResult> results)
          Display the result of a update operation to the user.
 void displayWarning(String message)
          Display warnings regarding the system.
static Frontend getInstance()
          Getter for the Frontend singleton.
static void main(String[] args)
          Parses input parameters and starts operation appropriately.
 void sleep(int sleepSec)
          This method will sleep for a given amount of seconds, and update the UI every second.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_SHELL

public static final int UI_SHELL
See Also:
Constant Field Values

UI_GUI

public static final int UI_GUI
See Also:
Constant Field Values

debug

public static boolean debug

verbose

public static boolean verbose
Constructor Detail

Frontend

protected Frontend()
Private constructor. Edit: changed to protected due to inheritance. Not an optimal solution, should look into using an interface and a singleton factory

Method Detail

getInstance

public static Frontend getInstance()
Getter for the Frontend singleton. Can be extended to support different UIs.

Returns:
instance of the frontend.

main

public static void main(String[] args)
Parses input parameters and starts operation appropriately.

Parameters:
args - command line arguments.

displayUpdateResults

public void displayUpdateResults(ArrayList<AVUpdateResult> results)
Display the result of a update operation to the user. Should be adjusted to the current UI.

Parameters:
results - a list of AV engine update results.

displayScanResults

public void displayScanResults(ArrayList<ScanResult> results)
Displays the result of a scan to the user. The presentation should be done in a suitable manner for the running UI.

Parameters:
results - list of scan results to be presented.

displayAnalysisToolsResult

public void displayAnalysisToolsResult(ArrayList<DynamicAnalysisResult> results)

displayInfo

public void displayInfo(String message)
Display information regarding the system.

Parameters:
message - the message to be displayed.

displayWarning

public void displayWarning(String message)
Display warnings regarding the system.

Parameters:
message - the message to be displayed.

displayError

public void displayError(String message)
Display errors regarding the system.

Parameters:
message - the message to be displayed.

sleep

public void sleep(int sleepSec)
This method will sleep for a given amount of seconds, and update the UI every second.

Parameters:
sleepSec - The number of seconds to sleep in total.