org.cafesip.gwtcomp.server
Interface LiveDataSource

All Known Implementing Classes:
SimpleLiveDataSource

public interface LiveDataSource

This interface must be implemented by the "data source" class that provides data to one or more LiveDataPanel objects for your GWT application. The methods in this class are invoked by the LiveDataServiceImpl servlet during initial data fetch and subsequently when a refresh request is received from the client-side.

Author:
Amit Chatterjee

Method Summary
 void close(Principal user, HttpSession session, LiveDataSessionInfo sessionData)
          This method is invoked by the LiveDataServiceImpl servlet to information the data source that the session is closed.
 ChartInitData getChartInfoAndInitialData(Principal user, HttpSession session, LiveDataSessionInfo sessionData)
          This method is invoked by the LiveDataServiceImpl servlet when the chart is intialized at the client-side.
 ChartData getNextData(Principal user, HttpSession session, LiveDataSessionInfo sessionData)
          This method is invoked by the LiveDataServiceImpl servlet periodically to retrieve data that is used to refresh the live data panel.
 

Method Detail

getChartInfoAndInitialData

ChartInitData getChartInfoAndInitialData(Principal user,
                                         HttpSession session,
                                         LiveDataSessionInfo sessionData)
This method is invoked by the LiveDataServiceImpl servlet when the chart is intialized at the client-side. The method must return a ChartInitData object that specifies the property of the chart and the initial data. The client-side of the application displays the chart and the data accordingly.

Parameters:
user - the user who is displaying the live data panel. The parameter has a null value of the user has not been authenticated by the servlet container.
session - the HTTPSession object is passed so that you application can use session-scope variables to maintain states.
sessionData - Session data.
Returns:
the ChartInitData object

getNextData

ChartData getNextData(Principal user,
                      HttpSession session,
                      LiveDataSessionInfo sessionData)
This method is invoked by the LiveDataServiceImpl servlet periodically to retrieve data that is used to refresh the live data panel. The method returns the ChartData object that contains the data.

Parameters:
user - the user who is displaying the live data panel. The parameter has a null value of the user has not been authenticated by the servlet container.
session - the HTTPSession object is passed so that you application can use session-scope variables to maintain states.
sessionData - Information on the session.
Returns:
the chart data

close

void close(Principal user,
           HttpSession session,
           LiveDataSessionInfo sessionData)
This method is invoked by the LiveDataServiceImpl servlet to information the data source that the session is closed. This gives the application a chance to perform cleanup.

Parameters:
user - the user who is displaying the live data panel. The parameter has a null value of the user has not been authenticated by the servlet container.
session - the HTTPSession object is passed so that you application can use session-scope variables to maintain states.
sessionData - Information on the session.


Copyright © 2010 Cafesip.org. All Rights Reserved.