org.marketcetera.client.utils
Class LiveOrderHistoryManager

java.lang.Object
  extended by org.marketcetera.trade.utils.OrderHistoryManager
      extended by org.marketcetera.client.utils.LiveOrderHistoryManager
All Implemented Interfaces:
Lifecycle
Direct Known Subclasses:
AutoOrderHistoryManager

public class LiveOrderHistoryManager
extends OrderHistoryManager
implements Lifecycle

Provides a historically-aware OrderHistoryManager implementation.

Instantiate this class with an origin date. The origin date establishes how far back to look for order history.

Note that there are significant performance and resource implications when using this class. Depending on historical order volume, this class may be required to process thousands or millions of reports. There are two ramifications of this:

It may take a significant amount of time to start this object as it must process historical order history. Callers may choose to make this operation asynchronous. The object will report that it is running when the processing is complete.

Since:
2.1.4
Version:
$Id: LiveOrderHistoryManager.java 16154 2012-07-14 16:34:05Z colin $
Author:
Colin DuPlantis

Constructor Summary
LiveOrderHistoryManager(Date inReportHistoryOrigin)
          Create a new LiveOrderHistoryManager instance.
 
Method Summary
protected  Client getClient()
          Get the client value.
 Map<OrderID,ExecutionReport> getOpenOrders()
          Gets the open orders.
 Date getReportHistoryOrigin()
          Gets the report history origin date used by this order history manager.
 boolean isRunning()
           
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class org.marketcetera.trade.utils.OrderHistoryManager
add, clear, clear, display, getLatestReportFor, getOrderChain, getOrderIds, getReportHistoryFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiveOrderHistoryManager

public LiveOrderHistoryManager(Date inReportHistoryOrigin)
                        throws ClientInitException
Create a new LiveOrderHistoryManager instance.

Parameters:
inReportHistoryOrigin - a Date value indicating the point from which to gather order history or null
Throws:
ClientInitException - if a connection to the Client cannot be made
Method Detail

getOpenOrders

public Map<OrderID,ExecutionReport> getOpenOrders()
Gets the open orders.

The collection returned by this operation will reflect changes to the underlying order history.

The LiveOrderHistoryManager object must be started before this operation may be successfully invoked.

Overrides:
getOpenOrders in class OrderHistoryManager
Returns:
a Map<OrderID,ExecutionReport> value
Throws:
IllegalStateException - if the object has not started

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Lifecycle

start

public void start()
Specified by:
start in interface Lifecycle

stop

public void stop()
Specified by:
stop in interface Lifecycle

getReportHistoryOrigin

public Date getReportHistoryOrigin()
Gets the report history origin date used by this order history manager.

Returns:
a Date value

toString

public String toString()
Overrides:
toString in class OrderHistoryManager

getClient

protected Client getClient()
Get the client value.

Returns:
a Client value


Copyright © 2012. All Rights Reserved.