-
May 29th, 2018, 10:20 PM
#1
Selectors in tableInfo class
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
-
May 30th, 2018, 09:53 AM
#2
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 setSelector in 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.
-
May 30th, 2018, 02:07 PM
#3
You might also want to check out this old post, which contains some code:
https://forums.lightstreamer.com/sho...sing-selectors
Similar Threads
-
By suvin_s in forum General
Replies: 2
Last Post: August 31st, 2009, 12:58 PM
-
By k.mcc2009 in forum Adapter SDKs
Replies: 1
Last Post: May 21st, 2009, 09:41 AM
-
By khalil78 in forum Adapter SDKs
Replies: 2
Last Post: April 4th, 2008, 07:38 PM
-
By Alessandro in forum Client SDKs
Replies: 2
Last Post: December 24th, 2007, 09:02 AM
-
By Alessandro in forum General
Replies: 0
Last Post: February 2nd, 2007, 05:40 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 09:31 AM.
Bookmarks