Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

openfuture.bugbase.domain.update
Class CreateDBUsersUpdate  view CreateDBUsersUpdate download CreateDBUsersUpdate.java

java.lang.Object
  extended byopenfuture.bugbase.domain.update.CreateDBUsersUpdate
All Implemented Interfaces:
openfuture.bugbase.model.Transaction, openfuture.bugbase.model.VersionUpdate

public class CreateDBUsersUpdate
extends java.lang.Object
implements openfuture.bugbase.model.VersionUpdate

Create all existing users as database users and replace the email address in the bug reports by the user IDs. Created: Wed Jun 14 12:27:16 2000

Version:
$Revision: 1.3 $

Field Summary
private  java.lang.String bugreportBackupTable
           
private  java.util.LinkedList bugreportColtypes
           
private  java.util.LinkedList bugreportColumns
           
private  java.sql.Connection connection
           
private  java.lang.String doctorBackupTable
           
private  java.util.LinkedList doctorColtypes
           
private  java.util.LinkedList doctorColumns
           
private  java.util.LinkedList doctorConstraints
           
private  openfuture.bugbase.domain.Persistency persistency
           
private  openfuture.bugbase.model.Version version
           
 
Constructor Summary
CreateDBUsersUpdate(openfuture.bugbase.domain.Persistency persistency)
           
 
Method Summary
 openfuture.bugbase.model.TransactionResult cleanup()
          This method will be executed after a successful execution of execute() 55 .
 openfuture.bugbase.model.TransactionResult execute()
          Core execution of the transaction.
 java.lang.String getDescription()
          Description for this version update.
 openfuture.bugbase.model.Version getVersion()
          Persistency version after this update.
private  java.lang.String join(java.lang.String separator, java.util.LinkedList strings)
           
 openfuture.bugbase.model.VersionUpdate predecessor()
          No predecessor available.
 openfuture.bugbase.model.TransactionResult rollback()
          This method will be executed after a unsuccessful execution of execute() 55 .
 openfuture.bugbase.model.TransactionResult setup()
          Setup before the transaction core is executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

private openfuture.bugbase.model.Version version

connection

private java.sql.Connection connection

persistency

private openfuture.bugbase.domain.Persistency persistency

bugreportColumns

private java.util.LinkedList bugreportColumns

bugreportColtypes

private java.util.LinkedList bugreportColtypes

doctorColumns

private java.util.LinkedList doctorColumns

doctorColtypes

private java.util.LinkedList doctorColtypes

doctorConstraints

private java.util.LinkedList doctorConstraints

bugreportBackupTable

private java.lang.String bugreportBackupTable

doctorBackupTable

private java.lang.String doctorBackupTable
Constructor Detail

CreateDBUsersUpdate

public CreateDBUsersUpdate(openfuture.bugbase.domain.Persistency persistency)
Method Detail

setup

public openfuture.bugbase.model.TransactionResult setup()
Setup before the transaction core is executed.
  • Copy the table bugreports to bugreports_backup.
  • Copy the table doctors to doctors_backup.

Specified by:
setup in interface openfuture.bugbase.model.Transaction

execute

public openfuture.bugbase.model.TransactionResult execute()
Core execution of the transaction.
  • drop table 'bugreports'
  • create it new with columns 'emailReporter' and 'emailDoctor' renamed to 'reporter' and 'doctor'
  • copy entries from 'bugreports_backup' to 'bugreports'.
  • replace email addresses of reporter and doctor byte their userid
  • create database users for each user entry whith password equals to the userid.

Specified by:
execute in interface openfuture.bugbase.model.Transaction

cleanup

public openfuture.bugbase.model.TransactionResult cleanup()
This method will be executed after a successful execution of execute() 55 .
  • drop table 'bugreports_backup'

Specified by:
cleanup in interface openfuture.bugbase.model.Transaction

rollback

public openfuture.bugbase.model.TransactionResult rollback()
This method will be executed after a unsuccessful execution of execute() 55 .
  • copy table 'bugreports_backup' back to table 'bugreports'
  • drop table 'bugreports_backup'

Specified by:
rollback in interface openfuture.bugbase.model.Transaction

getDescription

public java.lang.String getDescription()
Description copied from interface: openfuture.bugbase.model.Transaction
Description for this version update.

Specified by:
getDescription in interface openfuture.bugbase.model.Transaction

predecessor

public final openfuture.bugbase.model.VersionUpdate predecessor()
No predecessor available.

Specified by:
predecessor in interface openfuture.bugbase.model.VersionUpdate

getVersion

public final openfuture.bugbase.model.Version getVersion()
Persistency version after this update.

Specified by:
getVersion in interface openfuture.bugbase.model.VersionUpdate

join

private java.lang.String join(java.lang.String separator,
                              java.util.LinkedList strings)