dk.netarkivet.harvester.datamodel
Class DerbySpecifics

java.lang.Object
  extended by dk.netarkivet.common.utils.SettingsFactory<DBSpecifics>
      extended by dk.netarkivet.harvester.datamodel.DBSpecifics
          extended by dk.netarkivet.harvester.datamodel.DerbySpecifics
Direct Known Subclasses:
DerbyEmbeddedSpecifics, DerbyServerSpecifics

public abstract class DerbySpecifics
extends DBSpecifics

Derby-specific implementation of DB methods.


Field Summary
(package private)  org.apache.commons.logging.Log log
           
 
Constructor Summary
DerbySpecifics()
           
 
Method Summary
 void dropJobConfigsTmpTable(java.sql.Connection c, java.lang.String tableName)
          Dispose of a temporary table gotten with getTemporaryTable.
 java.lang.String getJobConfigsTmpTable(java.sql.Connection c)
          Get a temporary table for short-time use.
protected  void migrateConfigurationsv3ov4()
          Migrates the 'configurations' table from version 3 to version 4.
protected  void migrateFullharvestsv2tov3()
          Migrates the 'fullharvests' table from version 2 to version 3.
protected  void migrateJobsv3tov4()
          Migrates the 'jobs' table from version 3 to version 4 consisting of a change of the field forcemaxbytes from int to bigint and setting its default to -1.
protected  void migrateJobsv4tov5()
          Migrates the 'jobs' table from version 4 to version 5 consisting of adding new fields 'resubmitted_as_job' and 'submittedDate'.
 
Methods inherited from class dk.netarkivet.harvester.datamodel.DBSpecifics
backupDatabase, getDriverClassName, getInstance, shutdownDatabase, updateTable
 
Methods inherited from class dk.netarkivet.common.utils.SettingsFactory
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

org.apache.commons.logging.Log log
Constructor Detail

DerbySpecifics

public DerbySpecifics()
Method Detail

getJobConfigsTmpTable

public java.lang.String getJobConfigsTmpTable(java.sql.Connection c)
                                       throws java.sql.SQLException
Get a temporary table for short-time use. The table should be disposed of with dropTemporaryTable. The table has two columns domain_name varchar(Constants.MAX_NAME_SIZE) + config_name varchar(Constants.MAX_NAME_SIZE) All rows in the table must be deleted at commit or rollback.

Specified by:
getJobConfigsTmpTable in class DBSpecifics
Parameters:
c - The DB connection to use.
Returns:
The name of the created table
Throws:
java.sql.SQLException - if there is a problem getting the table.

dropJobConfigsTmpTable

public void dropJobConfigsTmpTable(java.sql.Connection c,
                                   java.lang.String tableName)
Dispose of a temporary table gotten with getTemporaryTable. This can be expected to be called from within a finally clause, so it mustn't throw exceptions.

Specified by:
dropJobConfigsTmpTable in class DBSpecifics
Parameters:
c - The DB connection to use.
tableName - The name of the temporary table

migrateJobsv3tov4

protected void migrateJobsv3tov4()
Migrates the 'jobs' table from version 3 to version 4 consisting of a change of the field forcemaxbytes from int to bigint and setting its default to -1. Furthermore the default value for field num_configs is set to 0.

Specified by:
migrateJobsv3tov4 in class DBSpecifics
Throws:
IOFailure - in case of problems in interacting with the database

migrateJobsv4tov5

protected void migrateJobsv4tov5()
Migrates the 'jobs' table from version 4 to version 5 consisting of adding new fields 'resubmitted_as_job' and 'submittedDate'.

Specified by:
migrateJobsv4tov5 in class DBSpecifics
Throws:
IOFailure - in case of problems in interacting with the database

migrateConfigurationsv3ov4

protected void migrateConfigurationsv3ov4()
Migrates the 'configurations' table from version 3 to version 4. This consists of altering the default value of field 'maxbytes' to -1.

Specified by:
migrateConfigurationsv3ov4 in class DBSpecifics

migrateFullharvestsv2tov3

protected void migrateFullharvestsv2tov3()
Migrates the 'fullharvests' table from version 2 to version 3. This consists of altering the default value of field 'maxbytes' to -1.

Specified by:
migrateFullharvestsv2tov3 in class DBSpecifics