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 and Description |
---|
InstrumentDataRequestRedirectHelper() |
Modifier and Type | Method and 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 |
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)
Layer1ApiAdminProvider.sendUserMessage(Object)
,
helps you to redirect requestsdata
- 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 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)Layer1ApiAdminProvider.sendUserMessage(Object)