Package com.nt.udc.ndk.node
Class KnownFieldLengthFileProcessor
java.lang.Object
com.nt.udc.ndk.node.EITransport
com.nt.udc.ei.transport.FileEITransport
com.nt.udc.ndk.node.GenericFlatFileProcessor
com.nt.udc.ndk.node.KnownFieldLengthFileProcessor
- All Implemented Interfaces:
DataProviderIfc
,DCTransport
,FileDataProviderIfc
,Runnable
This node should be extend if a knew node is required for processing
flat files with fields that have a known length and no delimiter.
- Since:
- JDK1.3.1
-
Field Summary
Fields inherited from class com.nt.udc.ndk.node.GenericFlatFileProcessor
actfile, br, debug, fileName, FILENAME_NAR_ID, INPUT_BACKUP_DIR, inputStream, lineOfText, m_bCRLFTerminatorEnabled, m_bCRTerminatorEnabled, m_bLFTerminatorEnabled, numBytes, PROCESSED_FILE_PREFIX, PROCESSED_FILE_SUFFIX, rawHeader, recoveryFile, scratchFile, UNICODE_TRANSFORMATION_FORMAT
Fields inherited from class com.nt.udc.ei.transport.FileEITransport
DEFAULT_POLLING_INTERVAL, DELETE_LOCAL_FILES, deleteLocalFiles, fileLevelTransaction, fileSeqCheck, fsChecked, ioLock, isOrdered, itsFileSuffix, localDir, logger, mtChecked, MULTI_THREADED, ORDER_REQUIRED, POLLING_INTERVAL, scratchDir, useSynchronizedDirectory
Fields inherited from class com.nt.udc.ndk.node.EITransport
dataReceiver, fdChecked, filedataReceiver, fileduplicateCheck, fileToProcess, inputCount, lockFile, movedFile, node, pollingInterval, processing, processingData, running
-
Constructor Summary
ConstructorsConstructorDescriptionKnownFieldLengthFileProcessor
(EINode node, SynchronizedDirectory sd, String suffix, com.nt.common.util.SMGLock lock) Constructor used when using FTP to retrieve the files that need to be processed.KnownFieldLengthFileProcessor
(EINode node, File localdir, String suffix, com.nt.common.util.SMGLock lock) Constructor used when the files are pushed to a local directory by an outside source. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
processTheRecord
(String rawRecord) This processes the raw undelimited record based on the known field length specified in the configuration file.protected void
This sets up the record type which in turn controls how each of the flat file records are processed.Methods inherited from class com.nt.udc.ndk.node.GenericFlatFileProcessor
getHeader, initLineTerminators, processFiles, processFilesOrdered, processScratchFile, setRecordType, skipAhead, skipHeader
Methods inherited from class com.nt.udc.ei.transport.FileEITransport
deleteLocalFiles, getActFilter, getBulkData, getData, getInputBackupDir, getLength, isDataAvailable, isHealthy, isLessThan, moveCurrentFileToBackUp, readLength, run, setActFilter, setDubCheckObj, setDupCheckFlag, setSeqCheckFlag, setSeqCheckObj, shutdown, sortFiles, writeLength, writeLength
Methods inherited from class com.nt.udc.ndk.node.EITransport
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
-
Constructor Details
-
KnownFieldLengthFileProcessor
public KnownFieldLengthFileProcessor(EINode node, File localdir, String suffix, com.nt.common.util.SMGLock lock) throws NodeStartException Constructor used when the files are pushed to a local directory by an outside source.- Parameters:
node
- The EI node which is using this object.localdir
- The local directory where the input files can be found.suffix
- The file suffix used to identify the files to be processed (null
indicates all files in directory are to be processed).lock
- Used to properly shutdown the EI and all its threads.- Throws:
NodeStartException
- Used to signal the EI Node that there was a problem starting the transport.
-
KnownFieldLengthFileProcessor
public KnownFieldLengthFileProcessor(EINode node, SynchronizedDirectory sd, String suffix, com.nt.common.util.SMGLock lock) throws NodeStartException Constructor used when using FTP to retrieve the files that need to be processed.- Parameters:
node
- The EI node which is using this object.sd
- The representation of the local directory where the input files can be found.suffix
- The file suffix used to identify the files to be processed (null
indicates all files in directory are to be processed).lock
- Used to properly shutdown the EI and all its threads.- Throws:
NodeStartException
- Used to signal the EI Node that there was a problem starting the transport.
-
-
Method Details
-
setRecordType
protected void setRecordType()This sets up the record type which in turn controls how each of the flat file records are processed. In the case of the KnownFieldLengthFileProcessor, records are parsed based on an externally defined field width that is configured using a specification file. The file is processed using the KnownFiledLengthConfig class. -
processTheRecord
This processes the raw undelimited record based on the known field length specified in the configuration file.- Specified by:
processTheRecord
in classGenericFlatFileProcessor
-