Class InstrumentDataRequestRedirectHelper

java.lang.Object
velox.api.layer1.providers.helper.InstrumentDataRequestRedirectHelper

public class InstrumentDataRequestRedirectHelper
extends java.lang.Object

When creating synthetic instruments using Layer1UpstreamDataEditor bookmap will still try to query those instruments for certain things (like "which provider does it belong to?", "which order types are supported by that instrument").

This class provides helper methods to take care of that for you.

  • Constructor Summary

    Constructors 
    Constructor Description
    InstrumentDataRequestRedirectHelper()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.Object redirectUserMessage​(java.lang.Object data, java.util.function.Function<java.lang.Object,​java.lang.Object> forwardFunction, java.util.function.Function<java.lang.String,​java.lang.String> aliasMapper)
    Should be used inside Layer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • redirectUserMessage

      public static java.lang.Object redirectUserMessage​(java.lang.Object data, java.util.function.Function<java.lang.Object,​java.lang.Object> forwardFunction, java.util.function.Function<java.lang.String,​java.lang.String> aliasMapper)
      Should be used inside Layer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests
      Parameters:
      data - the original data object that you have received as part of request
      forwardFunction - where to forward requests (usually to the lower layers, often will be something like super::sendUserMessage)
      aliasMapper - your function that handles alias translation. If provided alias isn't created by your strategy - return null, otherwise provide some other alias to take that information from (e.g. if you are creating synthetic instruments that will often be one of underlying instruments)
      Returns:
      value that should be returned by Layer1ApiAdminProvider.sendUserMessage(Object)