Class AsciiFileHandler
java.lang.Object
com.metasolv.nm.collector.file.handler.AsciiFileHandler
- All Implemented Interfaces:
FileHandlerIfc
The AsciiFileHandler class provides an XML-driven ASCII processor that
can be used to support the collection of records from a variety of
different ASCII file types.
It has three main components:
- a definition component that encapsulates the information that is required
in order to parse a particular ASCII file type
- a record provider component that is responsible for parsing an ASCII file,
and returning individual string-based records
- a record processor component that is responsible for converting the string-based
record into a NAR-based record
It will then pass the converted NAR-based records to the NPL field processor for
further processing.
This class is also responsible for monitoring the progress as a data file is
processed so that it can resume processing in the correct location if the node
is restarted.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AsciiFileDefstatic final Stringstatic final Stringprotected booleanprotected static final Stringprotected intstatic final Stringprotected LoggerIfcprotected DCNodeprotected static final Stringprotected static final Stringprotected static final Stringprotected NPLFieldProcessorprotected RecordProcessorIfcprotected RecordProviderIfcprotected static final Stringprotected booleanprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RecordProcessorIfcprotected RecordProviderIfcbooleanbooleanprocessFile(File file) voidvoidshutdown()
-
Field Details
-
CFG_FIELD_DELIMITER
- See Also:
-
CFG_RECORD_DELIMITER
- See Also:
-
NPL_FIELD_DELIMITER
- See Also:
-
NPL_RECORD_DELIMITER
- See Also:
-
NPL_ASCII_DEF_FILE
- See Also:
-
INPUT_BACKUP_DIR
- See Also:
-
RECOVERY_FILE_SUFFIX
- See Also:
-
FILENAME_NAR_ID
- See Also:
-
UNICODE_TRANSFORMATION_FORMAT
- See Also:
-
logger
-
node
-
nplProcessor
-
asciiFileDef
-
recordProvider
-
recordProcessor
-
running
protected boolean running -
errorFlag
protected boolean errorFlag -
filesProcessed
protected int filesProcessed
-
-
Constructor Details
-
AsciiFileHandler
- Throws:
Exception
-
-
Method Details
-
getRecordProvider
-
getRecordProcessor
-
processFile
- Specified by:
processFilein interfaceFileHandlerIfc- Throws:
Exception
-
getInputBackupDir
-
setErrorFlag
public void setErrorFlag()- Specified by:
setErrorFlagin interfaceFileHandlerIfc
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceFileHandlerIfc
-
isRejected
public boolean isRejected()
-