|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCollectJob
StockJob
public abstract class StockJob
Basic stock collection job, implementing basic configuration handling and collection routines.
Field Summary | |
---|---|
private static org.slf4j.Logger |
_log
|
protected ArrayList<Object> |
comp
|
private static String |
cur_date
|
protected String |
date_now
|
protected Database |
dbs
|
protected String |
file_ext
|
protected String |
file_path
|
protected String |
job_key
|
protected Integer |
max_jobs
|
protected Integer |
num_files
|
protected Integer |
num_jobs
|
private static int |
num_out
|
private static int |
num_parts
|
protected String |
stock_name
|
protected String |
stock_txt_date
|
protected String |
stock_txt_time
|
protected String |
stock_url
|
protected String |
stock_url_base
|
protected String |
stock_url_parm
|
protected String |
stock_xml_attr
|
protected ArrayList<Object> |
stock_xml_elms
|
protected String |
stock_xml_root
|
protected Integer |
zip_buffer
|
protected Integer |
zip_files
|
private static boolean |
zipping
|
Fields inherited from class CollectJob |
---|
date, form_date, form_hday, form_time, hday, hour_stop, hour_strt, mnte_stop, mnte_strt, scnd_stop, scnd_strt, time, time_zone |
Constructor Summary | |
---|---|
StockJob()
Constructor. |
Method Summary | |
---|---|
protected void |
collect()
Collects data from a specific source. |
protected boolean |
configureLocal(String job_key)
Configures the StockJob component by parsing a configuration file for local component
elements. |
protected abstract org.slf4j.Logger |
getLogger()
Retrieves the Logger of the component. |
protected boolean |
loadLocal(org.quartz.JobExecutionContext context)
Configures the StockJob component by loading configurations for local component
elements stored in a JobDataMap , which is available during runtime of the
component. |
protected abstract void |
parseFeed()
Parses feed containing stock data. |
private void |
saveToFile()
Saves an individual StockJob component's database to a CSV formatted file whenever
there is a date swap or the maximum number of jobs allowed to be stored in memory (specified
in the configuration file) is exceeded. |
protected void |
storeLocal(org.quartz.JobExecutionContext context)
Stores the configuration for local component elements of the StockJob component in a
JobDataMap , which is available during runtime of the component. |
private void |
zipFiles()
Zips output files whenever there is a date swap or the maximum number of files allowed in a single zip file (specified in the configuration file) is exceeded. |
Methods inherited from class CollectJob |
---|
execute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ArrayList<Object> comp
protected ArrayList<Object> stock_xml_elms
protected Database dbs
protected Integer max_jobs
protected Integer num_files
protected Integer num_jobs
protected Integer zip_buffer
protected Integer zip_files
protected String date_now
protected String file_path
protected String file_ext
protected String job_key
protected String stock_name
protected String stock_txt_date
protected String stock_txt_time
protected String stock_url
protected String stock_url_base
protected String stock_url_parm
protected String stock_xml_attr
protected String stock_xml_root
private static boolean zipping
private static int num_parts
private static int num_out
private static String cur_date
private static org.slf4j.Logger _log
Constructor Detail |
---|
public StockJob()
Method Detail |
---|
protected boolean configureLocal(String job_key)
StockJob
component by parsing a configuration file for local component
elements.
configureLocal
in class CollectJob
job_key
- ID of the component.
Boolean
value indicating whether parsed configuration is valid.protected boolean loadLocal(org.quartz.JobExecutionContext context)
StockJob
component by loading configurations for local component
elements stored in a JobDataMap
, which is available during runtime of the
component.
loadLocal
in class CollectJob
context
- Execution context of the component.
Boolean
value indicating whether loaded configuration is valid.protected void storeLocal(org.quartz.JobExecutionContext context)
StockJob
component in a
JobDataMap
, which is available during runtime of the component.
storeLocal
in class CollectJob
context
- Execution context of the component.protected void collect()
collect
in class CollectJob
private void saveToFile()
StockJob
component's database to a CSV formatted file whenever
there is a date swap or the maximum number of jobs allowed to be stored in memory (specified
in the configuration file) is exceeded. File path and extension of the file to be saved are
specified in the configuration file. File name is constructed as date_now
stock_name
num_files
, where date_now
represents the current date
(which can be yesterday's date in case of a date swap), stock_name
represents the
name of a feed, and where num_files
represents the number number of files that have
been created by the individual StockJob
component.
private void zipFiles()
cur_date
-
num_parts
, where cur_date
represents the current date (which can be
yesterday's date in case of a date swap) and where num_parts
represents the number
number of zip files that have been created by all StockJob
components.
protected abstract org.slf4j.Logger getLogger()
Logger
of the component.
getLogger
in class CollectJob
Logger
used for logging system output.protected abstract void parseFeed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |