cst.common.persistenceLayer
Class SetupProductionDatabase

java.lang.Object
  extended by cst.common.persistenceLayer.SetupProductionDatabase

public class SetupProductionDatabase
extends java.lang.Object

Creates and destroys an instance of the CST database for a given configuration file.


 Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software 
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.  
 

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
SetupProductionDatabase()
           
SetupProductionDatabase(SessionProperties sessionProperties)
           
SetupProductionDatabase(StartupOptions startupOptions)
           
 
Method Summary
 void createActivityChangesTable(java.sql.Connection connection)
           
 void createDatabase()
           
 void createSubjectTable(java.sql.Connection connection)
           
 void createSubjectTableColumn(java.sql.Connection connection, java.lang.String subjectAttribute)
           
 void createTables(java.sql.Connection connection, TrialSubjectModelFactory trialSubjectModelFactory)
           
 void createTrialActivityTable(java.sql.Connection connection, java.lang.String activityDataStorageName)
           
 void createTrialActivityTableColumn(java.sql.Connection connection, java.lang.String activityDataStorageName, java.lang.String activityStepDataStorageName)
           
 void createUserTable(java.sql.Connection connection)
           
 boolean databaseExists()
           
 void deleteDatabase()
           
static void main(java.lang.String[] arguments)
           
 void setDatabaseName(java.lang.String databaseName)
           
 void setup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetupProductionDatabase

public SetupProductionDatabase()

SetupProductionDatabase

public SetupProductionDatabase(SessionProperties sessionProperties)

SetupProductionDatabase

public SetupProductionDatabase(StartupOptions startupOptions)
Method Detail

main

public static void main(java.lang.String[] arguments)

setup

public void setup()

databaseExists

public boolean databaseExists()
                       throws CSTException
Throws:
CSTException

createDatabase

public void createDatabase()
                    throws CSTException
Throws:
CSTException

deleteDatabase

public void deleteDatabase()
                    throws CSTException
Throws:
CSTException

createTables

public void createTables(java.sql.Connection connection,
                         TrialSubjectModelFactory trialSubjectModelFactory)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

createSubjectTable

public void createSubjectTable(java.sql.Connection connection)
                        throws java.sql.SQLException
Throws:
java.sql.SQLException

createSubjectTableColumn

public void createSubjectTableColumn(java.sql.Connection connection,
                                     java.lang.String subjectAttribute)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

createActivityChangesTable

public void createActivityChangesTable(java.sql.Connection connection)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

createUserTable

public void createUserTable(java.sql.Connection connection)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

createTrialActivityTable

public void createTrialActivityTable(java.sql.Connection connection,
                                     java.lang.String activityDataStorageName)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

createTrialActivityTableColumn

public void createTrialActivityTableColumn(java.sql.Connection connection,
                                           java.lang.String activityDataStorageName,
                                           java.lang.String activityStepDataStorageName)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)