Class ActivityBlotterService

  • All Implemented Interfaces:
    com.caplin.datasource.blotter.BlotterApplicationListener

    public class ActivityBlotterService
    extends java.lang.Object
    implements com.caplin.datasource.blotter.BlotterApplicationListener
    Handles requests, discards, and deal updates for the activity blotter.

    - a request occurs when the user logs in and selects the activity blotter - a discard occurs when the blotter is no longer required by the user - deal updates are triggered after a deal is submitted (for example, the deal changes from 'Submitted' to 'Accepted')

    The activity blotter is a session blotter, so updates outside of a user being logged in and having established a channel can safely be ignored.

    +----------+ +----------------------+ +-------------------+ |(Blotters)| |ActivityBlotterService| |BlotterDataExtractor| +-----+----+ +----------+-----------+ +---------+---------+ | | | | | | | blotterChannelOpened | | +--------------------->| | | | | | | updateDeal | | |<----------------------| | | | | sendBlotterItem | | |<---------------------| | | | | | | | | | | | | | | blotterChannelClosed | | +--------------------->| | v v v

    The ActivityBlotterService gets its data from one of the the BlotterDataProviders, which in turn are updated by a combination of the FX API, as the trade progresses through the trade model states, and TrAPI.

    - (concurrent) stores currently in-use channels in a concurrent map - (longlife) alive continually

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void blotterChannelClosed​(com.caplin.datasource.blotter.BlotterChannel channel)
      Called once when the activity blotter is discarded by the user.
      void blotterChannelOpened​(com.caplin.datasource.blotter.BlotterChannel channel)
      Called once when the activity blotter is subscribed to by the user.
      void updateDeal​(java.lang.String user, java.lang.String dealId, java.util.Map<java.lang.String,​java.lang.String> fields)
      Called by us whenever the state of a deal changes (notified by the FX API).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ActivityBlotterService

        @Inject
        public ActivityBlotterService​(BlotterItemFactory factory)
    • Method Detail

      • blotterChannelOpened

        public void blotterChannelOpened​(com.caplin.datasource.blotter.BlotterChannel channel)
        Called once when the activity blotter is subscribed to by the user.

        This method is called automatically by the blotter api.

        Specified by:
        blotterChannelOpened in interface com.caplin.datasource.blotter.BlotterApplicationListener
      • blotterChannelClosed

        public void blotterChannelClosed​(com.caplin.datasource.blotter.BlotterChannel channel)
        Called once when the activity blotter is discarded by the user.

        This method is called automatically by the blotter api.

        Specified by:
        blotterChannelClosed in interface com.caplin.datasource.blotter.BlotterApplicationListener
      • updateDeal

        public void updateDeal​(java.lang.String user,
                               java.lang.String dealId,
                               java.util.Map<java.lang.String,​java.lang.String> fields)
        Called by us whenever the state of a deal changes (notified by the FX API).

        This method is used to publish the fields associated with each new or updated deal, ie it publishes a line in the activity blotter.

        Parameters:
        user - A string identifying the logged in user, their logged in name
        dealId - A string identifying a new or existing deal
        fields - A dictionary of field : value pairs