2.8.0: 2008-09-08

net.sf.basedb.clients.migrate
Class ProtocolTypeTransfer

java.lang.Object
  extended by net.sf.basedb.clients.migrate.Manager
      extended by net.sf.basedb.clients.migrate.Transfer
          extended by net.sf.basedb.clients.migrate.ProtocolTypeTransfer

public class ProtocolTypeTransfer
extends Transfer

Transfers protocol types that do not exist in BASE 2. If names in lowercase match an existing protocol type it is skipped.

Version:
2.0
Author:
Gregory, Martin
Last modified
$Date: 2008-09-05 17:15:54 +0200 (Fri, 05 Sep 2008) $

Field Summary
(package private)  HashMap<String,ProtocolType> existingProtocolTypes
           
private static Logger log
          Logger for this class
 
Fields inherited from class net.sf.basedb.clients.migrate.Transfer
BASE2, FROM, itemList, LIMIT, LOCAL_MYSQL_TRANSFER, mapIds, progress, properties, QUICK_TRANSFER, selectOffset, sessionControl, TO
 
Constructor Summary
ProtocolTypeTransfer()
           
 
Method Summary
protected  ProtocolType createItem(DbControl b2c, ResultSet rs)
          Creates a ProtocolType from the current position in ResultSet.
 ProtocolType getProtocolTypeById(DbControl dbc, int base1ProtocolTypeId)
          Returns a ProtocolTyp from the given base 1 protocol type id.
 void start()
          Starts the actual transfer.
 
Methods inherited from class net.sf.basedb.clients.migrate.Transfer
cleanUpMemory, commit, createItem, dependencyFailure, done, getBase2Id, getBatchSize, getCount, getDependencyStatus, getIdMap, getInt, getProperty, initIdMap, isDone, mapId, newDbControl, readRestorePointData, run, run, runUnBatched, saveItem, setup, startProgress, writeRestorePointData
 
Methods inherited from class net.sf.basedb.clients.migrate.Manager
getPreparedStatements, prepareStatementFromFile, print, printDate, setPreparedStatements, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final Logger log
Logger for this class


existingProtocolTypes

HashMap<String,ProtocolType> existingProtocolTypes
Constructor Detail

ProtocolTypeTransfer

ProtocolTypeTransfer()
Method Detail

start

public void start()
Description copied from class: Transfer
Starts the actual transfer.

Specified by:
start in class Transfer

createItem

protected ProtocolType createItem(DbControl b2c,
                                  ResultSet rs)
                           throws BaseException,
                                  SQLException
Creates a ProtocolType from the current position in ResultSet.

Overrides:
createItem in class Transfer
Parameters:
b2c - DbControl used to transfer this item
rs - ResultSet containing the data for this item.
Returns:
null the ProtocolType is already saved.
Throws:
BaseException - If a new ProtocolType cannot be created.
SQLException - If current ResultSet position is invalid or number of columns in the select statement is to low.

getProtocolTypeById

public ProtocolType getProtocolTypeById(DbControl dbc,
                                        int base1ProtocolTypeId)
Returns a ProtocolTyp from the given base 1 protocol type id.

Parameters:
dbc - DbControl used to transfer this item
base1ProtocolTypeId -
Returns:
ProtocolType or null if a protocol with that id doesn't exist.
Throws:
BaseException - If a new ProtocolType cannot be created.

2.8.0: 2008-09-08