Package generalDatabase.external
Class CopyManager
java.lang.Object
generalDatabase.external.CopyManager
Imports or exports data from an external database.
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMenuItems
(JMenu menu, JFrame parentFrame) boolean
autoFixTable
(DBControl destDatabase, TableInformation tableInformation, TableInformationMonitor tableInfoMonitor) Attempt to create / automatically fix an output tablevoid
checkCrossReferencing
(DBControl destDatabase, CrossReferenceStatusMonitor crossReferenceMonitor) Hopefully, the correct configuration is now loaded and we can check cross references.void
copyData
(DBControl sourceDatabase, DBControl destDatabase, List<TableInformation> tableInfo, TableInformationMonitor tableInfoMonitor) Copy the data in the list of Tableinformation'svoid
copyDataW
(DBControl sourceDatabase, DBControl destDatabase, List<TableInformation> tableList, TableInformationMonitor tableInfoMonitor) Copy the data in a list of tables, but in a separate Swing Worker thread.static Integer
countRecords
(DBControl dbControl, String tableName) static Integer
countRecords
(DBControl dbControl, String tableName, Long minUTC) Count the records in a database table.void
createTables
(DBControl destDatabase, List<TableInformation> tableInfo, TableInformationMonitor tableInformationMonitor) void
dropAndReplace
(DBControl sourceDatabase, DBControl destDatabase, TableInformation tableInformation, TableInformationMonitor tableInformationMonitor) Bit of a bodge to get it to call back round to the same point.getTableInfo
(DBControl sourceDatabase, DBControl destDatabase) Extract all information about all tables in a database but don't do any checking or changing of any of those tables.void
getTableInformation
(List<TableInformation> tableInfo, DBControl sourceDatabase, DBControl destDatabase, TableInformationMonitor tableInfoMonitor) Get information about the state of all tables.void
getTableInformationW
(List<TableInformation> tableInfo, DBControl sourceDatabase, DBControl destDatabase, TableInformationMonitor tableInfoMonitor) Call the table information functions in a separate SwingWorker thread.void
loadImportedSettings
(DBControl sourceDatabase) Load the just imported settings from the database tables.
-
Constructor Details
-
CopyManager
-
-
Method Details
-
addMenuItems
-
getTableInfo
Extract all information about all tables in a database but don't do any checking or changing of any of those tables.- Parameters:
sourceDatabase
-destDatabase
-- Returns:
- List of table definitions for all source database tables.
-
getPamguardDatabase
- Returns:
- the pamguardDatabase
-
getTableInformationW
public void getTableInformationW(List<TableInformation> tableInfo, DBControl sourceDatabase, DBControl destDatabase, TableInformationMonitor tableInfoMonitor) Call the table information functions in a separate SwingWorker thread.- Parameters:
tableInfo
-sourceDatabase
-destDatabase
-tableInfoMonitor
-
-
getTableInformation
public void getTableInformation(List<TableInformation> tableInfo, DBControl sourceDatabase, DBControl destDatabase, TableInformationMonitor tableInfoMonitor) Get information about the state of all tables.- Parameters:
tableInfo
-sourceDatabase
-destDatabase
-tableInfoMonitor
-
-
countRecords
-
countRecords
Count the records in a database table.- Parameters:
dbControl
-tableName
-- Returns:
-
dropAndReplace
public void dropAndReplace(DBControl sourceDatabase, DBControl destDatabase, TableInformation tableInformation, TableInformationMonitor tableInformationMonitor) Bit of a bodge to get it to call back round to the same point. Hasn't been correctly rethreaded.- Parameters:
sourceDatabase
-destDatabase
-tableInformation
-tableInformationMonitor
-
-
autoFixTable
public boolean autoFixTable(DBControl destDatabase, TableInformation tableInformation, TableInformationMonitor tableInfoMonitor) Attempt to create / automatically fix an output table- Parameters:
tableInformation
-tableInfoMonitor
-
-
copyDataW
public void copyDataW(DBControl sourceDatabase, DBControl destDatabase, List<TableInformation> tableList, TableInformationMonitor tableInfoMonitor) Copy the data in a list of tables, but in a separate Swing Worker thread.- Parameters:
tableList
-tableInfoMonitor
-
-
copyData
public void copyData(DBControl sourceDatabase, DBControl destDatabase, List<TableInformation> tableInfo, TableInformationMonitor tableInfoMonitor) Copy the data in the list of Tableinformation's- Parameters:
sourceDatabase
-destDatabase
-tableInfo
- list of table information
-
loadImportedSettings
Load the just imported settings from the database tables.- Parameters:
sourceDatabase
-
-
createTables
public void createTables(DBControl destDatabase, List<TableInformation> tableInfo, TableInformationMonitor tableInformationMonitor) -
checkCrossReferencing
public void checkCrossReferencing(DBControl destDatabase, CrossReferenceStatusMonitor crossReferenceMonitor) Hopefully, the correct configuration is now loaded and we can check cross references. These may come from any module, but in reality, it's just the click detector that currently requires it.- Parameters:
crossReferenceMonitor
-
-