openlsd.appli.autoimport.commonimport.LSDImportAbstract Class Reference

Inheritance diagram for openlsd.appli.autoimport.commonimport.LSDImportAbstract:

Inheritance graph
[legend]
Collaboration diagram for openlsd.appli.autoimport.commonimport.LSDImportAbstract:

Collaboration graph
[legend]

List of all members.


Detailed Description

Simple class that shared common things and methods between importers
Author:
Frederic BREGIER LGPL 2007

Public Member Functions

boolean initRegisterFile ()

Static Public Member Functions

static void registerFalseFile (LSDExtQueueMember member, String message)
static void registerFalseFile (String filename, String message)
static void registerTrueFile (LSDExtQueueMember member, boolean createOKFile)

Public Attributes

long targetIdip = LSDConstants.invalide_idx

Static Public Attributes

static final String extOK = ".ok"
static final String extKO = ".ko"

Protected Member Functions

int privateInitializeArgs (String[] args, int curargs)
int initializeArgs (String[] args, int curargs)
 LSDImportAbstract (LSDLoadConfig llc, boolean blockmode)
 LSDImportAbstract (LSDDbAdmin admin, boolean blockmode)
boolean getIndexFromString (String line)
boolean initOptions (String[]args, int curargs)
boolean initOneFileOption (int curargs, String[]args)
boolean initOptionsAuto (String[]args, int curargs)
boolean initConnection ()
boolean prepareImportQueue ()
boolean joinConnection ()
boolean errorFromPrepareImportQueue ()
boolean finalizeAfterImport ()
boolean finishAfterAutoImport ()
boolean finalizeAfterAutoImport ()
boolean finalizeConnection ()
void finalizeRegisterFile ()
boolean getClientPutInfo (LSDDbLegacy legacy, boolean compressedClient, boolean keepalived)
boolean getClientPutInfoFromIpPort (LSDDbLegacy legacy, LSDDbIpPort ipportUser1, LSDDbIpPort ipportProt1, boolean keepalived)
LSDDbLegacy getLegacy (long lid)
LSDDbIpPort getIpPortC (LSDDbLegacy legacy)
LSDDbIpPort getIpPortP (LSDDbLegacy legacy)

Protected Attributes

LSDDbAdmin admin = null
LSDLoadConfig llc = null
boolean isSameLid = false
long sameLid = LSDConstants.invalide_idx
LSDDbLegacy sameLegacy = null
boolean todelete = true
int option = -1
String file0 = null
long lid0 = LSDConstants.invalide_idx
LSDBusiness lsdb = null
LSDExtClientInfo lci = null
LSDClientPut lcp = null
LSDClientDelete lcd = null
String passwd = null
String dir1 = null
String ext1 = null
String source2 = null
boolean blockmode = false
ConcurrentLinkedQueue
< LSDExtQueueMember
todoQueue = null
ConcurrentLinkedQueue
< LSDExtQueueMembers
todoQueueB = null
ConcurrentLinkedQueue
< LSDExtQueueMember
doneQueue = null
int nbFile = 1
int nbthread = 1
String extidb = null
boolean sameDbConnMyltithread = false
boolean async = false
boolean isCompressed = false
LSDClientPut[] lcps = null
LSDDbAdmin[] dbconns = null
File[] listFiles = null
LinkedList< String > listline = null
ConcurrentLinkedQueue
< LSDExtQueueMember >[] 
todoQueues = null
ConcurrentLinkedQueue
< LSDExtQueueMembers >[] 
todoQueuesB = null
ConcurrentLinkedQueue
< LSDExtQueueMember
todoQueueLocal = null
ConcurrentLinkedQueue
< LSDExtQueueMembers
todoQueueBLocal = null
LinkedList< String > errorList = null
String extStop = null
String filename2Out = null

Static Protected Attributes

static long KO = 0
static boolean istesting = false
static Date date_debut = null
static boolean use2Out = false
static FileWriter fileOK = null
static FileWriter fileKO = null
static long countKO = 0
static long countOK = 0

Constructor & Destructor Documentation

openlsd.appli.autoimport.commonimport.LSDImportAbstract.LSDImportAbstract ( LSDLoadConfig  llc,
boolean  blockmode 
) [protected]

Create a LSDImport from args

Parameters:
llc 
blockmode 

openlsd.appli.autoimport.commonimport.LSDImportAbstract.LSDImportAbstract ( LSDDbAdmin  admin,
boolean  blockmode 
) [protected]

Create a LSDImport from args

Parameters:
admin 
blockmode 


Member Function Documentation

int openlsd.appli.autoimport.commonimport.LSDImportAbstract.privateInitializeArgs ( String[]  args,
int  curargs 
) [protected]

Function to override for specific initialization values

Parameters:
args 
curargs 
Returns:
the next current rank

Reimplemented in openlsd.appli.autoimport.LSDAutoImport, and openlsd.appli.autoimport.LSDAutoImportBlock.

int openlsd.appli.autoimport.commonimport.LSDImportAbstract.initializeArgs ( String[]  args,
int  curargs 
) [protected]

Get arguments

Parameters:
args 
curargs 
Returns:
the next current rank

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.getIndexFromString ( String  line  )  [protected]

Get file, lid and idb from the String line where a blank character is a separator. Should be override to explicitly specify how to use the correct business implementation.

Parameters:
line 
Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.initOptions ( String[]  args,
int  curargs 
) [protected]

Finalize Init options from args

Parameters:
args 
curargs 
Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.initOneFileOption ( int  curargs,
String[]  args 
) [protected]

Init one File option form args and current position (must be override)

Parameters:
curargs 
args 
Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.initRegisterFile (  ) 

Create OK and KO files

Returns:
True if OK else False

static void openlsd.appli.autoimport.commonimport.LSDImportAbstract.registerFalseFile ( LSDExtQueueMember  member,
String  message 
) [static]

Register a File as member as False import

Parameters:
member 
message 

static void openlsd.appli.autoimport.commonimport.LSDImportAbstract.registerFalseFile ( String  filename,
String  message 
) [static]

Register a File as filename as False import

Parameters:
filename 
message 

static void openlsd.appli.autoimport.commonimport.LSDImportAbstract.registerTrueFile ( LSDExtQueueMember  member,
boolean  createOKFile 
) [static]

Register a File as True import

Parameters:
member 
createOKFile 

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.initOptionsAuto ( String[]  args,
int  curargs 
) [protected]

Finalize Init options from args for AutoImport

Parameters:
args 
curargs 
Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.initConnection (  )  [protected]

InitConnection. Must be followed later on by joinConnection()

Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.prepareImportQueue (  )  [protected]

Prepare the Import Queue

Returns:
True if OK, else False

Reimplemented in openlsd.server.autoimport.commonimport.LSDServerImportAbstract, and openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.joinConnection (  )  [protected]

Finalize connection if they are pending

Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.errorFromPrepareImportQueue (  )  [protected]

Set the error status from prepareImportQueue

Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.finalizeAfterImport (  )  [protected]

Finalize status and object after import and close LSD connections

Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.finishAfterAutoImport (  )  [protected]

Finalize status and object after import for AutoImport

Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.finalizeAfterAutoImport (  )  [protected]

Finalize and close LSD connections for AutoImport

Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.finalizeConnection (  )  [protected]

Finalize connection (database)

Returns:
True if OK, else False

Reimplemented in openlsm.autoimport.commonimport.LSMImportAbstract.

void openlsd.appli.autoimport.commonimport.LSDImportAbstract.finalizeRegisterFile (  )  [protected]

Finalize registered files for OK and KO

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.getClientPutInfo ( LSDDbLegacy  legacy,
boolean  compressedClient,
boolean  keepalived 
) [protected]

Get a LSDClientPut and LSDClientInfo and LSDClientDelete for the Legacy and using the extension of PutSessionHandler and InfoSessionHandler.

Parameters:
legacy 
compressedClient 
keepalived 
Returns:
True if OK, else False

boolean openlsd.appli.autoimport.commonimport.LSDImportAbstract.getClientPutInfoFromIpPort ( LSDDbLegacy  legacy,
LSDDbIpPort  ipportUser1,
LSDDbIpPort  ipportProt1,
boolean  keepalived 
) [protected]

Get a LSDClientPut and LSDClientInfo and LSDClientDelete for the Legacy and using the extension of PutSessionHandler and InfoSessionHandler.

Parameters:
legacy 
ipportUser1 
ipportProt1 
keepalived 
Returns:
True if OK, else False

LSDDbLegacy openlsd.appli.autoimport.commonimport.LSDImportAbstract.getLegacy ( long  lid  )  [protected]

Get the Legacy corresponding to the Legacy lid

Parameters:
lid 
Returns:
the LSDDBLegacy or null if an error occurs.

LSDDbIpPort openlsd.appli.autoimport.commonimport.LSDImportAbstract.getIpPortC ( LSDDbLegacy  legacy  )  [protected]

Get the IpPort correspondig to the Legacy for Compress

Parameters:
legacy 
Returns:
The LSDDbIpPort or null if an error occurs.

LSDDbIpPort openlsd.appli.autoimport.commonimport.LSDImportAbstract.getIpPortP ( LSDDbLegacy  legacy  )  [protected]

Get the IpPort correspondig to the Legacy for Protected

Parameters:
legacy 
Returns:
The LSDDbIpPort or null if an error occurs.


Member Data Documentation

DB Admin object

LoadConfig from file

Does this Import using the same Legacy for all files

If Same Legacy, which Legacy Id

If Same Legacy, which Legacy Object

Does the file after successful import should be deleted

Which mode: 0 = file lid idb, 1 = dir extension, 2 = sourcefile

Mode 0: the file

Mode 0: the Legacy Id

Mode 0: the ID Business

Info Client

Put Client

Delete Client

Password for Delete Client

Mode 1: Directory

Mode 1: Extension

Mode 2: Source filename

Mode block

Queue of files to import in non block mode

Queue of files to import in block mode

Queue of imported files

Number of Files

Number of KO files

Number of threads

test only

test only

test only

Is DB Conn using thread shared connection

Should the connection done as async (join with a future)

Using compression

Client connections

Database connections

List of files from -dir option

List of line from -source option

todo Queues for non block mode

todo Queues for block mode

todo local Queue for non block mode

todo local Queue for block mode

List of files in error from init part

File that stops the process when it exists for AutoImport

Should we use two files as exit (OK and KO) or one KO by file

Basename for 2out files

FileWriter for OK status if use2Out is true

FileWriter for KO status if use2Out is true

Number of KO files

Number of OK files

Target if any by default (implies the use of -samelid option) (ML Support)

Extension for OK files

Extension for KO files


The documentation for this class was generated from the following file: