Class DataProviderEndPoint

  • All Implemented Interfaces:
    org.wso2.msf4j.websocket.WebSocketEndpoint

    public class DataProviderEndPoint
    extends Object
    implements org.wso2.msf4j.websocket.WebSocketEndpoint
    Data provider web socket endpoint.
    • Constructor Detail

      • DataProviderEndPoint

        public DataProviderEndPoint()
    • Method Detail

      • registerDataSourceService

        protected void registerDataSourceService​(org.wso2.carbon.datasource.core.api.DataSourceService service)
      • unregisterDataSourceService

        protected void unregisterDataSourceService​(org.wso2.carbon.datasource.core.api.DataSourceService service)
      • setConfigProvider

        protected void setConfigProvider​(org.wso2.carbon.config.provider.ConfigProvider configProvider)
      • unsetConfigProvider

        protected void unsetConfigProvider​(org.wso2.carbon.config.provider.ConfigProvider configProvider)
      • setDataProviderAuthorizer

        protected void setDataProviderAuthorizer​(DataProviderAuthorizer dataProviderAuthorizer)
      • unsetDataProviderAuthorizer

        protected void unsetDataProviderAuthorizer​(DataProviderAuthorizer dataProviderAuthorizer)
      • setIdpClient

        protected void setIdpClient​(org.wso2.carbon.analytics.idp.client.core.api.IdPClient idpClient)
      • unsetIdpClient

        protected void unsetIdpClient​(org.wso2.carbon.analytics.idp.client.core.api.IdPClient idpClient)
      • onOpen

        public static void onOpen​(org.wso2.transport.http.netty.contract.websocket.WebSocketConnection webSocketConnection,
                                  org.wso2.transport.http.netty.message.HttpCarbonRequest request)
        Handle initiation of the connection map the session object in the session map.
        Parameters:
        webSocketConnection - webSocketConnection object associated with the connection
      • onMessage

        public void onMessage​(String message,
                              org.wso2.transport.http.netty.contract.websocket.WebSocketConnection webSocketConnection)
        Create DataProvider instance, start it and store it in the providerMap.
        Parameters:
        message - String message received from the web client
        webSocketConnection - webSocketConnection object associated with the connection
      • onClose

        public void onClose​(org.wso2.transport.http.netty.contract.websocket.WebSocketConnection webSocketConnection)
        handle disconnection with the client.
        Parameters:
        webSocketConnection - webSocketConnection object associated with the connection
      • onError

        public void onError​(Throwable throwable)
        handle on error.
      • sendText

        public static void sendText​(String sessionId,
                                    String text)
                             throws IOException
        Send message to specific client.
        Parameters:
        sessionId - sessionId of the client.
        text - String message to be sent to the client.
        Throws:
        IOException - If there is a problem delivering the message.