org.wdssii.ltgingest
Class AbstractAsciiLightningIngest

java.lang.Object
  extended by org.wdssii.core.WDSSIIProgram
      extended by org.wdssii.core.Ingestor
          extended by org.wdssii.ltgingest.AbstractAsciiLightningIngest
Direct Known Subclasses:
LightningWithDischargeTypeIngest, LightningWithFlashCountIngest

public abstract class AbstractAsciiLightningIngest
extends Ingestor

Base class of ingestors for ASCII lightning data

Author:
lakshman

Field Summary
private  String dateFormatInData
           
private  String dateFormatInFileName
           
private  int everyNseconds
           
private  String fieldSeparatorRegex
           
private  SimpleDateFormat fileContentTimeParser
           
private  SimpleDateFormat fileNameTimeParser
           
private static org.apache.commons.logging.Log log
           
private  String subtype
           
 
Constructor Summary
AbstractAsciiLightningIngest()
           
 
Method Summary
protected abstract  void addRow(DataTable table, Date ltgTime, String[] fields)
           
protected  void doIngest(File f)
          Read the file, do the conversion, write the output and notify the index.
 String getDateFormatInData()
           
 String getDateFormatInFileName()
           
 int getEveryNseconds()
           
 String getFieldSeparatorRegex()
           
 String getSubtype()
           
private  Date getTimeFromFileName(String fileName)
          Assumes that the time is the last part of the file name with the exception of an optional filename extension
private  DataTable newDataTable(Date time)
           
 void setDateFormatInData(String dateFormatInData)
           
 void setDateFormatInFileName(String dateFormatInFileName)
           
 void setEveryNseconds(int everyNseconds)
           
 void setFieldSeparatorRegex(String fieldSeparatorRegex)
           
 void setSubtype(String subtype)
           
 
Methods inherited from class org.wdssii.core.Ingestor
execute, getFilenamePatterns, getInputDir, isExitAfterInitialRead, setExitAfterInitialRead, setFilenamePatterns, setInputDir
 
Methods inherited from class org.wdssii.core.WDSSIIProgram
getOutputDir, getPropertiesFromCommandLine, getSubTypeForElevation, isRealTime, printUsage, setOutputDir, setRealTime, setup, setup, setupAndExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

fieldSeparatorRegex

private String fieldSeparatorRegex

everyNseconds

private int everyNseconds

subtype

private String subtype

dateFormatInFileName

private String dateFormatInFileName

dateFormatInData

private String dateFormatInData

fileNameTimeParser

private SimpleDateFormat fileNameTimeParser

fileContentTimeParser

private SimpleDateFormat fileContentTimeParser
Constructor Detail

AbstractAsciiLightningIngest

public AbstractAsciiLightningIngest()
Method Detail

getFieldSeparatorRegex

public String getFieldSeparatorRegex()

setFieldSeparatorRegex

public void setFieldSeparatorRegex(String fieldSeparatorRegex)

getEveryNseconds

public int getEveryNseconds()

setEveryNseconds

public void setEveryNseconds(int everyNseconds)

getSubtype

public String getSubtype()

setSubtype

public void setSubtype(String subtype)

getDateFormatInFileName

public String getDateFormatInFileName()

setDateFormatInFileName

public void setDateFormatInFileName(String dateFormatInFileName)

getDateFormatInData

public String getDateFormatInData()

setDateFormatInData

public void setDateFormatInData(String dateFormatInData)

doIngest

protected void doIngest(File f)
Description copied from class: Ingestor
Read the file, do the conversion, write the output and notify the index.

Specified by:
doIngest in class Ingestor

addRow

protected abstract void addRow(DataTable table,
                               Date ltgTime,
                               String[] fields)

newDataTable

private DataTable newDataTable(Date time)

getTimeFromFileName

private Date getTimeFromFileName(String fileName)
                          throws ParseException
Assumes that the time is the last part of the file name with the exception of an optional filename extension

Throws:
ParseException