public abstract class GenericFlatFileProcessor extends FileEITransport
Modifier and Type | Field and Description |
---|---|
protected java.io.File |
actfile |
protected PosLineReader |
br |
protected boolean |
debug |
protected java.lang.String |
fileName |
protected static java.lang.String |
FILENAME_NAR_ID |
protected static java.lang.String |
INPUT_BACKUP_DIR |
protected java.io.FileInputStream |
inputStream |
protected java.lang.String |
lineOfText |
protected boolean |
m_bCRLFTerminatorEnabled
This flag specifies if CRLF is active as a line delimiter.
|
protected boolean |
m_bCRTerminatorEnabled
This flag specifies if CR is active as a line delimiter.
|
protected boolean |
m_bLFTerminatorEnabled
This flag specifies if LF is active as a line delimiter.
|
protected long |
numBytes |
static java.lang.String |
PROCESSED_FILE_PREFIX |
static java.lang.String |
PROCESSED_FILE_SUFFIX |
protected java.lang.String |
rawHeader |
protected DCEIRecord |
record
Use one DCEIRecord for all data processing.
|
protected java.io.RandomAccessFile |
recoveryFile |
protected java.io.File |
scratchFile |
protected static java.lang.String |
UNICODE_TRANSFORMATION_FORMAT |
DEFAULT_POLLING_INTERVAL, DELETE_LOCAL_FILES, deleteLocalFiles, fileLevelTransaction, fileSeqCheck, fsChecked, ioLock, isOrdered, itsFileSuffix, localDir, logger, mtChecked, MULTI_THREADED, ORDER_REQUIRED, POLLING_INTERVAL, scratchDir, useSynchronizedDirectory
dataReceiver, fdChecked, filedataReceiver, fileduplicateCheck, fileToProcess, inputCount, lockFile, movedFile, node, pollingInterval, processing, processingData, running
Constructor and Description |
---|
GenericFlatFileProcessor(DCNode node,
java.io.File localdir,
java.lang.String suffix,
SMGLock lock)
Use this constructor when the accounting files
are pushed to a local directory by an outside source.
|
GenericFlatFileProcessor(DCNode node,
SynchronizedDirectory sd,
java.lang.String suffix,
SMGLock lock)
Use this constructor when using FTP to retrieve the accounting files
that need to be processed.
|
Modifier and Type | Method and Description |
---|---|
protected void |
getHeader(java.lang.String text)
Parses a line of text (the file header) for the field names.
|
protected void |
initLineTerminators()
This method is used to initialize the line delimiters, which
consist of combinations of CR, LF and CRLF.
|
protected void |
processFiles(java.util.Vector filesToProcess)
Here's where we actually parse the files and extract the data of interest.
|
protected void |
processFilesOrdered(java.io.File currFile) |
protected boolean |
processScratchFile()
Processes scratch files in case of a abnormal shutdown.
|
protected abstract void |
processTheRecord(java.lang.String rawRecord)
This call process the record.
|
protected void |
setRecordType(DCEIRecord rec)
This call is used to set the specific object type used to process the individual records
that have been read in from a flat file.
|
protected void |
skipAhead()
This skips ahead in the last file being processed before
termination.
|
protected void |
skipHeader()
This code should be overridden by nodes
which are processing data which does not have a header record.
|
deleteLocalFiles, getActFilter, getBulkData, getData, getInputBackupDir, getLength, isDataAvailable, isHealthy, isLessThan, moveCurrentFileToBackUp, readLength, run, setActFilter, setDubCheckObj, setDupCheckFlag, setSeqCheckFlag, setSeqCheckObj, shutdown, sortFiles, writeLength, writeLength
getCurrArchFile, getData, getDataReceiver, getDubCheckObj, getDupCheckFlag, getFileBulkData, getFileData, getFileDataReceiver, getFileList, getMovedFileStatus, getNode, getPollingInterval, getProcessedArchFile, handleRejectOfFile, incrementIn, incrementIn, isEndOfFile, isFileDataAvailable, isProcessing, isProcessingData, isStartOfFile, openInputFile, rejectFile, removeProcessedFile, setCountsSuspect, setDataReceiver, setFileDataReceiver, setFileToProcess, setMovedFileStatus, setNode, setPollingInterval, setProcessedArchFile, setProcessing, signalBatchCompletion, validOIMinorType
protected boolean debug
public static final java.lang.String PROCESSED_FILE_PREFIX
public static final java.lang.String PROCESSED_FILE_SUFFIX
protected static final java.lang.String INPUT_BACKUP_DIR
protected DCEIRecord record
protected boolean m_bCRTerminatorEnabled
protected boolean m_bLFTerminatorEnabled
protected boolean m_bCRLFTerminatorEnabled
protected java.io.File actfile
protected java.io.FileInputStream inputStream
protected PosLineReader br
protected java.lang.String lineOfText
protected java.lang.String fileName
protected java.lang.String rawHeader
protected long numBytes
protected java.io.File scratchFile
protected java.io.RandomAccessFile recoveryFile
protected static final java.lang.String FILENAME_NAR_ID
protected static final java.lang.String UNICODE_TRANSFORMATION_FORMAT
public GenericFlatFileProcessor(DCNode node, java.io.File localdir, java.lang.String suffix, SMGLock lock) throws NodeStartException
node
- The EI node which is using this class.localdir
- The local directory where the target files can be foundsuffix
- The file suffix used to identify the files that need to be processed (can be null if you want to process all files in the directory)NodeStartException
- Used to signal the EI Node that there was a problem getting things goingpublic GenericFlatFileProcessor(DCNode node, SynchronizedDirectory sd, java.lang.String suffix, SMGLock lock) throws NodeStartException
node
- The EI node which is using this class.sd
- The representation of the local directory where the target files can be foundsuffix
- The file suffix used to identify the files that need to be processed
(can be null if you want to process all files in the directory)lock
- NodeStartException
- Used to signal the EI Node that there was a problem getting things goingprotected void processFiles(java.util.Vector filesToProcess)
processFiles
in class FileEITransport
filesToProcess
- list of filenames that need to be processedprotected void processFilesOrdered(java.io.File currFile)
protected abstract void processTheRecord(java.lang.String rawRecord)
String
- rawRecord The raw unprocessed data record.protected void setRecordType(DCEIRecord rec)
protected boolean processScratchFile()
protected void skipAhead()
protected void skipHeader()
protected void getHeader(java.lang.String text)
protected void initLineTerminators()