Class CopyManager

java.lang.Object
generalDatabase.external.CopyManager

public class CopyManager extends Object
Imports or exports data from an external database.
Author:
dg50
  • Constructor Details

  • Method Details

    • addMenuItems

      public void addMenuItems(JMenu menu, JFrame parentFrame)
    • getTableInfo

      public List<TableInformation> 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.
      Parameters:
      sourceDatabase -
      destDatabase -
      Returns:
      List of table definitions for all source database tables.
    • getPamguardDatabase

      public DBControlUnit 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

      public static Integer countRecords(DBControl dbControl, String tableName)
    • countRecords

      public static Integer countRecords(DBControl dbControl, String tableName, Long minUTC)
      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

      public void loadImportedSettings(DBControl sourceDatabase)
      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 -