Package generalDatabase
Class DBControlUnit
java.lang.Object
PamController.PamControlledUnit
generalDatabase.DBControl
generalDatabase.DBControlUnit
- All Implemented Interfaces:
 DataOutputStore,OfflineDataStore,PamSettings,PamSettingsSource,SettingsNameProvider
Version of DBControl for normal use while PAMGUARD is running 
 - reading and writing of data
- Author:
 - Doug Gillespie
 - See Also:
 
- 
Field Summary
Fields inherited from class generalDatabase.DBControl
GlobalDatabaseNameArgFields inherited from class PamController.PamControlledUnit
isMixed, isViewer - 
Constructor Summary
ConstructorsConstructorDescriptionDBControlUnit(String unitName) DBControlUnit(PamConfiguration pamConfiguration, String unitName)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOfflineDataMap(Window parentFrame) Create a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.voidcreateOfflineDataMap(Window parentFrame, PamControlledUnit pamControlledUnit) 1 Create offline datamap when modules are added in viewer mode AFTER initialisation.booleandeleteDataFrom(long timeMillis) Delete all data from a given time, in all data streams.static PamConnectionFind the database connectionstatic DBControlUnitFind the database controllerGet the data location.Get the data source nameGet a data integrity checker.Quick convenient way of getting the module status.intGet the offline state of this module.getStoreStatus(boolean getDetail) Get the store status, i.e.booleanloadData(PamDataBlock dataBlock, OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) Load data for a given datablock between two time limits.voidmapNewDataBlock(Window parentFrame, ArrayList<PamDataBlock> dataBlocks) Map a list of data blocks.voidmapNewDataBlock(Window parentFrame, PamDataBlock dataBlock) Function to map a single new datablock.voidnotifyModelChanged(int changeType) General notification when the PAMGAURD model changes.booleanrewriteIndexFile(PamDataBlock dataBlock, OfflineDataMapPoint dmp) Moved this function over from binary data store.booleansaveData(PamDataBlock dataBlock) Save data previously loaded from the store during offline viewing.booleanselectSystem(int systemNumber, boolean openDatabase) Select a database systemvoidupdateDataMap(ArrayList<PamDataBlock> pamDataBlocks) Update the data map for an array list of data blocks.voidupdateDataMap(PamDataBlock pamDataBlock) update the datamap for a single data block.Methods inherited from class generalDatabase.DBControl
addDatabaseSystem, browseDatabases, canClose, closeConnection, commitChanges, createFileMenu, createPamCursor, exportDatabaseSchema, fillSettingsStore, getConnection, getDatabaseName, getDatabaseSystem, getDatabaseSystems, getDbParameters, getDbProcess, getDbUnitType, getGUI, getLastErrorCount, getLoggingDataBlocks, getLongDatabaseName, getNumSettings, getSettings, getSettingsReference, getSettingsSourceName, getSettingsStore, getSettingsVersion, getSidePanel, getSystem, getSystem, isFullTablesCheck, openDatabase, pamClose, reOpenConnection, restoreSettings, saveEndSettings, saveSettingsToDB, saveStartSettings, selectDatabase, selectSystem, selectSystem, setDBParameters, setFullTablesCheck, setWriteCountMethods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createHelpMenu, flushDataBlockBuffers, getFrameNumber, getGuiFrame, getInstanceIndex, getModuleStatusManager, getModuleSummary, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitName, getUnitTaskManager, getUnitTaskManager, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setUnitTaskManager, setupControlledUnit, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PamController.PamSettings
getUnitTypeMethods inherited from interface PamController.SettingsNameProvider
getUnitName 
- 
Constructor Details
- 
DBControlUnit
 - 
DBControlUnit
 
 - 
 - 
Method Details
- 
selectSystem
public boolean selectSystem(int systemNumber, boolean openDatabase) Description copied from class:DBControlSelect a database system- Overrides:
 selectSystemin classDBControl- Parameters:
 systemNumber- index of the database systemopenDatabase- flag to immediately open the database- Returns:
 - true if all ok
 
 - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnitGeneral notification when the PAMGAURD model changes.- Overrides:
 notifyModelChangedin classDBControl- Parameters:
 changeType- type of change
 - 
updateDataMap
update the datamap for a single data block.- Parameters:
 pamDataBlock-
 - 
updateDataMap
Update the data map for an array list of data blocks.- Parameters:
 pamDataBlock-
 - 
createOfflineDataMap
Description copied from interface:OfflineDataStoreCreate a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.- Specified by:
 createOfflineDataMapin interfaceOfflineDataStore
 - 
createOfflineDataMap
1 Create offline datamap when modules are added in viewer mode AFTER initialisation.- Parameters:
 parentFrame- not usedpamControlledUnit- unit added.
 - 
mapNewDataBlock
Function to map a single new datablock.- Parameters:
 parentFrame- parent frame for dialogdataBlock- datablock to map.
 - 
mapNewDataBlock
Map a list of data blocks.- Parameters:
 parentFrame- parent frame for dialogdataBlocks- Array list of datablocks.
 - 
getDataSourceName
Description copied from interface:OfflineDataStoreGet the data source name- Specified by:
 getDataSourceNamein interfaceOfflineDataStore- Returns:
 - data source name
 
 - 
getDataLocation
Description copied from interface:OfflineDataStoreGet the data location. This may be a specific file, or might be a folder if data are in many files, a URI, etc.- Specified by:
 getDataLocationin interfaceOfflineDataStore- Returns:
 - store locations
 
 - 
loadData
public boolean loadData(PamDataBlock dataBlock, OfflineDataLoadInfo offlineDataLoadInfo, ViewLoadObserver loadObserver) Description copied from interface:OfflineDataStoreLoad data for a given datablock between two time limits.- Specified by:
 loadDatain interfaceOfflineDataStore- Parameters:
 dataBlock- datablock owner of the dataloadObserver-- Returns:
 - true if load successful.
 
 - 
saveData
Description copied from interface:OfflineDataStoreSave data previously loaded from the store during offline viewing.- Specified by:
 saveDatain interfaceOfflineDataStore- Parameters:
 dataBlock- datablock owner of the data- Returns:
 - true if saved or save not needed. False if an error prevents saving.
 
 - 
findConnection
Find the database connection- Returns:
 - the database connection or null if there is either no database module loaded or no open database.
 
 - 
findDatabaseControl
Find the database controller- Returns:
 - database controller, or null if no database module loaded.
 
 - 
rewriteIndexFile
Description copied from interface:OfflineDataStoreMoved this function over from binary data store. Many storage systems may not be able to do this, but some might !- Specified by:
 rewriteIndexFilein interfaceOfflineDataStore- Parameters:
 dataBlock-dmp-- Returns:
 
 - 
getDatagramManager
- Specified by:
 getDatagramManagerin interfaceOfflineDataStore- Returns:
 - the datagramManager
 
 - 
getModuleStatus
Description copied from class:PamControlledUnitQuick convenient way of getting the module status.- Overrides:
 getModuleStatusin classPamControlledUnit- Returns:
 - Module Status or null if no status manager present.
 
 - 
getBackupInformation
- Overrides:
 getBackupInformationin classPamControlledUnit
 - 
getStoreStatus
Description copied from interface:DataOutputStoreGet the store status, i.e. does it exist, does it contain data, if so over what date range, etc.- Specified by:
 getStoreStatusin interfaceDataOutputStore- Parameters:
 getDetail-- Returns:
 
 - 
deleteDataFrom
public boolean deleteDataFrom(long timeMillis) Description copied from interface:DataOutputStoreDelete all data from a given time, in all data streams.- Specified by:
 deleteDataFromin interfaceDataOutputStore- Parameters:
 timeMillis- time to delete from (anything >= this time)- Returns:
 - true if it seems to have worked OK. False if any errors (e.g. database or file system error).
 
 - 
getOfflineState
public int getOfflineState()Description copied from class:PamControlledUnitGet the offline state of this module. This can generally be idle, but can be a higher state when map making at startup and when running an offline task.- Overrides:
 getOfflineStatein classPamControlledUnit- Returns:
 
 - 
getInegrityChecker
Description copied from interface:DataOutputStoreGet a data integrity checker. This can be called at startup to see if there is a problem.- Specified by:
 getInegrityCheckerin interfaceDataOutputStore- Returns:
 
 
 -