MFHandler (3.14.0 600 API)
Date: 2025-11-24

com.marketfactory.api

## Interface MFHandler

- All Known Implementing Classes:
    AbstractMFHandler, BookViewer.MarketDataHandlerImpl, MarketDataSample1.MarketDataHandlerImpl, MarketDataSample2.MarketDataHandlerImpl, SubTool

      public interface MFHandler

  An interface for callbacks of a market-data client.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onBatchComplete(int batchDefID, MFClient client)` Batch Complete Event: Called on completed batches.
    `void` | `onConnect(MFClient client)` Called right after a reconnection attempt succeeds.
    `void` | `onDateRollover(DateRollover dateRollover, MFClient client)` Date Rollover Event: Called on new date rollover upate.
    `void` | `onDisconnect(MFClient client)` Called when connection is broken unexpectedly; this signals that the dispatcher is about to attempt to reconnect and if necessary fail over to the secondary server, if one has been provided.
    `void` | `onDropCopy(DropCopy dropCopy, MFClient client)` Trading Event: Callback that gets invoked on DropCopy events
    `void` | `onEventReport(EventReport eventReport, MFClient client)` Report Event: Called on new event report.
    `void` | `onHeartbeat(Heartbeat heartbeat, MFClient client)` Called with fast heartbeats containing feed status information.
    `void` | `onMarketData(MarketView marketData, MFClient client)` Market Data Event: Called on new market-data updates.
    `void` | `onOrderCanceled(OrderCanceled orderCanceled, MFClient client)` Trading Event: Callback that gets invoked when an Order is successfully canceled.
    `void` | `onOrderCancelRejected(OrderCancelRejected orderCancelRejected, MFClient client)` Trading Event: Callback that gets invoked when an Order cancel is rejected.
    `void` | `onOrderDone(OrderDone orderDone, MFClient client)` Trading Event: Callback that gets invoked when an Order is finished
    `void` | `onOrderReceived(OrderReceived orderReceived, MFClient client)` Trading Event: Callback that gets invoked when an Order is received by the server.
    `void` | `onOrderRejected(OrderRejected orderRejected, MFClient client)` Trading Event: Callback that gets invoked when an Order is rejected.
    `void` | `onOrderSubmitted(OrderSubmitted orderSubmitted, MFClient client)` Trading Event: Callback that gets invoked when an Order is successfully submitted.
    `void` | `onReplayDone(ReplayDone replayDone, MFClient client)` Replay Event: Callback that gets invoked after replay request has been fully processed.
    `void` | `onStart(MFClient client)` Called right after we start dispatching events, once per call to client.run().
    `void` | `onStop(MFClient client)` Called right before we stop dispatching events and return from client.run().
    `void` | `onSubscriptionEvent(SubscriptionEvent subscriptionEvent, MFClient client)` Subscription Event: Called when the status of the subscription changes.
    `void` | `onTradeCapture(TradeCapture tradeCapture, MFClient client)` Trading Event: Callback that gets invoked on TradeCapture events

- - ### Method Detail

    - #### onStart

          void onStart(MFClient client)

      Called right after we start dispatching events, once per call to client.run().
      Parameters:
        `client` - -- the target client

    - #### onStop

          void onStop(MFClient client)

      Called right before we stop dispatching events and return from client.run().
      Parameters:
        `client` - -- the target client

    - #### onDisconnect

          void onDisconnect(MFClient client)

      Called when connection is broken unexpectedly; this signals that the dispatcher is about to attempt to reconnect and if necessary fail over to the secondary server, if one has been provided.
      Parameters:
        `client` - -- the target client

    - #### onConnect

          void onConnect(MFClient client)

      Called right after a reconnection attempt succeeds. If reconnection failed, the run() dispatcher will return with an error code. (Note: this is only used for failover. During connect()/close() there is no active dispatcher, so there is no handler, so no corresponding callback either.)
      Parameters:
        `client` - -- the target client

    - #### onHeartbeat

          void onHeartbeat(Heartbeat heartbeat,
                           MFClient client)

      Called with fast heartbeats containing feed status information.
      Parameters:
        `heartbeat` - -- the event parameter
        `client` - -- the target client

    - #### onSubscriptionEvent

          void onSubscriptionEvent(SubscriptionEvent subscriptionEvent,
                                   MFClient client)

      Subscription Event: Called when the status of the subscription changes.
      Parameters:
        `subscriptionEvent` - -- the event parameter
        `client` - -- the target client

    - #### onMarketData

          void onMarketData(MarketView marketData,
                            MFClient client)

      Market Data Event: Called on new market-data updates.
      Parameters:
        `marketData` - -- the event parameter
        `client` - -- the target client

    - #### onEventReport

          void onEventReport(EventReport eventReport,
                             MFClient client)

      Report Event: Called on new event report.
      Parameters:
        `eventReport` - -- the event parameter
        `client` - -- the target client

    - #### onDateRollover

          void onDateRollover(DateRollover dateRollover,
                              MFClient client)

      Date Rollover Event: Called on new date rollover upate.
      Parameters:
        `dateRollover` - -- the event parameter
        `client` - -- the target client

    - #### onBatchComplete

          void onBatchComplete(int batchDefID,
                               MFClient client)

      Batch Complete Event: Called on completed batches.
      Parameters:
        `batchDefID` - -- the batch that is complete
        `client` - -- the target client

    - #### onOrderReceived

          void onOrderReceived(OrderReceived orderReceived,
                               MFClient client)

      Trading Event: Callback that gets invoked when an Order is received by the server.
      Parameters:
        `orderReceived` - -- the results
        `client` - -- the target client

    - #### onOrderRejected

          void onOrderRejected(OrderRejected orderRejected,
                               MFClient client)

      Trading Event: Callback that gets invoked when an Order is rejected.
      Parameters:
        `orderRejected` - -- the results
        `client` - -- the target client

    - #### onOrderSubmitted

          void onOrderSubmitted(OrderSubmitted orderSubmitted,
                                MFClient client)

      Trading Event: Callback that gets invoked when an Order is successfully submitted.
      Parameters:
        `orderSubmitted` - -- the results
        `client` - -- the target client

    - #### onOrderCanceled

          void onOrderCanceled(OrderCanceled orderCanceled,
                               MFClient client)

      Trading Event: Callback that gets invoked when an Order is successfully canceled.
      Parameters:
        `orderCanceled` - -- the results
        `client` - -- the target client

    - #### onOrderCancelRejected

          void onOrderCancelRejected(OrderCancelRejected orderCancelRejected,
                                     MFClient client)

      Trading Event: Callback that gets invoked when an Order cancel is rejected.
      Parameters:
        `orderCancelRejected` - -- the results
        `client` - -- the target client

    - #### onDropCopy

          void onDropCopy(DropCopy dropCopy,
                          MFClient client)

      Trading Event: Callback that gets invoked on DropCopy events
      Parameters:
        `dropCopy` - -- the results
        `client` - -- the target client

    - #### onTradeCapture

          void onTradeCapture(TradeCapture tradeCapture,
                              MFClient client)

      Trading Event: Callback that gets invoked on TradeCapture events
      Parameters:
        `tradeCapture` - -- the results
        `client` - -- the target client

    - #### onOrderDone

          void onOrderDone(OrderDone orderDone,
                           MFClient client)

      Trading Event: Callback that gets invoked when an Order is finished
      Parameters:
        `orderDone` - -- the results
        `client` - -- the target client

    - #### onReplayDone

          void onReplayDone(ReplayDone replayDone,
                            MFClient client)

      Replay Event: Callback that gets invoked after replay request has been fully processed.
      Parameters:
        `replayDone` - -- the results
        `client` - -- the target client