Venice 0.751beta

nz.org.venice.quote
Class IDQuoteSync

java.lang.Object
  extended bynz.org.venice.quote.IDQuoteSync

public class IDQuoteSync
extends java.lang.Object

This class controls the periodic downloading, or synchronisation, of new intra-day quotes. This class will only sync quotes if all the following conditions are met:

Author:
Andrew Leppard

Field Summary
static int DEFAULT_PERIOD
          The default time period inbetween quote downloads.
static TradingTime DEFAULT_START_TIME
          The default start time.
static TradingTime DEFAULT_STOP_TIME
          The default stop time.
 
Method Summary
 void addSymbols(java.util.List symbols)
          Add the a list of symbols to the list of symbols for the intra-day quotes to download.
static IDQuoteSync getInstance()
          Create or return the singleton instance of the intra-day quote synchronisation object.
 java.util.List getSymbols(java.util.List symbols)
          Return the list of symbols of the intra-day quotes to download.
 boolean isEnabled()
          Return whether the automatic downloading of intra-day quotes is enabled.
 boolean isRunning()
          Return whether the automatic downloading of intra-day quotes is running.
 void setEnabled(boolean isEnabled)
          Set whether the automatic downloading of intra-day quotes is enabled.
 void setPeriod(int period)
          Set the time period inbetween quote downloads
 void setSuffix(java.lang.String suffix)
          Set optional suffix to append to symbols, e.g. ".AX".
 void setTimeRange(TradingTime startTime, TradingTime stopTime)
          Set the time range to sync quotes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PERIOD

public static final int DEFAULT_PERIOD
The default time period inbetween quote downloads.

See Also:
Constant Field Values

DEFAULT_START_TIME

public static final TradingTime DEFAULT_START_TIME
The default start time.


DEFAULT_STOP_TIME

public static final TradingTime DEFAULT_STOP_TIME
The default stop time.

Method Detail

getInstance

public static IDQuoteSync getInstance()
Create or return the singleton instance of the intra-day quote synchronisation object.

Returns:
singleton instance of this class

setEnabled

public void setEnabled(boolean isEnabled)
Set whether the automatic downloading of intra-day quotes is enabled.

Parameters:
isEnabled - enabled status

isEnabled

public boolean isEnabled()
Return whether the automatic downloading of intra-day quotes is enabled.

Returns:
true if enabled.

isRunning

public boolean isRunning()
Return whether the automatic downloading of intra-day quotes is running. This function does not return whether we are currently in the processing of downloading new quotes. Instead it returns whether the timer is currently active and we are periodically downloading new intra-day quotes.

Returns:
true if running.

getSymbols

public java.util.List getSymbols(java.util.List symbols)
Return the list of symbols of the intra-day quotes to download.

Returns:
symbols list

addSymbols

public void addSymbols(java.util.List symbols)
Add the a list of symbols to the list of symbols for the intra-day quotes to download.

Parameters:
symbols - new symbols to download

setSuffix

public void setSuffix(java.lang.String suffix)
Set optional suffix to append to symbols, e.g. ".AX".

Parameters:
suffix - optional suffix

setPeriod

public void setPeriod(int period)
Set the time period inbetween quote downloads

Parameters:
period - the period in seconds.

setTimeRange

public void setTimeRange(TradingTime startTime,
                         TradingTime stopTime)
Set the time range to sync quotes.

Parameters:
startTime - start quote sync
stopTime - stop quote sync

Venice 0.751beta