Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Nov 2006
    Location
    Rio de Janeiro
    Posts
    13
    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

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    973
    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

  3. #3
    Member
    Join Date
    Nov 2006
    Location
    Rio de Janeiro
    Posts
    13
    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...

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Quote 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

    Quote 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

  5. #5
    Member
    Join Date
    Nov 2006
    Location
    Rio de Janeiro
    Posts
    13
    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 ..." )

  6. #6
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Yes of course,
    all you have to do is to implement your own MetaDataprovider (maybe extending an existing one) instead of using the LiteralBasedProvider.

  7. #7
    Member
    Join Date
    Nov 2006
    Location
    Rio de Janeiro
    Posts
    13
    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?

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    In order to write your own Metadata Adapter, you can choose among a number of options:

    1. directly implement the MetadataProvider interface
    2. extend the MetadataProviderAdapter class (which implements the MetadataProvider interface)
    3. 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.

  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517

 

 

Similar Threads

  1. Get data specific to each User by passing parameters
    By leonardodar in forum Adapter APIs
    Replies: 3
    Last Post: March 16th, 2011, 09:45 AM
  2. Replies: 2
    Last Post: February 9th, 2010, 02:50 PM
  3. User specific data example
    By zeos in forum Adapter APIs
    Replies: 1
    Last Post: January 28th, 2010, 09:41 AM
  4. General data and User specific data
    By mnenchev in forum Adapter APIs
    Replies: 5
    Last Post: September 1st, 2009, 09:36 AM
  5. User Specific Response
    By vishnugs in forum General
    Replies: 4
    Last Post: April 6th, 2007, 11:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:55 AM.