Class SavingResponder

java.lang.Object
com.caplin.motif.fx.trading.Responder<T>
com.caplin.motif.fx.trading.FXResponder<EditStrategyRequest>
com.caplin.motif.fx.trading.orders.edit.responder.SavingResponder

public class SavingResponder extends FXResponder<EditStrategyRequest>

A Responder for Edit Strategy, that can send messages from the Saving state.

See Also:
  • Field Summary

    Fields inherited from class com.caplin.motif.fx.trading.Responder

    logger, trade
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a Responder that can respond from the Saving state for the EditStrategy trade model.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sends the SaveAccept event to notify the client that the request to save the edits to the strategy/order has been successfully executed in the backend trading system
    void
    Sends the SaveAndComplete event to notify the client that the request to save the edits to the strategy/order has been successfully executed in the backend trading system, and that the client should now close the edit ticket as the backend is not longer editing the order.
    void
    Sends the ValidationError event to notify the client that the reuqes to save the edits to the strategy/order has failed because of validation erorrs in the changes.

    Methods inherited from class com.caplin.motif.fx.trading.FXResponder

    sendError, sendReject

    Methods inherited from class com.caplin.motif.fx.trading.Responder

    equals, hashCode, respond, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SavingResponder

      public SavingResponder(EditStrategyRequest request, StrategyCache strategyCache)

      Constructs a Responder that can respond from the Saving state for the EditStrategy trade model.

      Please use EditStrategyRequest.getSavingResponder() to retrieve an instance.

      Parameters:
      request - The object representing the trade for the edit strategy request, which this responder can send messages for.
      strategyCache - A cache for storing the most recent version of the Strategy reported by the server.
  • Method Details

    • sendSaveAccept

      public void sendSaveAccept(SaveAcceptEvent event) throws com.caplin.trading.TradeException

      Sends the SaveAccept event to notify the client that the request to save the edits to the strategy/order has been successfully executed in the backend trading system

      Parameters:
      event - The event to send to the client
      Throws:
      com.caplin.trading.TradeException - If there was a problem sending the event
    • sendSaveAndComplete

      public void sendSaveAndComplete(SaveAndCompleteEvent event) throws com.caplin.trading.TradeException

      Sends the SaveAndComplete event to notify the client that the request to save the edits to the strategy/order has been successfully executed in the backend trading system, and that the client should now close the edit ticket as the backend is not longer editing the order.

      Parameters:
      event - The event to send to the client
      Throws:
      com.caplin.trading.TradeException - If there was a problem sending the event
    • sendValidationError

      public void sendValidationError(ValidationErrorEvent event) throws com.caplin.trading.TradeException

      Sends the ValidationError event to notify the client that the reuqes to save the edits to the strategy/order has failed because of validation erorrs in the changes.

      Parameters:
      event - The event to send to the client
      Throws:
      com.caplin.trading.TradeException - If there was a problem sending the event