Class InstrumentDataRequestRedirectHelper
java.lang.Object
velox.api.layer1.providers.helper.InstrumentDataRequestRedirectHelper
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectredirectUserMessage(Object data, Function<Object, Object> forwardFunction, Function<String, String> aliasMapper) Should be used insideLayer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests Delegates toredirectUserMessage(Object, Function, Function, boolean)without keeping provider (use this method for synthetic instruments)static ObjectredirectUserMessage(Object data, Function<Object, Object> forwardFunction, Function<String, String> aliasMapper, boolean keepProvider) Should be used insideLayer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests
-
Constructor Details
-
InstrumentDataRequestRedirectHelper
public InstrumentDataRequestRedirectHelper()
-
-
Method Details
-
redirectUserMessage
public static Object redirectUserMessage(Object data, Function<Object, Object> forwardFunction, Function<String, String> aliasMapper) Should be used insideLayer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests Delegates toredirectUserMessage(Object, Function, Function, boolean)without keeping provider (use this method for synthetic instruments) -
redirectUserMessage
public static Object redirectUserMessage(Object data, Function<Object, Object> forwardFunction, Function<String, String> aliasMapper, boolean keepProvider) Should be used insideLayer1ApiAdminProvider.sendUserMessage(Object), helps you to redirect requests- Parameters:
data- the original data object that you have received as part of requestforwardFunction- where to forward requests (usually to the lower layers, often will be something likesuper::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)keepProvider- defines if messages should be forwarded futher and not change the provider. The value should be true if the data provider of the mapped alias was not changed. For synthetic instruments the value should be false.- Returns:
- value that should be returned by
Layer1ApiAdminProvider.sendUserMessage(Object)
-