Changes between Initial Version and Version 1 of Ticket #529, comment 8


Ignore:
Timestamp:
Mar 20, 2014, 9:14:33 AM (11 years ago)
Author:
olle

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #529, comment 8

    initial v1  
    1 Design description:
     1Design description (initial):
    22
    3 It was decided to create the new service as a BASE extension, allowing for it to be simply installed from a single JAR file plus configuration file using the BASE extension installation mechanism, available through BASE menu "Extensions -> Install plug-ins/extensions...". After installation, the "Extensions" menu will have a new menu item "Lab Environment", with a number of sub-menus. Creating the service as a BASE extension also has the benefit of keeping the code encapsulated, and allowing it to be installed only at BASE servers, where it is useful.
     3It was decided to create the new service as a BASE extension, allowing for it to be simply installed from a single JAR file plus configuration file using the BASE extension installation mechanism, available through BASE menu "Extensions -> Install plug-ins/extensions...". After installation, the "Extensions" menu will have a new menu item "Lab Environment", with a number of sub-menus. Creating the service as a BASE extension also has the benefit of keeping the code encapsulated, and allowing it to be installed only at BASE servers, that can take advantage of it (i.e. is connected to !ThermoWorks Thermo Recoder TR-702W sensors).
    44
     5The code has been split up in a number of classes/files, where each one has a more or less well-defined responsibility. The code root directory is named "`labenv`" (short for "lab environment").
     6
     7File to be installed in specific directories:
     8
     9|| '''File''' || '''Directory''' || '''Description''' ||
     10|| Database file for lab environment values || BASE user files directory defined in configuration file `base.config`. || File used by the database manager to store the lab environment values. Its name is taken from configuration file `labenv-config.xml`. The BASE user files directory was chosen, as this normally has automatic backup routines coupled to it. ||
     11|| `labenv-config.xml` || Directory where BASE configuration files like `base.config` are installed. || This directory was chosen as it is nice to have configuration files stored in a single place. ||
     12
     13BASE Service:
     14
     15|| '''File''' || '''Description''' ||
     16|| `labenv/src/sf/basedb/clients/web/extensions/service/LabEnvService.java` || A service based on the BASE `DummyAction` service, that repeats an action after a pre-defined time interval. This class combines the functionality of `ServiceControllerFactory`, `ServiceController`, and `Service`, that are implemented as separate classes in more complex services, like the BASE FTP Service. It implements the `ServiceControllerAction` interface, having public methods `boolean isRunning()`, `void start()`, and `void stop()`. Public method `void start()` creates an instance of singleton `LabEnvironment` and stores it as an instance variable. `LabEnvironment` in turn creates an instance of class `LabEnvironmentConfiguration`, that reads configuration values from file `labenv-config.xml`. A  `java.util.TimerTask` instance is created, where the time interval is taken from configuration values, and the public `void run` method calls public method `void measureAndStoreLabEnvironmentData()` in the `LabEnvironment` instance.  ||
     17
     18Lab environment measurements and storage:
     19
     20|| '''File''' || '''Description''' ||
     21|| `labenv/src/net/sf/basedb/labenv/LabEnvironment.java` || Singleton class that is the main entry point to the lab environment functionality. It creates an instance of class `LabEnvironmentConfiguration`, that reads configuration values from file `labenv-config.xml`. Public method `void measureAndStoreLabEnvironmentData()` uses utility class `LabSensorUtil` to measure lab environment values for configured lab sensors and store the values using utility class `LabEnvironmentStorageUtil`. ||
     22|| `labenv/src/net/sf/basedb/labenv/LabEnvironmentConfiguration.java` || Class that reads configuration values from file `labenv-config.xml` and stored them in instance variables. Configuration values for individual lab sensors are stored in a list of `LabSensorConfig` instances. Also has public methods `LabSensorConfig findByNumber(Integer number)` and `LabSensorConfig findByUrl(String url)` to obtain the configuration for a specific lab sensor. ||