Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    2

    User Specific Response

    Hi Guys,

    In the first place, my congratulations for giving us access to the bleeding edge of technologies with your framework.

    We are planning to use LightstreamerPush for a messaging kind of application. So there will be many connected users and every user will have the option of sending data to other online users. The client application will be mostly in PHP along with Dojo. Will use PHPMQ to communicate to Push Server adapter.

    So my understanding so far on pieces of code we should be implementing (pls correct me if I am wrong) -

    DataProvider - The implementation that will manage all users and receive their messages.
    JMSAdapter - The implementation that will receive messages over JMS for DataProvider
    MetaDataProvider - The implementation that will use the username, password info in getItems function to provide user specific handling.

    My doubt with MetaDataProvider, I saw both your implementations, basically getItems
    is called only once when loading the dataprovider for the user and not every time the data is sent to the user.

    How do I implement user specific behavior, basically I need to push messages to him only when it is intended for him. Stating it differently, I need to receive all messages and see if a user has subscribed for the particular username, if so I need to push the message to him. In which function and class should I keep the code for this functionality.

    Thanks in advance,

    Vishnu

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,
    Some clarifications are needed:

    DataProvider - The implementation that will manage all the updates both for common items and user-specific items.
    MetaDataProvider - The implementation that will use the username, password info in getItems function to provide user specific handling customizing general item names to user-specific ones.
    JMSAdapter - Just a specific DataProvider implementation used as example in our distribution that receives messages over JMS.

    You can take a look to the javadocs of MetadataProvider and DataProvider, to the "General Concept.pdf" file (find it under the DOCS-SDKs folder of the distribution) and to the User-specific push thread for further clarifications.

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

    Thanks for using Lightstreamer.

    The easiest way to achieve your required behavior is that each user subscribes to a unique itemname (perhaps bound to his username). Then, when another user posts a message for him, the Data Adapter will publish such message as an update to that specific itemname. You can deliver the messages to your Data Adapter in a couple of ways:
    - by using the sendMessage function (that delivers the message to the Metadata Adapter, that in turns can send it to the Data Adapter)
    - by sending the message to an external server-side component (e.g. PHP page, servlet, etc.) that in turns sends the message to the Data Adapter (through JMS, sockets, db, etc.). You can see an example in the Portfolio Demo code (http://www.lightstreamer.com/portfolioDemo.htm).

    Cheers

  4. #4
    Member
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    2

    Thanks

    Hi Friends,

    Thanks a lot for your support. I m now able to understand the architecture.

    For my case, I just pass the name of the user to the adapter (to which it is subscribed). The server manages sending it only to him.

    I have two more questions -

    1) I tried modifying the engine creation to include username/password as follows
    engineRef.context.setDebugAlertsOnClientError(debu gAlerts);
    engineRef.context.setRemoteAlertsOnClientError(tru e);
    engineRef.connection.setUserName("cookie");
    engineRef.connection.setPassword("password");
    engineRef.connection.setLSHost(host);
    engineRef.connection.setLSPort(port);
    engineRef.connection.setAdapterName("STOCKLISTJMSD EMO");
    engineRef.changeStatus("STREAMING");
    but I always get null for username argument in the following functions
    LiteralBasedProvider::getItems
    LiteralBasedProvider::getSchema
    and username/password is null in the following function
    LiteralBasedProvider::notifyUser

    Am I going wrong somewhere?

    2) Is there any other way of creating a client implementation to subscribe and receive messages from the server without using NonVisualTable control?

    Thanks,

    Vishnu

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Hi Vishnu

    The username argument is supposed not to be passed as null in this case.
    Is it possible that the Engine is already streaming when "setUserName" is called?
    Are you using "createEngine" or the old "loadEngine" in order to load the Engine?
    May you please check Lightstreamer Server log? You should be able to find your username logged.

    I Assume that, in your second question, you are looking for an alternative to using "NonVisualTable" still in the context of an HTML front-end. Then the answer is no; subscribing to items is only made through the definition of a table object.
    Other types of table objects do exist, as listed in the Javascript API JSDocs: they all are "visual tables" and can be used in order to take advantage of Lightstreamer-provided management of the visualization of the data in the table cells.

    Dario

 

 

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, 10:45 AM
  2. User specific data example
    By zeos in forum Adapter APIs
    Replies: 1
    Last Post: January 28th, 2010, 10:41 AM
  3. General data and User specific data
    By mnenchev in forum Adapter APIs
    Replies: 5
    Last Post: September 1st, 2009, 10:36 AM
  4. Request-Response APIs
    By sundaramlaxman in forum Client APIs
    Replies: 4
    Last Post: February 21st, 2007, 03:11 PM
  5. User-specific push
    By rmusco in forum General
    Replies: 8
    Last Post: February 2nd, 2007, 06:29 PM

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:57 AM.