Class RejectEvent<T extends UserTrade>

java.lang.Object
com.caplin.motif.fx.trading.ResponderEvent<T>
com.caplin.motif.fx.trading.RejectEvent<T>
Type Parameters:
T - A class that extends UserTrade, which this RejectEvent relates to. For example, ESPTrade or BlockTrade.

public class RejectEvent<T extends UserTrade> extends ResponderEvent<T>

An event that denotes that the trade has been rejected. Reject events are expected to contain an error code and/or an error message to indicate why the trade was rejected. An error code is generally more useful than a message, because it can be internationalised on the front end into a helpful error message in the user's own language.

Note that some error codes or messages are provided by the trading system if your adapter submitted the trade and it failed. But you may reject the trade from your adapter code without ever submitting it to the trading system, if for example you detect that the fields on the incoming trade message are invalid. In this situation you will need to provide your own error code and/or message.

  • Field Details

    • REJECT

      public static final String REJECT
      The event name for a Reject event
      See Also:
    • ERROR_CODE

      public static final String ERROR_CODE
      The field name used for sending the error code to the front end.
      See Also:
    • ERROR_MESSAGE

      public static final String ERROR_MESSAGE
      The field name used for sending the error message to the front end.
      See Also:
  • Constructor Details

    • RejectEvent

      public RejectEvent(String errorMessage, String errorCode)
      Constructs a RejectEvent with the event name "Reject" and the specified error message and code.
      Parameters:
      errorMessage - A natural language message that can be displayed to the user giving more information about the rejection. This sometimes comes directly from the trading system. However it is often less useful than the error code, because it will be written in a specific language.
      errorCode - The reject code that can be displayed to the user. This can be translated to an internationalised error message rather than shown as a raw error code, to give the user useful feedback regardless of their language.