org.opencms.setup.update6to7
Class A_CmsUpdateDBPart

java.lang.Object
  extended by org.opencms.setup.update6to7.A_CmsUpdateDBPart
All Implemented Interfaces:
I_CmsUpdateDBPart
Direct Known Subclasses:
CmsUpdateDBAlterTables, CmsUpdateDBCmsUsers, CmsUpdateDBContentTables, CmsUpdateDBCreateIndexes7, CmsUpdateDBDropBackupTables, CmsUpdateDBDropOldIndexes, CmsUpdateDBDropUnusedTables, CmsUpdateDBHistoryPrincipals, CmsUpdateDBHistoryTables, CmsUpdateDBNewTables, CmsUpdateDBProjectId, CmsUpdateDBUpdateOU

public abstract class A_CmsUpdateDBPart
extends java.lang.Object
implements I_CmsUpdateDBPart

Represent a part of the database update process.

Since:
6.9.2
Version:
$Revision: 1.2 $
Author:
Michael Moossen

Field Summary
protected  java.util.Map m_poolData
          The connection data to use.
protected  java.util.Map m_queries
          A map holding all SQL queries.
protected static java.lang.String QUERY_PROPERTIES_PREFIX
          The filename/path of the SQL query properties.
 
Constructor Summary
A_CmsUpdateDBPart()
          Default constructor.
 
Method Summary
 void execute()
          Executes the update part.
 I_CmsUpdateDBPart getDbInstance(java.lang.String dbName, java.util.Map dbPoolData)
          Returns the right instance based on the database name.
 java.util.Map getPoolData()
          Returns the database pool Data.
protected abstract  void internalExecute(CmsSetupDb setupDb)
          Does the hard work.
protected  boolean isKeepHistory()
          Returns the keep History parameter value.
protected  void loadQueryProperties(java.lang.String propertyFilename)
          Loads a Java properties hash containing SQL queries.
 java.lang.String readQuery(java.lang.String queryKey)
          Searches for the SQL query with the specified key.
 void setPoolData(java.util.Map poolData)
          Sets the database pool Data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_PROPERTIES_PREFIX

protected static final java.lang.String QUERY_PROPERTIES_PREFIX
The filename/path of the SQL query properties.

See Also:
Constant Field Values

m_poolData

protected java.util.Map m_poolData
The connection data to use.


m_queries

protected java.util.Map m_queries
A map holding all SQL queries.

Constructor Detail

A_CmsUpdateDBPart

public A_CmsUpdateDBPart()
Default constructor.

Method Detail

execute

public void execute()
Description copied from interface: I_CmsUpdateDBPart
Executes the update part.

Specified by:
execute in interface I_CmsUpdateDBPart
See Also:
I_CmsUpdateDBPart.execute()

getDbInstance

public I_CmsUpdateDBPart getDbInstance(java.lang.String dbName,
                                       java.util.Map dbPoolData)
Description copied from interface: I_CmsUpdateDBPart
Returns the right instance based on the database name.

Specified by:
getDbInstance in interface I_CmsUpdateDBPart
Parameters:
dbName - the database name
dbPoolData - the database pool data
Returns:
the right instance
See Also:
I_CmsUpdateDBPart.getDbInstance(String, Map)

getPoolData

public java.util.Map getPoolData()
Returns the database pool Data.

Returns:
the database pool Data

readQuery

public java.lang.String readQuery(java.lang.String queryKey)
Searches for the SQL query with the specified key.

Parameters:
queryKey - the SQL query key
Returns:
the the SQL query in this property list with the specified key

setPoolData

public void setPoolData(java.util.Map poolData)
Description copied from interface: I_CmsUpdateDBPart
Sets the database pool Data.

Specified by:
setPoolData in interface I_CmsUpdateDBPart
Parameters:
poolData - the database pool Data to set
See Also:
I_CmsUpdateDBPart.setPoolData(java.util.Map)

internalExecute

protected abstract void internalExecute(CmsSetupDb setupDb)
                                 throws java.sql.SQLException
Does the hard work.

Parameters:
setupDb - the db connection interface
Throws:
java.sql.SQLException - if somethign goes wrong

isKeepHistory

protected boolean isKeepHistory()
Returns the keep History parameter value.

Returns:
the keep History parameter value

loadQueryProperties

protected void loadQueryProperties(java.lang.String propertyFilename)
                            throws java.io.IOException
Loads a Java properties hash containing SQL queries.

Parameters:
propertyFilename - the package/filename of the properties hash
Throws:
java.io.IOException - if the sql queries property file could not be read