openlsd.multiple.autoimport
Class LSDAutoImportBlock

java.lang.Object
  extended by openlsd.appli.autoimport.commonimport.LSDImportAbstract
      extended by openlsd.appli.autoimport.LSDAutoImportBlock
          extended by openlsd.multiple.autoimport.LSDAutoImportBlock

public class LSDAutoImportBlock
extends LSDAutoImportBlock

Class to auto import files into DB and LSD using Block Thread Import while trying to limit the number of open connections (socket) for info or delete connections.

Author:
Frederic Bregier LGPL

Field Summary
 
Fields inherited from class openlsd.appli.autoimport.LSDAutoImportBlock
delay, globalfile
 
Fields inherited from class openlsd.appli.autoimport.commonimport.LSDImportAbstract
admin, async, blockmode, countKO, countOK, date_debut, dbconns, dir1, doneQueue, errorList, ext1, extidb, extKO, extOK, extStop, file0, fileKO, filename2Out, fileOK, isCompressed, isSameLid, istesting, KO, lcd, lci, lcp, lcps, lid0, listFiles, listline, llc, lsdb, nbFile, nbthread, option, passwd, sameDbConnMyltithread, sameLegacy, sameLid, source2, targetIdip, todelete, todoQueue, todoQueueB, todoQueueBLocal, todoQueueLocal, todoQueues, todoQueuesB, use2Out
 
Constructor Summary
protected LSDAutoImportBlock(LSDDbAdmin admin)
          Create a LSDCheck from args
protected LSDAutoImportBlock(LSDLoadConfig llc)
          Create a LSDCheck from args
 
Method Summary
static void main(java.lang.String[] args)
          Run auto import
 boolean runImport()
          Run import
 
Methods inherited from class openlsd.appli.autoimport.LSDAutoImportBlock
privateInitializeArgs
 
Methods inherited from class openlsd.appli.autoimport.commonimport.LSDImportAbstract
errorFromPrepareImportQueue, finalizeAfterAutoImport, finalizeAfterImport, finalizeConnection, finalizeRegisterFile, finishAfterAutoImport, getClientPutInfo, getClientPutInfoFromIpPort, getIndexFromString, getIpPortC, getIpPortP, getLegacy, initConnection, initializeArgs, initOneFileOption, initOptions, initOptionsAuto, initRegisterFile, joinConnection, prepareImportQueue, registerFalseFile, registerFalseFile, registerTrueFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSDAutoImportBlock

protected LSDAutoImportBlock(LSDLoadConfig llc)
Create a LSDCheck from args

Parameters:
llc -

LSDAutoImportBlock

protected LSDAutoImportBlock(LSDDbAdmin admin)
Create a LSDCheck from args

Parameters:
admin -
Method Detail

main

public static void main(java.lang.String[] args)
Run auto import

Parameters:
args - with the config filename as first arg. As second group of args:
-testing set the import as testing mode for simple test where idmetier get the curdate added: not for use in production
-nbthread nbthread (set the number of threads)
-nbblock nbblock (set the number of files in one block)
-async set the connection mode to OpenLSD Server as asynchrone (first launch connection, then do other stuff, then join the connection
-dbconn set that each thread will have its own db connexion, less efficient solution but less database connection
-nodelete set no delete file after import but save one file with same name and extension=".ok" or ".ko" according to the import status. Only one option can be set between -delete and -nodelete.
-delete (default option) delete file when correctly imported or save one file with the same name and extension=".ko". Only one option can be set between -delete and -nodelete.
-2out set the out status to 2 files in the import source directory, one ".ok", another one ".ko" according to the import status
-compressed set the connection mode to OpenLSD Server as using a compressed mode (useful only in Net mode where files can be compressed)
-samelid lid
where it specifies that it will be the same lid for all files (optimization) (in Block Mode, this is MANDATORY)
-delay set the delay between two scan of the source directory in ms
-idip set the idip of the target OpenLSD Server (should be either Protected or Compressed ports id)
As third group of args where only one option is possible and mandatory:
-dir directory extension (each file has one file with same name and the extension containing "lid idb")

runImport

public boolean runImport()
Run import

Overrides:
runImport in class LSDAutoImportBlock
Returns:
True if OK