|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object openlsd.appli.autoimport.commonimport.LSDImportAbstract
public abstract class LSDImportAbstract
Simple class that shared common things and methods between importers
Field Summary | |
---|---|
protected LSDDbAdmin |
admin
DB Admin object |
protected boolean |
async
Should the connection done as async (join with a future) |
protected boolean |
blockmode
Mode block |
protected static long |
countKO
Number of KO files |
protected static long |
countOK
Number of OK files |
protected static java.util.Date |
date_debut
test only |
protected LSDDbAdmin[] |
dbconns
Database connections |
protected java.lang.String |
dir1
Mode 1: Directory |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> |
doneQueue
Queue of imported files |
protected java.util.LinkedList<java.lang.String> |
errorList
List of files in error from init part |
protected java.lang.String |
ext1
Mode 1: Extension |
protected java.lang.String |
extidb
test only |
static java.lang.String |
extKO
Extension for KO files |
static java.lang.String |
extOK
Extension for OK files |
protected java.lang.String |
extStop
File that stops the process when it exists for AutoImport |
protected java.lang.String |
file0
Mode 0: the file |
protected static java.io.FileWriter |
fileKO
FileWriter for KO status if use2Out is true |
protected java.lang.String |
filename2Out
Basename for 2out files |
protected static java.io.FileWriter |
fileOK
FileWriter for OK status if use2Out is true |
protected boolean |
isCompressed
Using compression |
protected boolean |
isSameLid
Does this Import using the same Legacy for all files |
protected static boolean |
istesting
test only |
protected static long |
KO
Number of KO files |
protected LSDClientDelete |
lcd
Delete Client |
protected LSDExtClientInfo |
lci
Info Client |
protected LSDClientPut |
lcp
Put Client |
protected LSDClientPut[] |
lcps
Client connections |
protected long |
lid0
Mode 0: the Legacy Id |
protected java.io.File[] |
listFiles
List of files from -dir option |
protected java.util.LinkedList<java.lang.String> |
listline
List of line from -source option |
protected LSDLoadConfig |
llc
LoadConfig from file |
protected LSDBusiness |
lsdb
Mode 0: the ID Business |
protected int |
nbFile
Number of Files |
protected int |
nbthread
Number of threads |
protected int |
option
Which mode: 0 = file lid idb, 1 = dir extension, 2 = sourcefile |
protected java.lang.String |
passwd
Password for Delete Client |
protected boolean |
sameDbConnMyltithread
Is DB Conn using thread shared connection |
protected LSDDbLegacy |
sameLegacy
If Same Legacy, which Legacy Object |
protected long |
sameLid
If Same Legacy, which Legacy Id |
protected java.lang.String |
source2
Mode 2: Source filename |
long |
targetIdip
Target if any by default (implies the use of -samelid option) (ML Support) |
protected boolean |
todelete
Does the file after successful import should be deleted |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> |
todoQueue
Queue of files to import in non block mode |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers> |
todoQueueB
Queue of files to import in block mode |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers> |
todoQueueBLocal
todo local Queue for block mode |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> |
todoQueueLocal
todo local Queue for non block mode |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember>[] |
todoQueues
todo Queues for non block mode |
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers>[] |
todoQueuesB
todo Queues for block mode |
protected static boolean |
use2Out
Should we use two files as exit (OK and KO) or one KO by file |
Constructor Summary | |
---|---|
protected |
LSDImportAbstract(LSDDbAdmin admin,
boolean blockmode)
Create a LSDImport from args |
protected |
LSDImportAbstract(LSDLoadConfig llc,
boolean blockmode)
Create a LSDImport from args |
Method Summary | |
---|---|
protected boolean |
errorFromPrepareImportQueue()
Set the error status from prepareImportQueue |
protected boolean |
finalizeAfterAutoImport()
Finalize and close LSD connections for AutoImport |
protected boolean |
finalizeAfterImport()
Finalize status and object after import and close LSD connections |
protected boolean |
finalizeConnection()
Finalize connection (database) |
protected void |
finalizeRegisterFile()
Finalize registered files for OK and KO |
protected boolean |
finishAfterAutoImport()
Finalize status and object after import for AutoImport |
protected boolean |
getClientPutInfo(LSDDbLegacy legacy,
boolean compressedClient,
boolean keepalived)
Get a LSDClientPut and LSDClientInfo and LSDClientDelete for the Legacy and using the extension of PutSessionHandler and InfoSessionHandler. |
protected boolean |
getClientPutInfoFromIpPort(LSDDbLegacy legacy,
LSDDbIpPort ipportUser1,
LSDDbIpPort ipportProt1,
boolean keepalived)
Get a LSDClientPut and LSDClientInfo and LSDClientDelete for the Legacy and using the extension of PutSessionHandler and InfoSessionHandler. |
protected boolean |
getIndexFromString(java.lang.String line)
Get file, lid and idb from the String line where a blank character is a separator. |
protected LSDDbIpPort |
getIpPortC(LSDDbLegacy legacy)
Get the IpPort correspondig to the Legacy for Compress |
protected LSDDbIpPort |
getIpPortP(LSDDbLegacy legacy)
Get the IpPort correspondig to the Legacy for Protected |
protected LSDDbLegacy |
getLegacy(long lid)
Get the Legacy corresponding to the Legacy lid |
protected boolean |
initConnection()
InitConnection. |
protected int |
initializeArgs(java.lang.String[] args,
int curargs)
Get arguments |
protected boolean |
initOneFileOption(int curargs,
java.lang.String[] args)
Init one File option form args and current position (must be override) |
protected boolean |
initOptions(java.lang.String[] args,
int curargs)
Finalize Init options from args |
protected boolean |
initOptionsAuto(java.lang.String[] args,
int curargs)
Finalize Init options from args for AutoImport |
boolean |
initRegisterFile()
Create OK and KO files |
protected boolean |
joinConnection()
Finalize connection if they are pending |
protected boolean |
prepareImportQueue()
Prepare the Import Queue |
protected int |
privateInitializeArgs(java.lang.String[] args,
int curargs)
Function to override for specific initialization values |
static void |
registerFalseFile(LSDExtQueueMember member,
java.lang.String message)
Register a File as member as False import |
static void |
registerFalseFile(java.lang.String filename,
java.lang.String message)
Register a File as filename as False import |
static void |
registerTrueFile(LSDExtQueueMember member,
boolean createOKFile)
Register a File as True import |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LSDDbAdmin admin
protected LSDLoadConfig llc
protected boolean isSameLid
protected long sameLid
protected LSDDbLegacy sameLegacy
protected boolean todelete
protected int option
protected java.lang.String file0
protected long lid0
protected LSDBusiness lsdb
protected LSDExtClientInfo lci
protected LSDClientPut lcp
protected LSDClientDelete lcd
protected java.lang.String passwd
protected java.lang.String dir1
protected java.lang.String ext1
protected java.lang.String source2
protected boolean blockmode
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> todoQueue
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers> todoQueueB
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> doneQueue
protected int nbFile
protected static long KO
protected int nbthread
protected static boolean istesting
protected java.lang.String extidb
protected static java.util.Date date_debut
protected boolean sameDbConnMyltithread
protected boolean async
protected boolean isCompressed
protected LSDClientPut[] lcps
protected LSDDbAdmin[] dbconns
protected java.io.File[] listFiles
protected java.util.LinkedList<java.lang.String> listline
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember>[] todoQueues
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers>[] todoQueuesB
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMember> todoQueueLocal
protected java.util.concurrent.ConcurrentLinkedQueue<LSDExtQueueMembers> todoQueueBLocal
protected java.util.LinkedList<java.lang.String> errorList
protected java.lang.String extStop
protected static boolean use2Out
protected java.lang.String filename2Out
protected static java.io.FileWriter fileOK
protected static java.io.FileWriter fileKO
protected static long countKO
protected static long countOK
public long targetIdip
public static final java.lang.String extOK
public static final java.lang.String extKO
Constructor Detail |
---|
protected LSDImportAbstract(LSDLoadConfig llc, boolean blockmode)
llc
- blockmode
- protected LSDImportAbstract(LSDDbAdmin admin, boolean blockmode)
admin
- blockmode
- Method Detail |
---|
protected int privateInitializeArgs(java.lang.String[] args, int curargs)
args
- curargs
-
protected int initializeArgs(java.lang.String[] args, int curargs)
args
- curargs
-
protected boolean getIndexFromString(java.lang.String line)
line
-
protected boolean initOptions(java.lang.String[] args, int curargs)
args
- curargs
-
protected boolean initOneFileOption(int curargs, java.lang.String[] args)
curargs
- args
-
public boolean initRegisterFile()
public static void registerFalseFile(LSDExtQueueMember member, java.lang.String message)
member
- message
- public static void registerFalseFile(java.lang.String filename, java.lang.String message)
filename
- message
- public static void registerTrueFile(LSDExtQueueMember member, boolean createOKFile)
member
- createOKFile
- protected boolean initOptionsAuto(java.lang.String[] args, int curargs)
args
- curargs
-
protected boolean initConnection()
protected boolean prepareImportQueue()
protected boolean joinConnection()
protected boolean errorFromPrepareImportQueue()
protected boolean finalizeAfterImport()
protected boolean finishAfterAutoImport()
protected boolean finalizeAfterAutoImport()
protected boolean finalizeConnection()
protected void finalizeRegisterFile()
protected boolean getClientPutInfo(LSDDbLegacy legacy, boolean compressedClient, boolean keepalived)
legacy
- compressedClient
- keepalived
-
protected boolean getClientPutInfoFromIpPort(LSDDbLegacy legacy, LSDDbIpPort ipportUser1, LSDDbIpPort ipportProt1, boolean keepalived)
legacy
- ipportUser1
- ipportProt1
- keepalived
-
protected LSDDbLegacy getLegacy(long lid)
lid
-
protected LSDDbIpPort getIpPortC(LSDDbLegacy legacy)
legacy
-
protected LSDDbIpPort getIpPortP(LSDDbLegacy legacy)
legacy
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |