|
2.14.2: 2010-02-22 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.clients.migrate.Manager
net.sf.basedb.clients.migrate.Transfer
net.sf.basedb.clients.migrate.SharedItemTransfer
net.sf.basedb.clients.migrate.CommonItemTransfer
net.sf.basedb.clients.migrate.FileTransfer
net.sf.basedb.clients.migrate.UploadFileTransfer
public class UploadFileTransfer
All files are migrated in one go. This is done to ease the transfer of file related items down the road. In BASE 2 files are unique in regards to their md5sum. No files having equal md5sum will be migrated.
Field Summary | |
---|---|
private boolean |
createImage
If createItem(ResultSet) should create an image related file. |
private boolean |
createPrintmap
If createItem(ResultSet) should create a printmap related file. |
private boolean |
createProtocol
If createItem(ResultSet) should create a protocol related file. |
private boolean |
createRawBioAssay
If createItem(ResultSet) should create a rawBioAssay related
file. |
private HashMap<Integer,Integer> |
imageFileMap
Map of image related base 1 -> BASE 2 files |
private static Logger |
log
This class's logger |
private HashMap<String,Integer> |
md5ToIdMap
Stores unique md5 -> fileId |
private String |
path
Current path to files e.g userfiles + "/raw data" |
private HashMap<Integer,Integer> |
printmapFileMap
Map of printmap related base 1 -> BASE 2 files |
private HashMap<Integer,Integer> |
protocolFileMap
Map of protocol related base 1 -> BASE 2 files |
private HashMap<Integer,Integer> |
rawBioAssayFileMap
Map of rawBioAssay related base 1 -> BASE 2 files |
private String |
userfiles
Path to base 1 userfiles e.g. |
private boolean |
useSubpath
Whether or not item id's are used to calculate a subpath directory. |
Fields inherited from class net.sf.basedb.clients.migrate.FileTransfer |
---|
VERIFY_MD5 |
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 | |
---|---|
UploadFileTransfer(UserTransfer userT,
GroupTransfer groupT,
String path)
|
Method Summary | |
---|---|
protected void |
createItem(ResultSet rs)
Creates a file from the current row in the resultSet. |
File |
getFileByMd5(DbControl dc,
User owner,
String md5)
Returns the file matching owner and md5. |
File |
getImageFileById(DbControl dc,
int base1Id)
Returns the image related file matching a base1Id. |
File |
getPrintmapFileById(DbControl dc,
int base1Id)
Returns the printmap related file matching a base1Id. |
File |
getProtocolFileById(DbControl dc,
int base1Id)
Returns the protocol related file matching a base1Id. |
File |
getRawBioAssayFileById(DbControl dc,
int base1Id)
Returns the rawBioAssay related file matching a base1Id. |
void |
start()
Starts this transfer. |
private void |
transferImages(PreparedStatement ps)
Starts transfer of image related files Path to images is hardcoded here. |
private void |
transferPrintmaps(PreparedStatement ps)
Starts transfer of printmap related files Path to printmap is hardcoded here. |
private void |
transferProtocolFiles(PreparedStatement ps)
Starts transfer of protocol related files Path to protocols is hardcoded here. |
private void |
transferRawBioAssayFiles(PreparedStatement ps)
Starts transfer of rawBioAssay related files. |
private void |
transferUploads(PreparedStatement ps)
Starts transfer of upload related files Path to uploads is hardcoded here. |
Methods inherited from class net.sf.basedb.clients.migrate.FileTransfer |
---|
getExistingFile, md5sum, md5sum, replaceForbiddenCharacters, setCommonItemData, transferFile |
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, 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 |
---|
private String userfiles
private String path
private HashMap<String,Integer> md5ToIdMap
private HashMap<Integer,Integer> protocolFileMap
private HashMap<Integer,Integer> imageFileMap
private HashMap<Integer,Integer> printmapFileMap
private HashMap<Integer,Integer> rawBioAssayFileMap
private boolean useSubpath
private boolean createProtocol
createItem(ResultSet)
should create a protocol related file.
private boolean createImage
createItem(ResultSet)
should create an image related file.
private boolean createPrintmap
createItem(ResultSet)
should create a printmap related file.
private boolean createRawBioAssay
createItem(ResultSet)
should create a rawBioAssay related
file.
private static final Logger log
Constructor Detail |
---|
UploadFileTransfer(UserTransfer userT, GroupTransfer groupT, String path)
userT
- UserTransfer used to find owners of filesgroupT
- GroupTransfer used to find group owners of filespath
- Subdirectory within the userfiles directory containing the
files to transferMethod Detail |
---|
public void start()
start
in class Transfer
private void transferRawBioAssayFiles(PreparedStatement ps)
ps
- Select statement listing rawBioAssay's from base 1private void transferPrintmaps(PreparedStatement ps)
ps
- Select statement listing image's from base 1private void transferImages(PreparedStatement ps)
ps
- Select statement listing image's from base 1private void transferProtocolFiles(PreparedStatement ps)
ps
- Select statement listing protocol's from base 1private void transferUploads(PreparedStatement ps)
ps
- Select statement listing upload's from base 1protected void createItem(ResultSet rs) throws BaseException, SQLException
Transfer.runUnBatched(PreparedStatement, int, int)
createItem
in class Transfer
rs
- ResultSet containing information about the file.
BaseException
SQLException
public File getFileByMd5(DbControl dc, User owner, String md5)
dc
- DbControl used to get the fileowner
- md5
-
public File getProtocolFileById(DbControl dc, int base1Id)
dc
- DbControl used to get the file.base1Id
- public File getImageFileById(DbControl dc, int base1Id)
dc
- DbControl used to get the file.base1Id
- public File getPrintmapFileById(DbControl dc, int base1Id)
dc
- DbControl used to get the file.base1Id
- Of the array designpublic File getRawBioAssayFileById(DbControl dc, int base1Id)
dc
- DbControl used to get the file.base1Id
-
|
2.14.2: 2010-02-22 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |