next up previous contents
Next: 4.2 Data Decomposition Up: 4 SAM Detailed Design Previous: 4 SAM Detailed Design   Contents

Subsections

4.1 SAM Class Design

4.1.1 Controller Module

Controller
Description:
The class which is initially loaded when the program runs, and which creates an instance of the main GUI window.
Responsibilities:
This class is responsible for
  1. Creating an instance of the main GUI window class, MainWindow.
  2. Showing this window.
SRS References:
3.2

MainWindow

Description:
Responsible for displaying the main window GUI and handling any events from the main window GUI.
Responsibilities:
This class is responsible for
  1. Drawing the main window of SAM when asked to by the caller.
  2. Delegating sections of the screen to be stream/field/analysis/output selectors.
  3. Maintaining a list of available analysis and output types that can be performed.
  4. When the user selects the ``Open'' menu item, creating a Model object (which contains the stream and data type information) from the filename selected by the user.
  5. When the user selects the ``Create Log'' menu item, passing control to a Logger class to handle the logging.
  6. Once the user has selected a data type/output type/stream combination/analysis type for analysis, directing the Model module to extract the data needed.
  7. Once Model has extracted the data, directing the Analysis module to perform the chosen analysis.
  8. Once analysis has been performed, directing the Output module to output the data as chosen.
  9. Opening the help file when the user selects the ``Help'' menu item.
  10. Creating an AboutDialog class when the user selects the ``About'' menu item.
  11. Creating the online help in a browser when the user selects the ``Online Help'' menu item.
  12. Selecting/deselecting all streams when the user selects the ``Select All Streams''/``Deselect All Streams'' menu items respectively.
  13. Exiting the program when the user selects the ``Exit'' menu item.
  14. Displaying stream names as either IP addresses or domain names, depending on whether the ``Resolve Domain Names'' menu item is not checked or checked, respectively.
  15. Updating the progress bar
SRS References:
3.2.1.1, 3.2.1.2, 3.2.1.3, 3.2.1.5, 3.2.1.6, 3.2.1.8, 3.2.1.9, 3.2.1.10, 5.2.1, 5.2.3, 4.3.4.5

AboutDialog

Description:
Displays an ``About'' dialog box.
Responsibilities:
This class is responsible for
  1. Creating a dialog box containing information about SAM.
  2. Displaying this dialog box when instructed.
  3. Hiding the dialog box when the user clicks on ``Close'' (or equivalent).
SRS References:
5.2.3

Selector

Description:
A generic class that creates a list selector, given a specified container of a window, using a given list of items.
Responsibilities:
This class is responsible for
  1. Displaying to the user the given list of items in the specified container in the calling window.
  2. Allowing the user to select and deselect items from the list.
  3. Returning a list of the currently selected items to the caller.
  4. Clearing the items in the list so none are currently selected.
  5. Selecting all the items in the list (as a shortcut to selecting each item manually, one by one).
  6. Enabling and disabling the list of items so they can or cannot be selected by the user (ie, greying them out).
  7. Enabling and disabling specific list items so they can or cannot be selected by the user (ie, greying them out).
  8. Changing the data displayed on screen, ensuring that any previously selected items are still selected when the view on screen gets changed.

SRS References:
3.2.1.2, 3.2.1.3, 3.2.1.5, 3.2.1.6, 5.2.1, 5.2.3

AnalysisPluginsClass

Description:
Maintains a list of analysis plugins, and runs the plugin when required.
Responsibilities:
This class is responsible for
  1. Loading all plugins found in the analysis directory when loaded (which will include Plot Data, Mean, Variance, Spectral Analysis, Autocorrelation, CDF and PDF at least).
  2. Providing a method for analysis plugins to call to register themselves.
  3. Providing a list of all registered analysis plugins.
  4. Running an analysis plugin when requested.
SRS References:
3.2.1.3, 3.2.1.8, 4.3.3.2

OutputPluginsClass

Description:
Maintains a list of output plugins, and runs the plugin when required.
Responsibilities:
This class is responsible for
  1. Loading all output plugins found in the output directory when loaded (which will include Graphing to screen and file, and Table to screen, and Table to file at least)
  2. Providing a method for output plugins to call to register themselves.
  3. Providing a list of all registered output plugins.
  4. Running an output plugin when requested.
SRS References:
3.2.1.6, 3.2.1.8, 4.3.3.2

FileSelection

Description:
Displays a file selection dialog box to the user and handles events associated with the file selection dialog box.
Responsibilities:
This class is responsible for
  1. Creating a standard GTK+ file opening dialog box.
  2. Displaying it to the user, making sure it is modal (that is, no windows behind it may be selected while it is running).
  3. Returning the filename selected by the user to the calling class
  4. Hiding itself when directed.
SRS References:
3.2.1.1

ErrorHandler

Description:
Displays error messages to the user.
Responsibilities:
This class is responsible for
  1. Given an error message, creating and running an error message dialog box.
  2. Given a warning message, creating and running a warning message dialog box.
  3. Not allowing the user to interact with the rest of SAM until he/she acknowledges the error or warning.
SRS References:
3.2.1.1, 4.4

CustomError

Description:
Allows classes to raise customised exceptions, other than the built-in ones.
Responsibilities:
This class is responsible for
  1. Creating an exception, given an error message describing the exception.
  2. Allowing an optional argument, isWarning, that specifies whether or not the exception should be treated as a warning.
  3. Returning the value of the optional argument.
  4. Returning the error or warning message associated with the exception.
SRS References:
4.4

4.1.2 Model Module

Model
Description:
Provides an overall interface to read a loaded log file and extract the relevant information from it, thus abstracting the input details away from Controller.
Responsibilities:
This class is responsible for
  1. Listing the streams contained within a file.
  2. Listing the fields (data) contained within a file.
  3. Checking headers and fields of NETLOG files, and where necessary parsing the accompanying STREAMSLOG file of a NETLOG file.
  4. Parsing NETLOG files of user selected fields and streams to a Table.
SRS References:
3.2.1.1, 3.2.1.2, 3.2.1.5, 3.2.1.8

NetLogInput

Description:
Parses NETLOG files.
Responsibilities:
This class is responsible for
  1. Checking the header of a file for the fields contained in that file, raising appropriate errors if the file given is not a NETLOG file or is not in correct format.
  2. Parsing a NETLOG file to a table of user specified streams and fields.
SRS References:
3.2.1.1, 3.2.1.2, 3.2.1.5, 3.2.1.8

StreamsLogInput

Description:
Parses STREAMSLOG files.
Responsibilities:
This class is responsible for
  1. Checking the header of the file to ensure it is a valid STREAMSLOG file.
  2. Parsing the STREAMSLOG file to a list of Stream objects.
  3. Adding in the aggregate stream item to the list of Streams returned.
SRS References:
3.2.1.1, 3.2.1.5

4.1.3 Analysis Module

Plot

Description:
An identity analysis plugin, which simply returns the same table back.
Responsibilities:
This class is responsible for
  1. Returning the table given to it untouched.
  2. Registering with the AnalysisPlugins module, with a name of ``No Analysis''.
SRS References:
3.2.1.3a

Fourier

Description:
Provides an analysis plugin which takes a table of data and returns the Fourier transform of the data, using a Fast Fourier Transform.
Responsibilities:
This class is responsible for
  1. Ensuring the data for each field in the table is equally spaced in time by calling LinearInterpolation.
  2. Transforming the data for each field in the table into the Fourier transform of the data.
  3. Registering with the AnalysisPlugins module, with a name of ``Spectral Analysis''.
SRS References:
3.2.1.3d

PDF

Description:
Provides an analysis plugin which returns the Probability Distribution Function (PDF) for a table of data.
Responsibilities:
This class is responsible for
  1. Creating a PdfOptions class which gets the number of bins to be used in performing PDF analysis.
  2. Transforming the data for each field in the table into a new field in the table being produced which contains the PDF of the original field.
  3. Registering with the AnalysisPlugins module, with a name of ``PDF''.
SRS References:
3.2.1.3g, 3.2.1.4

PdfOptions

Description:
Gets the number of bins to be used in PDF analysis from the user, giving default values initially.
Responsibilities:
This class is responsible for
  1. Creating a GUI dialog box and running it, waiting for user input.
  2. Allowing the user to enter the number of bins wanted for PDF analysis, default to 10 bins.
  3. Returning the information to the caller.
SRS References:
3.2.1.4

CDF

Description:
Provides an analysis plugin which returns the Cumulative Distribution Function (CDF) for a table of data.
Responsibilities:
This class is responsible for
  1. Creating a CdfOptions class which gets the number of bins to be used in performing CDF analysis.
  2. Transforming the data for each field in the table into a new field in the table being produced which contains the CDF of the original field.
  3. Registering with the AnalysisPlugins module, with a name of ``CDF''.
SRS References:
3.2.1.3f, 3.2.1.4

CdfOptions

Description:
Gets the number of bins to be used in CDF analysis from the user, giving default values initially.
Responsibilities:
This class is responsible for
  1. Creating a GUI dialog box and running it, waiting for user input.
  2. Allowing the user to enter the number of bins wanted for CDF analysis, default to 10 bins.
  3. Returning the information to the caller.
SRS References:
3.2.1.4

LinearInterpolation

Description:
Provides an analysis plugin which returns the linear interpolation of a table of data, to be used by AutoCorrelation and Fourier.
Responsibilities:
This class is responsible for
  1. If the time intervals of the data given are not equal, linearly interpolating the data so that the data values are equally spaced in time.
  2. If the time intervals of the data given are equally spaced in time, returning the same table of data.
  3. Registering with the AnalysisPlugins module, with a name of ``LinearInterpolation''.
SRS References:
3.2.1.3d, 3.2.1.3e

AutoCorrelation

Description:
Provides an analysis plugin which returns the AutoCorrelation of a table of data.
Responsibilities:
This class is responsible for
  1. Ensuring the data for each field in the table is equally spaced in time by calling LinearInterpolation.
  2. Transforming the data for each field in the table given into a new table which holds the AutoCorrelation coefficients of the original fields.
  3. Registering with the AnalysisPlugins module, with a name of ``AutoCorrelation''.
SRS References:
3.2.1.3e

Mean

Description:
Provides an analysis plugin which returns the mean of a table of data.
Responsibilities:
This class is responsible for
  1. Transforming the data for each field in the table given into a new field in the table being produced which contains the mean of the original field.
  2. Registering with the AnalysisPlugins module, with a name of ``Mean''.
SRS References:
3.2.1.3b

Variance

Description:
Provides an analysis plugin which returns the variance of a table of data.
Responsibilities:
This class is responsible for
  1. Transforming the data for each field in the table given into a new field in the table being produced which contains the variance of the original field.
  2. Registering with the AnalysisPlugins module, with a name of ``Variance''.
SRS References:
3.2.1.3c

4.1.4 Output Module

ScreenTable

Description:
An output plugin which displays a table to the user as a table using a GUI window.
Responsibilities:
This class is responsible for
  1. Displaying a table to the user in a separate GUI window.
  2. Registering with the OutputPlugins module with the name ``Table to screen''.
  3. Allowing the user to set any options for the table.
SRS References:
3.2.1.6c, 5.2.2

OutputToFile

Description:
An output plugin which writes a table to a file.
Responsibilities:
This class is responsible for
  1. Writing a file containing all the values in the table produced by the Analysis module.
  2. Registering with the OutputPlugins module with the name ``Text File''.
  3. Creating a GUI which allows the user to set any options, including filename and delimiter.
SRS References:
3.2.1.6d, 3.2.1.7

GraphGui

Description:
An output plugin which either displays a graph on the screen, saves it to a file, or outputs the gnuplot commands used to draw the graph along with any necessary data.
Responsibilities:
This class is responsible for
  1. Creating a graph of the values in the table produced by the Analysis module.
  2. Creating a GUI which allows the user to set any options relating to the graph - title, axes labels, line styles, any extra gnuplot commands, and whether to graph to screen or to a file or to output a gnuplot file along with the relevant data files.
SRS References:
3.2.1.6a, 3.2.1.6b, 3.2.1.7, 3.2.2.2, 5.2.2

4.1.5 Logger Module

Logger
Description:
Provides user interface and control for the Logger Module.
Responsibilities:
This class is responsible for
  1. Receiving user settings for packet capturing.
  2. Displaying current packet capturing settings.
  3. Beginning logging at the user's request.
  4. Allowing the user to select a filename to dump the log to.
  5. Allowing the user to select the fields they wish to log.
  6. Allowing the user to select a network interface to collect packets from.
  7. Allowing the user to select or deselect all fields, with one click
  8. Allowing the user to specify the interval at which data is dumped as either:
    1. Number of Packets
      After a certain number of packets have been collected since the last dump, data may be logged.
    2. Elapsed Time
      After a certain amount of time has passed since the last dump, data may be logged. Allowed time intervals are 100 ms, and any multiple of 100 ms up to 1 hour.
SRS References:
3.2.1.9a, 3.2.1.9b, 3.2.1.9c, 3.2.1.9d, 3.2.1.9e, 5.2.3

MonitorLogging

Description:
Updates the status window while logging occurs.
Responsibilities:
This class is responsible for
  1. Updating the number of packets which have been logged. This will be updated once every second.
  2. Creating a new thread to perform its tasks in.
SRS References:
3.2.1.9e


next up previous contents
Next: 4.2 Data Decomposition Up: 4 SAM Detailed Design Previous: 4 SAM Detailed Design   Contents