|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object openlsd.appli.autoimport.commonimport.LSDCommonFunctions
public class LSDCommonFunctions
Class for common functions in Import methods
Field Summary | |
---|---|
protected java.io.File |
file
File to import |
protected boolean |
isBatch
Is import in Batch mode |
static int |
nbblock
Number of documents by block to import (20 is apparently optimal by testing); must be between 1 and 100 |
Constructor Summary | |
---|---|
LSDCommonFunctions(java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> queue,
java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> result,
java.io.File file,
boolean isBatch)
Constructor from args |
Method Summary | |
---|---|
protected static void |
closefile(java.nio.channels.FileChannel filechannelIn)
Close the filechannelIn |
static boolean |
delDocument(LSDDbAdmin admin,
LSDDbLegacy legacy,
LSDExtDbDocument document)
Del the document deleted when OK. |
static LSDExtDbDocument |
getDocument(LSDDbAdmin admin,
long lid,
LSDBusiness lsdb)
Get Document from args. lsdb object must contains unique index information. |
static LSDExtDbDocument |
getNewStorageDocumentProcedureCommit(LSDDbAdmin admin,
LSDDbLegacy legacy,
long filesize,
LSDBusiness lsdb,
boolean sameLegacy,
boolean isMove)
Get New Storage for New Document. |
static LSDExtDbDocument[] |
getNewStorageDocumentsProcedureCommit(LSDDbAdmin admin,
LSDDbLegacy legacy,
LSDExtQueueMembers members,
boolean sameLegacy,
boolean isMove)
Get New Storage for a set of New Documents. |
static boolean |
setNewStorageDocument(LSDDbAdmin admin,
LSDDbLegacy legacy,
LSDExtDbDocument document,
LSDExtDbDocument documentnew,
boolean inserted)
Set New Storage for New Document if it was inserted, or Set Storage as its previous state and not Set Document |
protected void |
setOutput(LSDDbAdmin admin,
LSDDbLegacy legacy,
LSDExtDbDocument document,
LSDExtQueueMember member,
java.lang.String message,
boolean status)
Set output according to the status (True ok, False wrong) |
void |
setQueueb(java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> queue)
Constructor from args |
static boolean |
testPreviousFile(LSDDbAdmin admin,
LSDExtQueueMember member,
LSDDbLegacy legacy,
LSDExtDbDocument document)
During import, Test if previous files are really differents or not and remove the DB ref if it is really the same. |
int |
tryImportOneFile(LSDDbAdmin admin,
boolean isLocal,
LSDExtQueueMember member,
LSDDbLegacy legacy,
java.nio.channels.FileChannel filechannelIn,
LSDExtDbDocument document)
Real Import of one file where all necessary info are already OK (directly from Block mode or from tryImportOneNewFile) |
LSDExtDbDocument |
tryImportOneNewFile(LSDDbAdmin admin,
boolean isLocal,
LSDExtQueueMember member,
LSDDbLegacy legacy,
java.nio.channels.FileChannel filechannelIn,
long filesize)
Import 1 file by the simple way (not a set of files) so requests necessary info for this new file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File file
protected boolean isBatch
public static int nbblock
Constructor Detail |
---|
public LSDCommonFunctions(java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> queue, java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> result, java.io.File file, boolean isBatch)
queue
- result
- file
- isBatch
- Method Detail |
---|
public void setQueueb(java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> queue)
queue
- public static LSDExtDbDocument getDocument(LSDDbAdmin admin, long lid, LSDBusiness lsdb)
admin
- lid
- lsdb
-
public static boolean delDocument(LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document)
admin
- legacy
- document
-
public static LSDExtDbDocument getNewStorageDocumentProcedureCommit(LSDDbAdmin admin, LSDDbLegacy legacy, long filesize, LSDBusiness lsdb, boolean sameLegacy, boolean isMove)
admin
- legacy
- filesize
- lsdb
- sameLegacy
- isMove
-
public static LSDExtDbDocument[] getNewStorageDocumentsProcedureCommit(LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtQueueMembers members, boolean sameLegacy, boolean isMove)
admin
- legacy
- members
- sameLegacy
- isMove
-
public static boolean setNewStorageDocument(LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document, LSDExtDbDocument documentnew, boolean inserted)
admin
- legacy
- document
- only in move (previous document)documentnew
- in importinserted
-
public static boolean testPreviousFile(LSDDbAdmin admin, LSDExtQueueMember member, LSDDbLegacy legacy, LSDExtDbDocument document)
admin
- member
- legacy
- document
-
protected static void closefile(java.nio.channels.FileChannel filechannelIn)
filechannelIn
- protected void setOutput(LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document, LSDExtQueueMember member, java.lang.String message, boolean status)
admin
- legacy
- document
- member
- message
- status
- public int tryImportOneFile(LSDDbAdmin admin, boolean isLocal, LSDExtQueueMember member, LSDDbLegacy legacy, java.nio.channels.FileChannel filechannelIn, LSDExtDbDocument document) throws LSDNoConnexionException, LSDImportNoActionException, LSDImportDbFileDelException, LSDImportDbDelException
admin
- isLocal
- member
- legacy
- filechannelIn
- document
-
LSDNoConnexionException
- KO Mina no connect
LSDImportNoActionException
- Ko but no Action to do
LSDImportDbFileDelException
- KO need to delete Db and File
LSDImportDbDelException
- KO need to delete Dbpublic LSDExtDbDocument tryImportOneNewFile(LSDDbAdmin admin, boolean isLocal, LSDExtQueueMember member, LSDDbLegacy legacy, java.nio.channels.FileChannel filechannelIn, long filesize)
admin
- isLocal
- member
- legacy
- filechannelIn
- filesize
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |