2.10.0: 2009-02-24

net.sf.basedb.clients.migrate
Class MappedPlateTransfer

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.SharedItemTransfer
              extended by net.sf.basedb.clients.migrate.CommonItemTransfer
                  extended by net.sf.basedb.clients.migrate.MappedPlateTransfer

public class MappedPlateTransfer
extends CommonItemTransfer

Base 1 tables
PlateParent, Plate, PlateType
Unused columns
Plate: addedDate, wizzzard
Notes

Version:
2.0
Author:
Gregory, Martin
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Nested Class Summary
private  class MappedPlateTransfer.Parents
           
 
Field Summary
private  Map<Integer,Boolean> destroyedPlates
          Indicates which plates should be destroyed.
private static Logger log
          Logger for this class
private  Map<Integer,MappedPlateTransfer.Parents> plateMappings
           
private  PlateTypeTransfer plateTypeT
           
private  UnmappedPlateTransfer unmappedPlateT
           
 
Fields inherited from class net.sf.basedb.clients.migrate.CommonItemTransfer
DESCRIPTION, NAME, REMOVED
 
Fields inherited from class net.sf.basedb.clients.migrate.SharedItemTransfer
GID, GROUP_ACCESS, groupT, ID, OWNER, userT, WORLD_ACCESS
 
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
MappedPlateTransfer(UserTransfer userT, GroupTransfer groupT, PlateTypeTransfer plateTypeT, ReporterTransfer reporterT, UnmappedPlateTransfer unmappedPlateT)
          Constructs a new MappedPlateTransfer.
 
Method Summary
(package private)  void createItem(ResultSet rs)
          Transfers using Transfer.runUnBatched(PreparedStatement,int,int) must override this method.
private  void createPlateMappings()
          This method saves parents for each plate in an array for easy access later in createItem(ResultSet).
 void destroyPlates()
          After all plates have been transferred we destroy those that have the destroyed flag set.
 PlateMapping findPlateMapping(DbControl dc, int sourcePlates, int sourceRows, int sourceColumns, int destinationPlates, int destinationRows, int destinationColumns)
           
 Integer getBase2Id(int base1PlateId)
          Get the Base 2 ID when you know the Base 1 ID.
(package private)  Plate getPlateById(DbControl dc, int base1PlateId)
          Returns a Plate from the given base 1 plate id.
 void start()
          Starts the actual transfer.
 
Methods inherited from class net.sf.basedb.clients.migrate.CommonItemTransfer
setCommonItemData
 
Methods inherited from class net.sf.basedb.clients.migrate.SharedItemTransfer
chmod, chown, getOwner, setSharedItemData
 
Methods inherited from class net.sf.basedb.clients.migrate.Transfer
cleanUpMemory, commit, createItem, dependencyFailure, done, 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

destroyedPlates

private Map<Integer,Boolean> destroyedPlates
Indicates which plates should be destroyed.


unmappedPlateT

private UnmappedPlateTransfer unmappedPlateT

plateMappings

private Map<Integer,MappedPlateTransfer.Parents> plateMappings

plateTypeT

private PlateTypeTransfer plateTypeT

log

private static final Logger log
Logger for this class

Constructor Detail

MappedPlateTransfer

MappedPlateTransfer(UserTransfer userT,
                    GroupTransfer groupT,
                    PlateTypeTransfer plateTypeT,
                    ReporterTransfer reporterT,
                    UnmappedPlateTransfer unmappedPlateT)
Constructs a new MappedPlateTransfer.

Parameters:
userT - A finished UserTransfer
groupT - A finished GroupTransfer
plateTypeT - A finished PlateTypeTransfer
reporterT - A finished ReporterTransfer
unmappedPlateT - A finished UnmappedPlateTransfer
Method Detail

start

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

Specified by:
start in class Transfer

createPlateMappings

private void createPlateMappings()
This method saves parents for each plate in an array for easy access later in createItem(ResultSet).


createItem

void createItem(ResultSet rs)
          throws BaseException,
                 SQLException
Description copied from class: Transfer
Transfers using Transfer.runUnBatched(PreparedStatement,int,int) must override this method. For each item this method is responsible to create it's own DbControl and save the item to the database.

Overrides:
createItem in class Transfer
Parameters:
rs - ResultSet containing data for the new plate
Throws:
BaseException
SQLException - If current ResultSet position is invalid or number of columns in the select statement is to low.

findPlateMapping

public PlateMapping findPlateMapping(DbControl dc,
                                     int sourcePlates,
                                     int sourceRows,
                                     int sourceColumns,
                                     int destinationPlates,
                                     int destinationRows,
                                     int destinationColumns)

destroyPlates

public void destroyPlates()
After all plates have been transferred we destroy those that have the destroyed flag set.


getPlateById

Plate getPlateById(DbControl dc,
                   int base1PlateId)
             throws BaseException
Returns a Plate from the given base 1 plate id.

Parameters:
dc - DbControl used to get the plate from
base1PlateId -
Throws:
BaseException - if a plate with id base1PlateId doesn't exist.

getBase2Id

public Integer getBase2Id(int base1PlateId)
Description copied from class: Transfer
Get the Base 2 ID when you know the Base 1 ID.

Overrides:
getBase2Id in class Transfer
Parameters:
base1PlateId - The Base 1 ID
Returns:
The Base 2 ID or null if not found

2.10.0: 2009-02-24