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 AsciiFileDef
static final String
static final String
protected boolean
protected static final String
protected int
static final String
protected LoggerIfc
protected DCNode
protected static final String
protected static final String
protected static final String
protected NPLFieldProcessor
protected RecordProcessorIfc
protected RecordProviderIfc
protected static final String
protected boolean
protected static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RecordProcessorIfc
protected RecordProviderIfc
boolean
boolean
processFile
(File file) void
void
shutdown()
-
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:
processFile
in interfaceFileHandlerIfc
- Throws:
Exception
-
getInputBackupDir
-
setErrorFlag
public void setErrorFlag()- Specified by:
setErrorFlag
in interfaceFileHandlerIfc
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceFileHandlerIfc
-
isRejected
public boolean isRejected()
-