Class ServerBasedSystem

java.lang.Object
generalDatabase.DBSystem
generalDatabase.ServerBasedSystem
All Implemented Interfaces:
PamSettings, SettingsNameProvider
Direct Known Subclasses:
MySQLSystem, PostgreSQLSystem

public abstract class ServerBasedSystem extends DBSystem implements PamSettings
  • Constructor Details

    • ServerBasedSystem

      public ServerBasedSystem(DBControl dbControl, int settingsStore)
  • Method Details

    • browseDatabases

      public String browseDatabases(Component parent)
      Specified by:
      browseDatabases in class DBSystem
    • canCreate

      public boolean canCreate()
      Specified by:
      canCreate in class DBSystem
      Returns:
      true if the system can create new databases.
    • create

      public boolean create()
      Description copied from class: DBSystem
      Create a new database

      The underlying DBSystem will be responsible for any dialogs to chose database names, etc.

      Specified by:
      create in class DBSystem
      Returns:
      true if successful.
    • exists

      public boolean exists()
      Specified by:
      exists in class DBSystem
      Returns:
      true if the database exists
    • getDriverClassName

      public abstract String getDriverClassName()
    • getDefaultUser

      public abstract String getDefaultUser()
    • getConnection

      public PamConnection getConnection(String databaseName)
      Description copied from class: DBSystem
      Open new database connection with a specific name
      Specified by:
      getConnection in class DBSystem
      Returns:
    • getSystemName

      public abstract String getSystemName()
      Specified by:
      getSystemName in class DBSystem
      Returns:
      The name of the database system
    • hasDriver

      public boolean hasDriver()
      Specified by:
      hasDriver in class DBSystem
      Returns:
      true if the driver for this database system is available on this computer. the availability of database system will depend both on the OS and whether software are installed.
    • getDialogPanel

      public SystemDialogPanel getDialogPanel(Component parent)
      Description copied from class: DBSystem
      Get a database specific dialog panel to include in the database select dialog.
      Specified by:
      getDialogPanel in class DBSystem
      Parameters:
      parent - parent component
      Returns:
      dialog panel
    • getDefaultPort

      public abstract int getDefaultPort()
    • getSchemaName

      public abstract String getSchemaName()
      Get the database schema name - the name of the databse on the server which manages the other databases
      Returns:
    • createNewDatabase

      public boolean createNewDatabase(String name)
    • getAvailableDatabaseString

      public abstract String getAvailableDatabaseString()
    • checkAvailableDatabaseResult

      public abstract String checkAvailableDatabaseResult(ResultSet result)
    • buildDatabaseUrl

      public abstract String buildDatabaseUrl(String ipAddress, int portNumber, String databaseName)
    • isServerConnected

      public boolean isServerConnected()
    • getDatabaseName

      public String getDatabaseName()
      Specified by:
      getDatabaseName in class DBSystem
      Returns:
      the name of the currently open database.
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • createPamCursor

      public PamCursor createPamCursor(EmptyTableDefinition tableDefinition)
      Specified by:
      createPamCursor in class DBSystem
    • getDialogPaneFX

      public SystemDialogPaneFX getDialogPaneFX()
      Description copied from class: DBSystem
      Get the FX pane for the database system
      Specified by:
      getDialogPaneFX in class DBSystem
      Returns:
      the FX settings pane for the database system.
    • browseDatabasesFX

      public String browseDatabasesFX(int type)
      Description copied from class: DBSystem
      Browse for databases using an FX dialog.
      Specified by:
      browseDatabasesFX in class DBSystem
      Returns:
    • checkDatabaseExists

      public boolean checkDatabaseExists(String dbName)
      Overrides:
      checkDatabaseExists in class DBSystem