public abstract class OIFileFormatter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
emptyFile
Indicates when a new output file has been created.
|
protected java.lang.String |
errMesg |
protected LoggerIfc |
logger
Object used to access the node's log file
|
protected OIFileWriter |
writer
Object which handles all file output operations
|
Constructor and Description |
---|
OIFileFormatter(LoggerIfc logr,
OIFileWriter oiFileWriter)
Construct a new
OIFileFormatter . |
Modifier and Type | Method and Description |
---|---|
void |
fileClosing(DCFieldContainer record)
This method is called from putToFile() and shutdown() just before a
file is closed.
|
void |
fileOpening(DCFieldContainer record)
This method is called from putToFile() after a new file is opened.
|
OIFileWriter |
getFileWriter()
Returns OIFileWriter Object
|
AbstractOIFtpPusher |
getFtpPusher()
Returns the AbstractOIFtpPusher object
|
boolean |
isHealthy()
This method is used to check if the formatter and its components
are fully functional.
|
void |
putToFile(DCFieldContainer record)
Accept a DCFieldContainer.
|
void |
readyToCycle(DCFieldContainer dcfc) |
void |
setFtpPusher(AbstractOIFtpPusher ftpPusher)
Configure the FileFormatter to use an OIFtpPusher object to
transfer the completed output files to a remote host.
|
void |
shutdown()
Stop the formatter.
|
abstract void |
writeToFile(DCFieldContainer dcf)
This method should contain any logic required to properly format the
output file (i.e.
|
protected java.lang.String errMesg
protected LoggerIfc logger
protected OIFileWriter writer
protected boolean emptyFile
public OIFileFormatter(LoggerIfc logr, OIFileWriter oiFileWriter)
OIFileFormatter
. The
OIFileWriter()
object will create the output files.logr
- LoggerIfc() object providing access to the
node's log fileoiFileWriter
- OIFileWriter() object responsible for file
output and managing the output files.public void setFtpPusher(AbstractOIFtpPusher ftpPusher)
public AbstractOIFtpPusher getFtpPusher()
public OIFileWriter getFileWriter()
public void putToFile(DCFieldContainer record) throws NodeProcessingException
NodeProcessingException
public void shutdown()
public void readyToCycle(DCFieldContainer dcfc) throws java.io.IOException
java.io.IOException
public void fileOpening(DCFieldContainer record) throws java.io.IOException
java.io.IOException
public void fileClosing(DCFieldContainer record) throws java.io.IOException
java.io.IOException
public abstract void writeToFile(DCFieldContainer dcf) throws java.io.IOException
java.io.IOException
public boolean isHealthy()