Public Member Functions | |
LSDCommonFunctions (ConcurrentLinkedQueue< LSDExtQueueMember > queue, ConcurrentLinkedQueue< LSDExtQueueMember > result, File file, boolean isBatch) | |
void | setQueueb (ConcurrentLinkedQueue< LSDExtQueueMember > queue) |
int | tryImportOneFile (LSDDbAdmin admin, boolean isLocal, LSDExtQueueMember member, LSDDbLegacy legacy, FileChannel filechannelIn, LSDExtDbDocument document) throws LSDNoConnexionException, LSDImportNoActionException, LSDImportDbFileDelException, LSDImportDbDelException |
LSDExtDbDocument | tryImportOneNewFile (LSDDbAdmin admin, boolean isLocal, LSDExtQueueMember member, LSDDbLegacy legacy, FileChannel filechannelIn, long filesize) |
Static Public Member Functions | |
static LSDExtDbDocument | getDocument (LSDDbAdmin admin, long lid, LSDBusiness lsdb) |
static boolean | delDocument (LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document) |
static LSDExtDbDocument | getNewStorageDocumentProcedureCommit (LSDDbAdmin admin, LSDDbLegacy legacy, long filesize, LSDBusiness lsdb, boolean sameLegacy, boolean isMove) |
static LSDExtDbDocument[] | getNewStorageDocumentsProcedureCommit (LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtQueueMembers members, boolean sameLegacy, boolean isMove) |
static boolean | setNewStorageDocument (LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document, LSDExtDbDocument documentnew, boolean inserted) |
static boolean | testPreviousFile (LSDDbAdmin admin, LSDExtQueueMember member, LSDDbLegacy legacy, LSDExtDbDocument document) |
Static Public Attributes | |
static int | nbblock = 20 |
Protected Member Functions | |
void | setOutput (LSDDbAdmin admin, LSDDbLegacy legacy, LSDExtDbDocument document, LSDExtQueueMember member, String message, boolean status) |
Static Protected Member Functions | |
static void | closefile (FileChannel filechannelIn) |
Protected Attributes | |
File | file = null |
boolean | isBatch = true |
Private Member Functions | |
void | reopenfile (FileChannel filechannelIn) |
void | finishfile (LSDExtQueueMember member, String message) |
Private Attributes | |
ConcurrentLinkedQueue < LSDExtQueueMember > | queue = null |
ConcurrentLinkedQueue < LSDExtQueueMember > | result = null |
openlsd.appli.autoimport.commonimport.LSDCommonFunctions.LSDCommonFunctions | ( | ConcurrentLinkedQueue< LSDExtQueueMember > | queue, | |
ConcurrentLinkedQueue< LSDExtQueueMember > | result, | |||
File | file, | |||
boolean | isBatch | |||
) |
Constructor from args
queue | ||
result | ||
file | ||
isBatch |
void openlsd.appli.autoimport.commonimport.LSDCommonFunctions.setQueueb | ( | ConcurrentLinkedQueue< LSDExtQueueMember > | queue | ) |
Constructor from args
queue |
static LSDExtDbDocument openlsd.appli.autoimport.commonimport.LSDCommonFunctions.getDocument | ( | LSDDbAdmin | admin, | |
long | lid, | |||
LSDBusiness | lsdb | |||
) | [static] |
Get Document from args. lsdb object must contains unique index information.
admin | ||
lid | ||
lsdb |
static boolean openlsd.appli.autoimport.commonimport.LSDCommonFunctions.delDocument | ( | LSDDbAdmin | admin, | |
LSDDbLegacy | legacy, | |||
LSDExtDbDocument | document | |||
) | [static] |
Del the document deleted when OK. It updates also the associated Storage
admin | ||
legacy | ||
document |
static LSDExtDbDocument openlsd.appli.autoimport.commonimport.LSDCommonFunctions.getNewStorageDocumentProcedureCommit | ( | LSDDbAdmin | admin, | |
LSDDbLegacy | legacy, | |||
long | filesize, | |||
LSDBusiness | lsdb, | |||
boolean | sameLegacy, | |||
boolean | isMove | |||
) | [static] |
Get New Storage for New Document. If it already exist, return false. This version uses a stored procedure: insertdoccommit. Commit is done once the storage is updated and document is inserted (must be updated manually after).
admin | ||
legacy | ||
filesize | ||
lsdb | ||
sameLegacy | ||
isMove |
static LSDExtDbDocument [] openlsd.appli.autoimport.commonimport.LSDCommonFunctions.getNewStorageDocumentsProcedureCommit | ( | LSDDbAdmin | admin, | |
LSDDbLegacy | legacy, | |||
LSDExtQueueMembers | members, | |||
boolean | sameLegacy, | |||
boolean | isMove | |||
) | [static] |
Get New Storage for a set of New Documents. If they already exist, return null. This version uses a stored procedure: insertdocscommit. Commit is done once the storage is updated and all documents are inserted at all (must be updated manually after). (only LSDConstants.NBLINEOP members can be handle at a time due to a limitation of VARCHAR2 as out in PL/SQL procedures)
admin | ||
legacy | ||
members | ||
sameLegacy | ||
isMove |
Reimplemented in openlsd.multiple.autoimport.commonimport.LSDCommonFunctionsExtOp.
static boolean openlsd.appli.autoimport.commonimport.LSDCommonFunctions.setNewStorageDocument | ( | LSDDbAdmin | admin, | |
LSDDbLegacy | legacy, | |||
LSDExtDbDocument | document, | |||
LSDExtDbDocument | documentnew, | |||
boolean | inserted | |||
) | [static] |
Set New Storage for New Document if it was inserted, or Set Storage as its previous state and not Set Document
admin | ||
legacy | ||
document | only in move (previous document) | |
documentnew | in import | |
inserted |
static boolean openlsd.appli.autoimport.commonimport.LSDCommonFunctions.testPreviousFile | ( | LSDDbAdmin | admin, | |
LSDExtQueueMember | member, | |||
LSDDbLegacy | legacy, | |||
LSDExtDbDocument | document | |||
) | [static] |
During import, Test if previous files are really differents or not and remove the DB ref if it is really the same. If so, it try to remove the LSD file (which is in bad status). It does not remove any LSD File that has a valid entry in DB.
admin | ||
member | ||
legacy | ||
document |
static void openlsd.appli.autoimport.commonimport.LSDCommonFunctions.closefile | ( | FileChannel | filechannelIn | ) | [static, protected] |
Close the filechannelIn
filechannelIn |
void openlsd.appli.autoimport.commonimport.LSDCommonFunctions.reopenfile | ( | FileChannel | filechannelIn | ) | [private] |
Reset the position from beginning
filechannelIn |
void openlsd.appli.autoimport.commonimport.LSDCommonFunctions.finishfile | ( | LSDExtQueueMember | member, | |
String | message | |||
) | [private] |
finish task for current file (delete or not, set or not the OK/KO file)
member | ||
message |
void openlsd.appli.autoimport.commonimport.LSDCommonFunctions.setOutput | ( | LSDDbAdmin | admin, | |
LSDDbLegacy | legacy, | |||
LSDExtDbDocument | document, | |||
LSDExtQueueMember | member, | |||
String | message, | |||
boolean | status | |||
) | [protected] |
Set output according to the status (True ok, False wrong)
admin | ||
legacy | ||
document | ||
member | ||
message | ||
status |
int openlsd.appli.autoimport.commonimport.LSDCommonFunctions.tryImportOneFile | ( | LSDDbAdmin | admin, | |
boolean | isLocal, | |||
LSDExtQueueMember | member, | |||
LSDDbLegacy | legacy, | |||
FileChannel | filechannelIn, | |||
LSDExtDbDocument | document | |||
) | throws LSDNoConnexionException, LSDImportNoActionException, LSDImportDbFileDelException, LSDImportDbDelException |
Real Import of one file where all necessary info are already OK (directly from Block mode or from tryImportOneNewFile)
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 Db |
Reimplemented in openlsd.multiple.autoimport.commonimport.LSDCommonFunctionsExtOp.
LSDExtDbDocument openlsd.appli.autoimport.commonimport.LSDCommonFunctions.tryImportOneNewFile | ( | LSDDbAdmin | admin, | |
boolean | isLocal, | |||
LSDExtQueueMember | member, | |||
LSDDbLegacy | legacy, | |||
FileChannel | filechannelIn, | |||
long | filesize | |||
) |
Import 1 file by the simple way (not a set of files) so requests necessary info for this new file.
admin | ||
isLocal | ||
member | ||
legacy | ||
filechannelIn | ||
filesize |
Reimplemented in openlsd.multiple.autoimport.commonimport.LSDCommonFunctionsExtOp.
ConcurrentLinkedQueue<LSDExtQueueMember> openlsd.appli.autoimport.commonimport.LSDCommonFunctions.queue = null [private] |
Queue of work
ConcurrentLinkedQueue<LSDExtQueueMember> openlsd.appli.autoimport.commonimport.LSDCommonFunctions.result = null [private] |
Queue of results
File openlsd.appli.autoimport.commonimport.LSDCommonFunctions.file = null [protected] |
File to import
boolean openlsd.appli.autoimport.commonimport.LSDCommonFunctions.isBatch = true [protected] |
Is import in Batch mode
int openlsd.appli.autoimport.commonimport.LSDCommonFunctions.nbblock = 20 [static] |
Number of documents by block to import (20 is apparently optimal by testing); must be between 1 and 100