Interface RFSCoreTrade

  • All Known Implementing Classes:
    AmendTrade, RFSTrade

    public interface RFSCoreTrade

    A single RFSCoreTrade active in the system.

    A Trade is initiated by a client and is tied to a TradeChannel. The lifecycle of a Trade consists of a number of messages, represented by TradeEvents, being sent between the client and the Trading System in both directions. These messages cause the Trade to transition between a number of predefined states.

    Trades are comprised of one or more trade legs, which each leg representing the exchange of a financial instrument and the resultant cash flow. It is possible to add, remove and update trades from the client or from the TradingDataSource.

    A Trade is uniquely identified in two ways: by RequestId set by the client and a TradeId set by the Trading System.

    • Method Detail

      • createErrorTradeEvent

        ErrorTradeEvent createErrorTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Error state.

        Returns:
        A new instance of ErrorTradeEvent.
      • sendErrorEvent

        void sendErrorEvent​(ErrorTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Error state.

        Parameters:
        event - The event to send.
      • createSubmitAckTradeEvent

        SubmitAckTradeEvent createSubmitAckTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the SubmitAck state.

        Returns:
        A new instance of SubmitAckTradeEvent.
      • sendSubmitAckEvent

        void sendSubmitAckEvent​(SubmitAckTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the SubmitAck state.

        Parameters:
        event - The event to send.
      • sendSubmitAckEvent

        void sendSubmitAckEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the SubmitAck state.

      • createRejectTradeEvent

        RejectTradeEvent createRejectTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Reject state.

        Returns:
        A new instance of RejectTradeEvent.
      • sendRejectEvent

        void sendRejectEvent​(RejectTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Reject state.

        Parameters:
        event - The event to send.
      • createClientCloseAckTradeEvent

        ClientCloseAckTradeEvent createClientCloseAckTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the ClientCloseAck state.

        Returns:
        A new instance of ClientCloseAckTradeEvent.
      • sendClientCloseAckEvent

        void sendClientCloseAckEvent​(ClientCloseAckTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the ClientCloseAck state.

        Parameters:
        event - The event to send.
      • sendClientCloseAckEvent

        void sendClientCloseAckEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the ClientCloseAck state.

      • createWithdrawTradeEvent

        WithdrawTradeEvent createWithdrawTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Withdraw state.

        Returns:
        A new instance of WithdrawTradeEvent.
      • sendWithdrawEvent

        void sendWithdrawEvent​(WithdrawTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Withdraw state.

        Parameters:
        event - The event to send.
      • sendWithdrawEvent

        void sendWithdrawEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the Withdraw state.

      • createExecuteAckTradeEvent

        ExecuteAckTradeEvent createExecuteAckTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the ExecuteAck state.

        Returns:
        A new instance of ExecuteAckTradeEvent.
      • sendExecuteAckEvent

        void sendExecuteAckEvent​(ExecuteAckTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the ExecuteAck state.

        Parameters:
        event - The event to send.
      • sendExecuteAckEvent

        void sendExecuteAckEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the ExecuteAck state.

      • createPriceUpdateTradeEvent

        PriceUpdateTradeEvent createPriceUpdateTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the PriceUpdate state.

        Returns:
        A new instance of PriceUpdateTradeEvent.
      • sendPriceUpdateEvent

        void sendPriceUpdateEvent​(PriceUpdateTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the PriceUpdate state.

        Parameters:
        event - The event to send.
      • createPriceUpdateTradeEvent

        PriceUpdateTradeEvent createPriceUpdateTradeEvent​(Message message)

        Create a TradeEvent that can be used to trigger the trade to transition into the PriceUpdate state.

        Returns:
        A new instance of PriceUpdateTradeEvent.
      • createWarningTradeEvent

        WarningTradeEvent createWarningTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Warning state.

        Returns:
        A new instance of WarningTradeEvent.
      • sendWarningEvent

        void sendWarningEvent​(WarningTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Warning state.

        Parameters:
        event - The event to send.
      • sendWarningEvent

        void sendWarningEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the Warning state.

      • createHoldTradeEvent

        HoldTradeEvent createHoldTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Hold state.

        Returns:
        A new instance of HoldTradeEvent.
      • sendHoldEvent

        void sendHoldEvent​(HoldTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Hold state.

        Parameters:
        event - The event to send.
      • sendHoldEvent

        void sendHoldEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the Hold state.

      • createExpireTradeEvent

        ExpireTradeEvent createExpireTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the Expire state.

        Returns:
        A new instance of ExpireTradeEvent.
      • sendExpireEvent

        void sendExpireEvent​(ExpireTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the Expire state.

        Parameters:
        event - The event to send.
      • sendExpireEvent

        void sendExpireEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the Expire state.

      • createPickUpTradeEvent

        PickUpTradeEvent createPickUpTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the PickUp state.

        Returns:
        A new instance of PickUpTradeEvent.
      • sendPickUpEvent

        void sendPickUpEvent​(PickUpTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the PickUp state.

        Parameters:
        event - The event to send.
      • sendPickUpEvent

        void sendPickUpEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the PickUp state.

      • createTradeConfirmationTradeEvent

        TradeConfirmationTradeEvent createTradeConfirmationTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the TradeConfirmation state.

        Returns:
        A new instance of TradeConfirmationTradeEvent.
      • sendTradeConfirmationEvent

        void sendTradeConfirmationEvent​(TradeConfirmationTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the TradeConfirmation state.

        Parameters:
        event - The event to send.
      • createTradeConfirmationTradeEvent

        TradeConfirmationTradeEvent createTradeConfirmationTradeEvent​(Message message)

        Create a TradeEvent that can be used to trigger the trade to transition into the TradeConfirmation state.

        Returns:
        A new instance of TradeConfirmationTradeEvent.
      • createAcceptWarningAckTradeEvent

        AcceptWarningAckTradeEvent createAcceptWarningAckTradeEvent()

        Create a TradeEvent that can be used to trigger the trade to transition into the AcceptWarningAck state.

        Returns:
        A new instance of AcceptWarningAckTradeEvent.
      • sendAcceptWarningAckEvent

        void sendAcceptWarningAckEvent​(AcceptWarningAckTradeEvent event)

        Send a TradeEvent to trigger the trade to transition into the AcceptWarningAck state.

        Parameters:
        event - The event to send.
      • sendAcceptWarningAckEvent

        void sendAcceptWarningAckEvent()

        Send a TradeEvent with no fields to trigger the trade to transition into the AcceptWarningAck state.

      • getRequestID

        String getRequestID()
        Returns the ID generated from the client. The combination of user and trade is unique.
        Returns:
        the request ID.
      • getUsername

        String getUsername()
        Returns the username of the logged in user that created this trade.
        Returns:
        the username of the logged in user.
      • getBackingTrade

        com.caplin.trading.Trade getBackingTrade()