public abstract class DBControl extends PamControlledUnit implements PamSettings, PamSettingsSource
This gets used in two slightly different ways in Pamguard. The first is the obvious reading and writing of data to a variety of tables. The second is the loading of settings from the PAmguard_settings and the PamguardModules tables tables in which all program settings were serialised and stored as 6 bit ascii strings each time PAMGUARD started collecting data.
So that an instance of DBControl can be made that doesn't load settings, two sub classes have been made: DBContorlUnit for normal use and DBControlSettings for reading in settings information.
DBControlSettings
,
DBControlUnit
Constructor and Description |
---|
DBControl(java.lang.String unitName,
int settingsStore,
boolean openImmediately) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
browseDatabases(java.awt.Component parent) |
boolean |
canClose()
Called before Pamguard shuts down.
|
javax.swing.JMenuItem |
createFileMenu(javax.swing.JFrame parentFrame) |
PamCursor |
createPamCursor(EmptyTableDefinition tableDefinition) |
java.sql.Connection |
getConnection() |
java.lang.String |
getDatabaseName() |
DBSystem |
getDatabaseSystem() |
DBProcess |
getDbProcess() |
static java.lang.String |
getDbUnitType() |
int |
getNumSettings()
Get the number of different settings
within the settings source.
|
PamSettingsGroup |
getSettings(int settingsIndex)
Get a specific PamSettingsGroup
|
java.io.Serializable |
getSettingsReference() |
java.lang.String |
getSettingsSourceName()
Get a name for the settings source
|
long |
getSettingsVersion() |
PamSidePanel |
getSidePanel()
Gets a reference to a small panel to be displayed along the
left hand edge of the main tab panel.
|
boolean |
isFullTablesCheck() |
void |
notifyModelChanged(int changeType)
General notification when the PAMGAURD model changes.
|
void |
pamClose()
Called when PAMGUARD is finally closing down so that a module
may free any remaining resources (e.g.
|
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) |
boolean |
saveSettingsToDB() |
boolean |
saveStartSettings(long timeNow)
Save the settings in some way or another.
|
boolean |
selectSystem(int systemNumber,
boolean openDatabase)
Select a database system
|
void |
setFullTablesCheck(boolean fullTablesCheck) |
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addRelatedMenuItems, addXMLParameter, addXMLParameter, addXMLParameter, addXMLParameter, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createHelpMenu, fillXMLElement, flushDataBlockBuffers, getFrameNumber, getGuiFrame, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineTaskGroup, getPamController, getPamModuleInfo, getPamProcess, getPamView, getShortUnitType, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitType, getVerboseLevel, gotoTab, isViewer, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setupControlledUnit, stopViewerSound, terminalPrint, terminalPrintln, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUnitName, getUnitType
public DBControl(java.lang.String unitName, int settingsStore, boolean openImmediately)
public boolean selectSystem(int systemNumber, boolean openDatabase)
systemNumber
- index of the database systemopenDatabase
- flag to immediately open the databasepublic boolean canClose()
PamControlledUnit
canClose
in class PamControlledUnit
public void pamClose()
PamControlledUnit
pamClose
in class PamControlledUnit
public java.lang.String browseDatabases(java.awt.Component parent)
public void notifyModelChanged(int changeType)
PamControlledUnit
notifyModelChanged
in class PamControlledUnit
changeType
- type of changepublic java.sql.Connection getConnection()
public java.io.Serializable getSettingsReference()
getSettingsReference
in interface PamSettings
public long getSettingsVersion()
getSettingsVersion
in interface PamSettings
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings
in interface PamSettings
public javax.swing.JMenuItem createFileMenu(javax.swing.JFrame parentFrame)
createFileMenu
in class PamControlledUnit
parentFrame
- parent frame for the menupublic PamSidePanel getSidePanel()
PamControlledUnit
It is possible for a PamControlled unit to have a side panel without having a pamTabPanel.
getSidePanel
in class PamControlledUnit
PamSidePanel
,
PamTabPanel
public static java.lang.String getDbUnitType()
public DBProcess getDbProcess()
public boolean saveSettingsToDB()
public boolean saveStartSettings(long timeNow)
PamSettingsSource
saveStartSettings
in interface PamSettingsSource
timeNow
- current time.public int getNumSettings()
PamSettingsSource
getNumSettings
in interface PamSettingsSource
public PamSettingsGroup getSettings(int settingsIndex)
PamSettingsSource
getSettings
in interface PamSettingsSource
settingsIndex
- index of grouppublic java.lang.String getSettingsSourceName()
PamSettingsSource
getSettingsSourceName
in interface PamSettingsSource
public boolean isFullTablesCheck()
public void setFullTablesCheck(boolean fullTablesCheck)
public java.lang.String getDatabaseName()
public PamCursor createPamCursor(EmptyTableDefinition tableDefinition)
public DBSystem getDatabaseSystem()