generalDatabase
Class LogSettings

java.lang.Object
  extended by generalDatabase.SQLLogging
      extended by generalDatabase.DbSpecial
          extended by generalDatabase.LogSettings

public class LogSettings
extends DbSpecial

Functions for writing Pamguard Settings into any database as character data Runs at DAQ start, goes through the settings manager list and for each set of settings, it serialises the settings data into a binary array, this is then converted from binary data to 6 bit ascii data (using the character set from the AIS standard, which should be compatible with any DBMS). This character string is then broken up into parts < 255 characters long and written to the Pamguard_Settings table in the database.
This will allow 1) an audit of exactly how Pamguard was configured at any particular time, 2) when looking at data offline, the database will contain all information required to reconstruct the Pamguard data model and displays, the database thereby becomes a self contained document of operations, there being no need to keep hold of psf settings files.

Author:
Doug Gillespie
See Also:
LogModules

Nested Class Summary
(package private)  class LogSettings.SettingsDataUnit
           
 
Field Summary
private static int DATA_LENGTH
           
private  boolean deletePrevious
           
private  PamSettingsTableDefinition tableDef
           
 
Fields inherited from class generalDatabase.DbSpecial
dbControl
 
Fields inherited from class generalDatabase.SQLLogging
UPDATE_POLICY_OVERWRITE, UPDATE_POLICY_WRITENEW
 
Constructor Summary
LogSettings(DBControl dbControl, java.lang.String tableName, boolean deletePrevious)
           
 
Method Summary
 DBSettingsStore loadSettings(java.sql.Connection con)
           
(package private)  boolean logSettings(PamSettings pamSettings, long logTime)
           
(package private)  void pamStart(java.sql.Connection con)
           
(package private)  void pamStop(java.sql.Connection con)
           
(package private)  boolean saveAllSettings()
           
 void setTableData(PamDataUnit pamDataUnit)
          Callback function when new data are created that allows the user to set the data for each column.
 
Methods inherited from class generalDatabase.DbSpecial
logData
 
Methods inherited from class generalDatabase.SQLLogging
createDataUnit, createInClause, createViewResultSet, doExtraChecks, fillTableData, finalize, findLogger, getIdListUpdatClause, getLastTime, getPamDataBlock, getTableDefinition, getTimesUpdateClause, getUpdatePolicy, getViewerCursorFinder, getViewerLoadClause, getViewerUpdateClause, isCanView, isLoadViewData, loadViewData, loadViewerData, logData, prepareEmulation, prepareForMixedMode, readLastData, readMixedModeData, readNextEmulation, reCheckTable, reLogData, saveOfflineData, setCanView, setColumnData, setLoadViewData, setTableDefinition, setUpdatePolicy, transferDataFromResult
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableDef

private PamSettingsTableDefinition tableDef

DATA_LENGTH

private static final int DATA_LENGTH
See Also:
Constant Field Values

deletePrevious

private boolean deletePrevious
Constructor Detail

LogSettings

public LogSettings(DBControl dbControl,
                   java.lang.String tableName,
                   boolean deletePrevious)
Method Detail

pamStart

void pamStart(java.sql.Connection con)
Specified by:
pamStart in class DbSpecial

saveAllSettings

boolean saveAllSettings()

logSettings

boolean logSettings(PamSettings pamSettings,
                    long logTime)

loadSettings

public DBSettingsStore loadSettings(java.sql.Connection con)

pamStop

void pamStop(java.sql.Connection con)
Specified by:
pamStop in class DbSpecial

setTableData

public void setTableData(PamDataUnit pamDataUnit)
Description copied from class: SQLLogging
Callback function when new data are created that allows the user to set the data for each column. Columns that have data which can be filled automatically (counters, primary keys and columns cross referenced to data in other tables) are filled automatically in fillTableData()

Specified by:
setTableData in class SQLLogging