Class DirectorUserManager

  • All Implemented Interfaces:
    com.caplin.datasource.subscription.SubscriptionListener, UserManager

    public class DirectorUserManager
    extends java.lang.Object
    implements UserManager, com.caplin.datasource.subscription.SubscriptionListener
    A UserManager which integrates with Caplin Director.
    • Constructor Summary

      Constructors 
      Constructor Description
      DirectorUserManager​(com.caplin.datasource.DataSource dataSource)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void containerUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.container.ContainerMessage message)  
      void genericMessageUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.record.GenericMessage message)  
      java.lang.String getRetClientForSsoUsername​(java.lang.String assetClass, java.lang.String ssoUsername)
      Given an asset class and a Single Sign On (SSO) user name, returns the RET client name.
      java.lang.String getRetClientForToboUsername​(java.lang.String assetClass, java.lang.String toboUsername)
      Given an asset class and a Trade On Behalf Of (TOBO) user name, returns the RET client name.
      java.util.Set<java.lang.String> getRetClientsTradedBySsoUser​(java.lang.String ssoUsername)
      Given a Single Sign On (SSO) user name, returns the set of RET clients which can be traded on behalf of.
      java.util.Set<java.lang.String> getRetClientsTradedByToboUser​(java.lang.String toboUsername)
      Given a Trade On Behalf Of (TOBO) user name, returns the set of RET clients which can be traded on behalf of.
      java.lang.String getSsoUsername​(java.lang.String toboUsername)
      Given a Trade On Behalf Of (TOBO) user name, returns a Single Sign On (SSO) user name.
      java.util.Set<java.lang.String> getSsoUserNamesWhoCanTobo​(java.lang.String retClientName)
      Given a RET client name, returns the set of all Single Sign On (SSO) users with permission to Trade On Behalf Of (TOBO) them.
      java.lang.String getToboUsername​(java.lang.String retClientName)
      Given a RET client name, returns the Trade On Behalf Of (TOBO) user name.
      java.util.Set<java.lang.String> getToboUsers​(java.lang.String ssoUsername)
      Given a Single Sign On (SSO) user name, returns the set of related Trade On Behalf Of (TOBO) users.
      void initialise​(UserManager.Context context)
      This notifies the UserManager that it is about to be loaded.
      void jsonUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.json.JsonMessage jsonMessage)  
      void newsUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.news.NewsMessage message)  
      void pageUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.page.PageMessage message)  
      void permissionUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.permission.PermissionMessage message)  
      void recordType2Updated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.record.RecordType2Message message)  
      void recordType3Updated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.record.RecordType3Message message)  
      void recordUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.record.RecordMessage message)  
      void storyUpdated​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.messaging.story.StoryMessage message)  
      void subjectErrorReceived​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.SubjectErrorEvent subjectErrorEvent)  
      void subjectStatusReceived​(com.caplin.datasource.subscription.Subscription subscription, com.caplin.datasource.Peer peer, com.caplin.datasource.SubjectStatusEvent subjectStatusEvent)  
      • Methods inherited from class java.lang.Object

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

      • DirectorUserManager

        public DirectorUserManager​(com.caplin.datasource.DataSource dataSource)
    • Method Detail

      • initialise

        public void initialise​(UserManager.Context context)
                        throws UserManagerException
        Description copied from interface: UserManager

        This notifies the UserManager that it is about to be loaded. This method will be called by the system once.

        You should use this method to perform any initialisation required before the UserManager is loaded by the system.

        Specified by:
        initialise in interface UserManager
        Throws:
        UserManagerException - if for any reason initialisation fails.
      • getRetClientForToboUsername

        public java.lang.String getRetClientForToboUsername​(java.lang.String assetClass,
                                                            java.lang.String toboUsername)
                                                     throws UserManagerException
        Description copied from interface: UserManager
        Given an asset class and a Trade On Behalf Of (TOBO) user name, returns the RET client name.
        Asset ClassTOBO User NameReturns
        FXclient1client1.ret.client.fx
        Commoditiesclient1client1.ret.client.pm
        Specified by:
        getRetClientForToboUsername in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • getRetClientForSsoUsername

        public java.lang.String getRetClientForSsoUsername​(java.lang.String assetClass,
                                                           java.lang.String ssoUsername)
                                                    throws UserManagerException
        Description copied from interface: UserManager
        Given an asset class and a Single Sign On (SSO) user name, returns the RET client name.
        Asset ClassSSOUserReturns
        FXuser1@caplin.comuser1.ret.client.fx
        Commoditiesuser1@caplin.comuser1.ret.client.pm
        Specified by:
        getRetClientForSsoUsername in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • getSsoUsername

        public java.lang.String getSsoUsername​(java.lang.String toboUsername)
                                        throws UserManagerException
        Description copied from interface: UserManager
        Given a Trade On Behalf Of (TOBO) user name, returns a Single Sign On (SSO) user name.
        TOBO User NameReturns
        client1user1@caplin.com
        client2user2@caplin.com
        Specified by:
        getSsoUsername in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • getToboUsername

        public java.lang.String getToboUsername​(java.lang.String retClientName)
                                         throws UserManagerException
        Description copied from interface: UserManager
        Given a RET client name, returns the Trade On Behalf Of (TOBO) user name.
        RET Client NameReturns
        michael.ret.client.fxmichael
        michael.ret.client.pmmichael
        terry.ret.client.pmterry
        Specified by:
        getToboUsername in interface UserManager
        Throws:
        UserManagerException - if no client is found.
      • getToboUsers

        public java.util.Set<java.lang.String> getToboUsers​(java.lang.String ssoUsername)
                                                     throws UserManagerException
        Description copied from interface: UserManager
        Given a Single Sign On (SSO) user name, returns the set of related Trade On Behalf Of (TOBO) users.
        SSO User NameReturns
        salestrader1@caplin.com(salestrader, graham, john, terry, eric, michael)
        user1@caplin.com(client1)
        Specified by:
        getToboUsers in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • getSsoUserNamesWhoCanTobo

        public java.util.Set<java.lang.String> getSsoUserNamesWhoCanTobo​(java.lang.String retClientName)
                                                                  throws UserManagerException
        Description copied from interface: UserManager
        Given a RET client name, returns the set of all Single Sign On (SSO) users with permission to Trade On Behalf Of (TOBO) them.
        RET Client NameReturns
        terry.ret.client.fx(salestrader1@caplin.com)
        client1.ret.client.fx(user1@caplin.com)
        Specified by:
        getSsoUserNamesWhoCanTobo in interface UserManager
        Throws:
        UserManagerException - if no client is found.
      • getRetClientsTradedBySsoUser

        public java.util.Set<java.lang.String> getRetClientsTradedBySsoUser​(java.lang.String ssoUsername)
                                                                     throws UserManagerException
        Description copied from interface: UserManager
        Given a Single Sign On (SSO) user name, returns the set of RET clients which can be traded on behalf of.
        SSO User NameReturns
        salestrader1@caplin.com (rates.ret.client.fx, graham.ret.client.fx, john.ret.client.fx, terry.ret.client.fx, eric.ret.client.fx, michael.ret.client.fx)
        user1@caplin.com(client1.ret.client.fx, client1.ret.client.pm)
        Specified by:
        getRetClientsTradedBySsoUser in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • getRetClientsTradedByToboUser

        public java.util.Set<java.lang.String> getRetClientsTradedByToboUser​(java.lang.String toboUsername)
                                                                      throws UserManagerException
        Description copied from interface: UserManager
        Given a Trade On Behalf Of (TOBO) user name, returns the set of RET clients which can be traded on behalf of.
        TOBO User NameReturns
        graham(graham.ret.client.fx)
        user1(client1.ret.client.fx, client1.ret.client.pm)
        Specified by:
        getRetClientsTradedByToboUser in interface UserManager
        Throws:
        UserManagerException - if no user is found.
      • containerUpdated

        public void containerUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                     com.caplin.datasource.Peer peer,
                                     com.caplin.datasource.messaging.container.ContainerMessage message)
        Specified by:
        containerUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • recordUpdated

        public void recordUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                  com.caplin.datasource.Peer peer,
                                  com.caplin.datasource.messaging.record.RecordMessage message)
        Specified by:
        recordUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • recordType2Updated

        public void recordType2Updated​(com.caplin.datasource.subscription.Subscription subscription,
                                       com.caplin.datasource.Peer peer,
                                       com.caplin.datasource.messaging.record.RecordType2Message message)
        Specified by:
        recordType2Updated in interface com.caplin.datasource.subscription.SubscriptionListener
      • recordType3Updated

        public void recordType3Updated​(com.caplin.datasource.subscription.Subscription subscription,
                                       com.caplin.datasource.Peer peer,
                                       com.caplin.datasource.messaging.record.RecordType3Message message)
        Specified by:
        recordType3Updated in interface com.caplin.datasource.subscription.SubscriptionListener
      • genericMessageUpdated

        public void genericMessageUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                          com.caplin.datasource.Peer peer,
                                          com.caplin.datasource.messaging.record.GenericMessage message)
        Specified by:
        genericMessageUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • jsonUpdated

        public void jsonUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                com.caplin.datasource.Peer peer,
                                com.caplin.datasource.messaging.json.JsonMessage jsonMessage)
        Specified by:
        jsonUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • permissionUpdated

        public void permissionUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                      com.caplin.datasource.Peer peer,
                                      com.caplin.datasource.messaging.permission.PermissionMessage message)
        Specified by:
        permissionUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • newsUpdated

        public void newsUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                com.caplin.datasource.Peer peer,
                                com.caplin.datasource.messaging.news.NewsMessage message)
        Specified by:
        newsUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • storyUpdated

        public void storyUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                 com.caplin.datasource.Peer peer,
                                 com.caplin.datasource.messaging.story.StoryMessage message)
        Specified by:
        storyUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • pageUpdated

        public void pageUpdated​(com.caplin.datasource.subscription.Subscription subscription,
                                com.caplin.datasource.Peer peer,
                                com.caplin.datasource.messaging.page.PageMessage message)
        Specified by:
        pageUpdated in interface com.caplin.datasource.subscription.SubscriptionListener
      • subjectErrorReceived

        public void subjectErrorReceived​(com.caplin.datasource.subscription.Subscription subscription,
                                         com.caplin.datasource.Peer peer,
                                         com.caplin.datasource.SubjectErrorEvent subjectErrorEvent)
        Specified by:
        subjectErrorReceived in interface com.caplin.datasource.subscription.SubscriptionListener
      • subjectStatusReceived

        public void subjectStatusReceived​(com.caplin.datasource.subscription.Subscription subscription,
                                          com.caplin.datasource.Peer peer,
                                          com.caplin.datasource.SubjectStatusEvent subjectStatusEvent)
        Specified by:
        subjectStatusReceived in interface com.caplin.datasource.subscription.SubscriptionListener