public abstract class HistoryStorage extends SynchronizationListener
SynchronizationListener.HealthStatus| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
dealSynchronizationFinished |
protected Set<String> |
orderSynchronizationFinished |
| Constructor and Description |
|---|
HistoryStorage() |
| Modifier and Type | Method and Description |
|---|---|
abstract CompletableFuture<Void> |
clear()
Clears the storage and deletes persistent data
|
abstract List<MetatraderDeal> |
getDeals()
Returns all deals stored in history storage
|
abstract List<MetatraderOrder> |
getHistoryOrders()
Returns all history orders stored in history storage
|
CompletableFuture<IsoTime> |
getLastDealTime()
Returns the time of the last history deal record stored in the history storage
|
abstract CompletableFuture<IsoTime> |
getLastDealTime(Integer instanceIndex)
Returns the time of the last history deal record stored in the history storage
|
abstract Map<String,Long> |
getLastDealTimeByInstanceIndex()
Returns times of last deals by instance indices
|
CompletableFuture<IsoTime> |
getLastHistoryOrderTime()
Returns the time of the last history order record stored in the history storage
|
abstract CompletableFuture<IsoTime> |
getLastHistoryOrderTime(Integer instanceIndex)
Returns the time of the last history order record stored in the history storage
|
abstract Map<String,Long> |
getLastHistoryOrderTimeByInstanceIndex()
Returns times of last history orders by instance indices
|
abstract CompletableFuture<Void> |
initialize()
Initializes the storage and loads required data from a persistent storage
|
boolean |
isDealSynchronizationFinished()
Returns flag indicating whether deal history synchronization have finished
|
boolean |
isOrderSynchronizationFinished()
Returns flag indicating whether order history synchronization have finished
|
abstract CompletableFuture<Void> |
loadData()
Loads history data from the file manager
|
CompletableFuture<Void> |
onConnected(String instanceIndex,
int replicas)
Invoked when connection to MetaTrader terminal established
|
abstract CompletableFuture<Void> |
onDealAdded(String instanceIndex,
MetatraderDeal deal)
Invoked when a new MetaTrader history deal is added
|
CompletableFuture<Void> |
onDealSynchronizationFinished(String instanceIndex,
String synchronizationId)
Invoked when a synchronization of history deals on a MetaTrader account have finished
|
abstract CompletableFuture<Void> |
onHistoryOrderAdded(String instanceIndex,
MetatraderOrder historyOrder)
Invoked when a new MetaTrader history order is added
|
CompletableFuture<Void> |
onOrderSynchronizationFinished(String instanceIndex,
String synchronizationId)
Invoked when a synchronization of history orders on a MetaTrader account have finished
|
abstract CompletableFuture<Void> |
updateStorage()
Saves unsaved history items to storage
|
getHostName, getInstanceNumber, onAccountInformationUpdated, onBooksUpdated, onBrokerConnectionStatusChanged, onCandlesUpdated, onDisconnected, onHealthStatus, onOrderCompleted, onOrdersReplaced, onOrderUpdated, onPositionRemoved, onPositionsReplaced, onPositionUpdated, onStreamClosed, onSubscriptionDowngraded, onSymbolPricesUpdated, onSymbolPriceUpdated, onSymbolSpecificationRemoved, onSymbolSpecificationsUpdated, onSymbolSpecificationUpdated, onSynchronizationStarted, onTicksUpdatedpublic abstract CompletableFuture<Void> initialize()
public abstract List<MetatraderDeal> getDeals()
public abstract List<MetatraderOrder> getHistoryOrders()
public abstract Map<String,Long> getLastDealTimeByInstanceIndex()
public abstract Map<String,Long> getLastHistoryOrderTimeByInstanceIndex()
public abstract CompletableFuture<Void> loadData()
public abstract CompletableFuture<Void> updateStorage()
public boolean isOrderSynchronizationFinished()
public boolean isDealSynchronizationFinished()
public abstract CompletableFuture<Void> clear()
public CompletableFuture<IsoTime> getLastHistoryOrderTime()
public abstract CompletableFuture<IsoTime> getLastHistoryOrderTime(Integer instanceIndex)
instanceIndex - index of an account instance connected, or nullpublic CompletableFuture<IsoTime> getLastDealTime()
public abstract CompletableFuture<IsoTime> getLastDealTime(Integer instanceIndex)
instanceIndex - index of an account instance connected, or nullpublic abstract CompletableFuture<Void> onHistoryOrderAdded(String instanceIndex, MetatraderOrder historyOrder)
SynchronizationListeneronHistoryOrderAdded in class SynchronizationListenerinstanceIndex - index of an account instance connectedhistoryOrder - new MetaTrader history orderpublic abstract CompletableFuture<Void> onDealAdded(String instanceIndex, MetatraderDeal deal)
SynchronizationListeneronDealAdded in class SynchronizationListenerinstanceIndex - index of an account instance connecteddeal - new MetaTrader history dealpublic CompletableFuture<Void> onDealSynchronizationFinished(String instanceIndex, String synchronizationId)
SynchronizationListeneronDealSynchronizationFinished in class SynchronizationListenerinstanceIndex - index of an account instance connectedsynchronizationId - synchronization request idpublic CompletableFuture<Void> onOrderSynchronizationFinished(String instanceIndex, String synchronizationId)
SynchronizationListeneronOrderSynchronizationFinished in class SynchronizationListenerinstanceIndex - index of an account instance connectedsynchronizationId - synchronization request idpublic CompletableFuture<Void> onConnected(String instanceIndex, int replicas)
SynchronizationListeneronConnected in class SynchronizationListenerinstanceIndex - index of an account instance connectedreplicas - number of account replicas launchedCopyright © 2022. All rights reserved.