Package com.caplin.motif.fx.trading
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 extendsUserTrade
, which this RejectEvent relates to. For example,ESPTrade
orBlockTrade
.
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 Summary
Modifier and TypeFieldDescriptionstatic final String
The field name used for sending the error code to the front end.static final String
The field name used for sending the error message to the front end.static final String
The event name for a Reject eventFields inherited from class com.caplin.motif.fx.trading.ResponderEvent
fields
-
Constructor Summary
ConstructorDescriptionRejectEvent
(String errorMessage, String errorCode) Constructs a RejectEvent with the event name "Reject" and the specified error message and code. -
Method Summary
Methods inherited from class com.caplin.motif.fx.trading.ResponderEvent
addField, addFields, equals, getEventName, getField, getFields, hashCode, toString
-
Field Details
-
REJECT
The event name for a Reject event- See Also:
-
ERROR_CODE
The field name used for sending the error code to the front end.- See Also:
-
ERROR_MESSAGE
The field name used for sending the error message to the front end.- See Also:
-
-
Constructor Details
-
RejectEvent
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.
-