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 Link icon

  • Method Details Link icon

    • addMenuItems Link icon

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

      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 Link icon

      public DBControlUnit getPamguardDatabase()
      Returns:
      the pamguardDatabase
    • getTableInformationW Link icon

      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 Link icon

      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 Link icon

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

      public static Integer countRecords(DBControl dbControl, String tableName, Long minUTC)
      Count the records in a database table.
      Parameters:
      dbControl -
      tableName -
      Returns:
    • dropAndReplace Link icon

      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 Link icon

      public boolean autoFixTable(DBControl destDatabase, TableInformation tableInformation, TableInformationMonitor tableInfoMonitor)
      Attempt to create / automatically fix an output table
      Parameters:
      tableInformation -
      tableInfoMonitor -
    • copyDataW Link icon

      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 Link icon

      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 Link icon

      public void loadImportedSettings(DBControl sourceDatabase)
      Load the just imported settings from the database tables.
      Parameters:
      sourceDatabase -
    • createTables Link icon

      public void createTables(DBControl destDatabase, List<TableInformation> tableInfo, TableInformationMonitor tableInformationMonitor)
    • checkCrossReferencing Link icon

      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 -