public class MemoryHistoryStorage extends HistoryStorage
SynchronizationListener.HealthStatusdealSynchronizationFinished, orderSynchronizationFinished| Constructor and Description |
|---|
MemoryHistoryStorage(String accountId)
Constructs the in-memory history store instance with default parameters
|
MemoryHistoryStorage(String accountId,
String application)
Constructs the in-memory history store instance
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
clear()
Clears the storage and deletes persistent data
|
List<MetatraderDeal> |
getDeals()
Returns all deals stored in history storage
|
List<MetatraderOrder> |
getHistoryOrders()
Returns all history orders stored in history storage
|
CompletableFuture<IsoTime> |
getLastDealTime(Integer instanceNumber)
Returns the time of the last history deal record stored in the history storage
|
Map<String,Long> |
getLastDealTimeByInstanceIndex()
Returns times of last deals by instance indices
|
CompletableFuture<IsoTime> |
getLastHistoryOrderTime(Integer instanceNumber)
Returns the time of the last history order record stored in the history storage
|
Map<String,Long> |
getLastHistoryOrderTimeByInstanceIndex()
Returns times of last history orders by instance indices
|
CompletableFuture<Void> |
initialize()
Initializes the storage and loads required data from a persistent storage
|
CompletableFuture<Void> |
loadData()
Loads history data from the file manager
|
CompletableFuture<Void> |
loadDataFromDisk()
Loads history data from the file manager.
|
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
|
CompletableFuture<Void> |
onHistoryOrderAdded(String instanceIndex,
MetatraderOrder historyOrder)
Invoked when a new MetaTrader history order is added
|
CompletableFuture<Void> |
updateDiskStorage()
Saves unsaved history items to disk storage.
|
CompletableFuture<Void> |
updateStorage()
Saves unsaved history items to storage
|
getLastDealTime, getLastHistoryOrderTime, isDealSynchronizationFinished, isOrderSynchronizationFinished, onConnected, onOrderSynchronizationFinishedgetHostName, getInstanceNumber, onAccountInformationUpdated, onBooksUpdated, onBrokerConnectionStatusChanged, onCandlesUpdated, onDisconnected, onHealthStatus, onOrderCompleted, onOrdersReplaced, onOrderUpdated, onPositionRemoved, onPositionsReplaced, onPositionUpdated, onStreamClosed, onSubscriptionDowngraded, onSymbolPricesUpdated, onSymbolPriceUpdated, onSymbolSpecificationRemoved, onSymbolSpecificationsUpdated, onSymbolSpecificationUpdated, onSynchronizationStarted, onTicksUpdatedpublic MemoryHistoryStorage(String accountId)
accountId - account idpublic CompletableFuture<Void> initialize()
HistoryStorageinitialize in class HistoryStoragepublic List<MetatraderDeal> getDeals()
HistoryStoragegetDeals in class HistoryStoragepublic List<MetatraderOrder> getHistoryOrders()
HistoryStoragegetHistoryOrders in class HistoryStoragepublic Map<String,Long> getLastDealTimeByInstanceIndex()
HistoryStoragegetLastDealTimeByInstanceIndex in class HistoryStoragepublic Map<String,Long> getLastHistoryOrderTimeByInstanceIndex()
HistoryStoragegetLastHistoryOrderTimeByInstanceIndex in class HistoryStoragepublic CompletableFuture<Void> clear()
HistoryStorageclear in class HistoryStoragepublic CompletableFuture<Void> loadData()
HistoryStorageloadData in class HistoryStoragepublic CompletableFuture<Void> loadDataFromDisk()
loadData().public CompletableFuture<Void> updateStorage()
HistoryStorageupdateStorage in class HistoryStoragepublic CompletableFuture<Void> updateDiskStorage()
updateStorage().public CompletableFuture<IsoTime> getLastHistoryOrderTime(Integer instanceNumber)
HistoryStoragegetLastHistoryOrderTime in class HistoryStorageinstanceNumber - index of an account instance connected, or nullpublic CompletableFuture<IsoTime> getLastDealTime(Integer instanceNumber)
HistoryStoragegetLastDealTime in class HistoryStorageinstanceNumber - index of an account instance connected, or nullpublic CompletableFuture<Void> onHistoryOrderAdded(String instanceIndex, MetatraderOrder historyOrder)
SynchronizationListeneronHistoryOrderAdded in class HistoryStorageinstanceIndex - index of an account instance connectedhistoryOrder - new MetaTrader history orderpublic CompletableFuture<Void> onDealAdded(String instanceIndex, MetatraderDeal deal)
SynchronizationListeneronDealAdded in class HistoryStorageinstanceIndex - index of an account instance connecteddeal - new MetaTrader history dealpublic CompletableFuture<Void> onDealSynchronizationFinished(String instanceIndex, String synchronizationId)
SynchronizationListeneronDealSynchronizationFinished in class HistoryStorageinstanceIndex - index of an account instance connectedsynchronizationId - synchronization request idCopyright © 2022. All rights reserved.