Users and permissioning

This page describes how to handle users, RET clients, and permissioning when developing your own RET adapter suite.

Mapping users to RET clients

Each adapter created by the RET Adapter Toolkit uses an implementation of UserManager to access extra RET-related user attributes, including how users map to clients in RET.

The RET Adapter Toolkit includes an example implementation of UserManager, FileBasedUserManager, which loads user attributes from an XML file, logins.xml. Use this example to help you create your own implementation of UserManager that loads user attributes from a central resource.

Specify your own implementation of UserManager in the configuration builder for your adapter:

public class MyCalendarAdapter
{
  public static void main(String[] args)
  {
    try {
      CalendarConfiguration calendarConfiguration =
        CalendarConfiguration.newConfigurationBuilder()
        .setUserManager(new MyUserManager())
        .build();

      final ConfigurationLoader configurationLoader =
        calendarConfiguration.getConfigurationLoader();

      final Log4jConfiguration log4jConfiguration =
        Log4jConfiguration.newDefaultConfiguration().build();
      log4jConfiguration.initialise(configurationLoader);

      CalendarAdapter adapter = new CalendarAdapter(calendarConfiguration);
      adapter.start();
    } catch (Exception ex) {
      ex.printStackTrace();
      System.exit(1);
    }
  }
}

Permissioning users

The RET Adapter Toolkit includes a class to create a Permissioning Adapter that supplies permissioning data to the Caplin Permissioning Service.

As part of the work of creating your own permissioning adapter, create your own implementations of the following interfaces:

Interface Example implementation

PermissionLoader

GroupPermissionLoader, UserLoader, UserPermissionsLoader

AuthenticationManager

FileBasedAuthenticationManager

InstrumentProvider

FxCrossInstrumentProvider

UserManager

FileBasedUserManager

Specify your own implementations of the classes above in the configuration builder for your permissioning adapter:

public class MyPermissioningAdapter
{
  public static void main(String[] args)
  {
    try
    {
      PermissioningAdapterConfiguration configuration =
        PermissioningAdapterConfiguration.newPermissioningConfigurationBuilder()
        .addPermissionLoader(new MyPermissionLoader())
        .setInstrumentProvider(new MyInstrumentProvider())
        .setAuthenticationManager(new MyAuthenticationManager())
        .setUserManager(new MyUserManager())
        .build();

      final ConfigurationLoader configurationLoader =
        configuration.getConfigurationLoader();

      final Log4jConfiguration log4jConfiguration =
        Log4jConfiguration.newDefaultConfiguration().build();
      log4jConfiguration.initialise(configurationLoader);

      PermissioningAdapter adapter = new PermissioningAdapter(configuration);
      adapter.start();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
      System.exit(1);
    }
  }
}