Interface Callback


public interface Callback
This interface provides the call back function used in Mdf.consume().
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Defines the various connection states
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This function is automatically called by the consume() function of Mdf class if the setConsumeDataCallback() method have been used to register a consumeData callback.
    void
    This function is automatically called by the consume() function of Mdf class when the current connection status changes and if the setStatusChangeCallback() method have been used to register a statusChange callback.
  • Method Details

    • consumeData

      void consumeData(Mdf mdf)
      This function is automatically called by the consume() function of Mdf class if the setConsumeDataCallback() method have been used to register a consumeData callback.
      Parameters:
      mdf - Mdf object that receives data from the mdf server
    • statusChange

      void statusChange(Callback.StatusCode status, String host, String ip)
      This function is automatically called by the consume() function of Mdf class when the current connection status changes and if the setStatusChangeCallback() method have been used to register a statusChange callback.
      Parameters:
      status - the new connection status
      host - the server host name we are connecting / trying to connect to. For RCV_HB_RES the string contains the nanoseconds epoch timestamp of when the API received the heartbeat.
      ip - the ip address of the host if available (can be null if not translated yet). For RCV_HB_RES the string contains the nanoseconds epoch timestamp of when the server sent the heartbeat.