Class RTTService

java.lang.Object
com.bitheads.braincloud.services.RTTService

public class RTTService
extends Object
  • Constructor Details

  • Method Details

    • enableRTT

      public void enableRTT​(IRTTConnectCallback callback, boolean useWebSocket)
      Enables Real Time event for this session. Real Time events are disabled by default. Usually events need to be polled using GET_EVENTS. By enabling this, events will be received instantly when they happen through a TCP connection to an Event Server. This function will first call requestClientConnection, then connect to the address
      Parameters:
      callback - The callback.
      useWebSocket - Use web sockets instead of TCP for the internal connections. Default is true
    • enableRTT

      public void enableRTT​(IRTTConnectCallback callback)
    • disableRTT

      public void disableRTT()
      Disables Real Time event for this session.
    • getRTTEnabled

      public boolean getRTTEnabled()
      Returns true is RTT is enabled
      Returns:
      True if RTT is enabled
    • getConnectionStatus

      public RTTComms.RttConnectionStatus getConnectionStatus()
      Returns RTT connection status
      Returns:
      RTT connection status
    • getRTTConnectionId

      public String getRTTConnectionId()
      Returns RTT connectionId
      Returns:
      RTT connectionId
    • registerRTTEventCallback

      public void registerRTTEventCallback​(IRTTCallback callback)
      Listen to real time events. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one event callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTEventCallback

      public void deregisterRTTEventCallback()
      Deregisters the RTT Event callback.
    • registerRTTChatCallback

      public void registerRTTChatCallback​(IRTTCallback callback)
      Listen to real time chat messages. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one chat callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTChatCallback

      public void deregisterRTTChatCallback()
      Deregisters the RTT Chat callback.
    • registerRTTMessagingCallback

      public void registerRTTMessagingCallback​(IRTTCallback callback)
      Listen to real time messaging. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one messaging callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTMessagingCallback

      public void deregisterRTTMessagingCallback()
      Deregisters the RTT Messaging callback.
    • registerRTTLobbyCallback

      public void registerRTTLobbyCallback​(IRTTCallback callback)
      Listen to real time lobby events. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one lobby callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTLobbyCallback

      public void deregisterRTTLobbyCallback()
      Deregisters the RTT Lobby callback.
    • registerRTTPresenceCallback

      public void registerRTTPresenceCallback​(IRTTCallback callback)
      Listen to real time presence events. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one presence callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTPresenceCallback

      public void deregisterRTTPresenceCallback()
      Deregisters the RTT Presence callback.
    • registerRTTBlockchainRefreshCallback

      public void registerRTTBlockchainRefreshCallback​(IRTTCallback callback)
      Listen to real time blockchain events. Notes: RTT must be enabled for this app, and enableRTT must have been successfully called. Only one presence callback can be registered at a time. Calling this a second time will override the previous callback.
      Parameters:
      callback - The callback handler
    • deregisterRTTBlockchainRefreshCallback

      public void deregisterRTTBlockchainRefreshCallback()
      Deregisters the blockchain callback.
    • deregisterAllCallbacks

      public void deregisterAllCallbacks()
      Clear all set RTT callbacks
    • requestClientConnection

      public void requestClientConnection​(IServerCallback callback)
      Requests the event server address
      Parameters:
      callback - The callback.