rajesh.palanisamy
Hi,
Can you provide some samples on how to configure Selectors while doing subscription, i see that the attribute is available in class 'com.lightstreamer.interfaces.metadata.TableInfo' and triggers on notifyNewTables method. Is there a way to send selectors and control the events published.
Kindly share the details of the sample for reference.
Thanks
Rajesh
Dario Crivelli
Hi Rajesh, unfortunately there are no ready-made examples of the use of the Selectors.
Let me recollect all the elements, then please identify for what aspects you would like to see some pseudocode.
The Selector modifies the meaning of the subscribed items and is requested by the client. In most client SDKs, you should find setSelectorin a Subscription object on the client API.
Since the Selector restricts the update flow, you can use it also as a way to exclude data not pertaining to the client. In this case, the client cooperates by specifying the Selector, but the Metadata Adapter should check, in notifyNewTables, that the Selector specified is one that you require for the subscribed items and that it is not null when required.
The isSelectorAllowed method can also be used for simpler checks of the allowance of the specified Selector.
Upon a subscription request for an item which includes a Selector, the isSelected method will be invoked on the Metadata Adapter for each update event for the item that pertains to that subscription. Hence different subscriptions of the item by the same or a different client will receive independent invocations. This lets you restrict the update flow of the item, possibly depending on the involved user.
If you need some pseudocode, please provide us with details on your use case. Please also specify the client SDK in use; on the adapter side, note that the selector is only available for the java in-process adapters.