-
January 11th, 2007, 09:17 PM
#1
Hi...
let me ask you something...
In a stockmarket company (broker) have 5 clients and each client wants to see diferent information in their pages.
For exemple:
- client "A" wants to see information from the company "W" and "X".
- client "B" wants to see information from the company "X" and "Y".
- client "C" wants to see information from the company "V", "W" and "Y".
- etc.
in a max range of 3 companys per page.
This information of wich companys my clients wants to view is stored in a database that have my client's ids and company's ids.
How can i show diferent information to diferents clients?
Is there any way to notify LS when a client start receving data that this connection belongs to client A or B?
Did you understand wich is my doubt?
thanks!!!
Rafael
-
January 12th, 2007, 09:02 AM
#2
Hi Rafael
The clients can identify themselves through the user credentials, by calling
setUserName and setPassword.
This information (the user name in particular) is then made available to the getItems method in the Metadata Adapter, which can transform generic "item groups" requests issued by the clients into specific item requests on a user basis.
This is not supported by the default Metadata Adapter and requires that you implement you own Metadata Adapter code.
Note, however, that if different clients also need to see pages of different shape (i.e. with a different number of tables shown), then some client side elaboration is needed and this is not provided by Lightstreamer Web Client Library.
Dario
-
January 15th, 2007, 03:43 PM
#3
Dario,
may i ask you something...
The Data Adapter is responsible to send all information that can be used by the clients.
For exemple, in a datasource that have prices and other information about all companies in the stockmarket, Data Adapter will check this source, "format" these informations and send it to clients only the subscribed itens. (that can be all itens as in the LS's exemple)
Is that correct?
In my case, diferents clients wants to see diferents itens as i told before. Not in quantity, but in content. The Metadata Adapter is responsible to subscribe the itens that a client wants to see, if i "tell" who is the client or the iten. Otherwise, if nothing is informed, he will subscribe all content sent by Data Adapter.
GetItens method is the one who returns the itens that must be subscribed.
Is that correct?
Thanks...
-
January 15th, 2007, 05:57 PM
#4
Originally Posted by
rmusco
...and send it to clients only the subscribed itens. (that can be all itens as in the LS's exemple)
Is that correct?
Yes
Originally Posted by
rmusco
if i "tell" who is the client or the iten. Otherwise, if nothing is informed, he will subscribe all content sent by Data Adapter.
When you "tell" who is the client and the item.
In fact the getItems method is always called. There is not a default return value, but there are 2 default implementations of this method, one in the LiteralBasedProvider class and the other in the FileBasedProvider (you can find them under LS_HOME/DOCS-SDKs/sdk_adapter_java/examples/Reusable_MetadataAdapters).
The one used with the StockListDemo is the LiteralBasedProvider which getItems implementation splits the received string on spaces and subscribes to the DataAdapter each obtained string as an item.
GetItens method is the one who returns the itens that must be subscribed.
Is that correct?
Yes.
PS: note that there is a similar behaviour for the field names: getSchema
-
January 15th, 2007, 07:06 PM
#5
Mone,
is it possible that my GetItens method, recives only an Identification Number (my clientID, for exemple) as parameter? With this clientID, inside GetItens method, i can execute a query that returns all Company's ids that a specific client wants to see.
"Format" this result to be returned as a string array.
Can i do something like this or must i have to pass as parameter the string of companys IDs separeted with spaces ( "CompanyA CompanyB ..." )
-
January 16th, 2007, 08:43 AM
#6
Yes of course,
all you have to do is to implement your own MetaDataprovider (maybe extending an existing one) instead of using the LiteralBasedProvider.
-
January 17th, 2007, 05:08 PM
#7
I was looking FileBasedProvider.java 's code and it extends LiteralBasedProvider
If i want to implement my own MetaDataProvider, i must do the same? Extends .NET's LiteralBasedProvider? Or i just need to extends MetadataProviderAdapter class?
Can i have more then one "Stream Source" (i don't know the real name... ) in tha same page? For exemple, quotes of a stocklist is one "Stream Source". Can i have another "Stream Source", News, for exemple?
-
January 17th, 2007, 06:54 PM
#8
In order to write your own Metadata Adapter, you can choose among a number of options:
- directly implement the MetadataProvider interface
- extend the MetadataProviderAdapter class (which implements the MetadataProvider interface)
- extend the LiteralBasedProvider or FilelBasedProvider classes (which extend the MetadataProviderAdapter class)
It's all a matter of hierarchy and inheritance.
Regarding having multiple data sources, if they are destined to deliver data to different client sessions, then you can plug multiple Data Adapters into Lightstreamer Server. On the other hand, if you need to deliver the data coming from different data sources to the same client session, then you need to write a single Data Adapter that accesses all of the feeds. Mixing different Data Adapters in the same client session is not supported yet.
-
February 2nd, 2007, 05:29 PM
#9
Similar Threads
-
By leonardodar in forum Adapter SDKs
Replies: 3
Last Post: March 16th, 2011, 09:45 AM
-
By shayzweig in forum Client SDKs
Replies: 2
Last Post: February 9th, 2010, 02:50 PM
-
By zeos in forum Adapter SDKs
Replies: 1
Last Post: January 28th, 2010, 09:41 AM
-
By mnenchev in forum Adapter SDKs
Replies: 5
Last Post: September 1st, 2009, 09:36 AM
-
By vishnugs in forum General
Replies: 4
Last Post: April 6th, 2007, 11:06 AM
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 04:09 PM.
Bookmarks