com.ibm.wiotp.sdk.gateway

Interface GatewayCallback<T>



  • public interface GatewayCallback<T>

    A callback interface that needs to be implemented by the Gateway to handle the commands or notifications from IBM Watson IoT Platform.

    Gateway can subscribe to commands directed at the gateway itself and to any device connected via the gateway. To process specific commands, the Gateway needs to register a command callback method. Once the Command callback is added to the GatewayClient, the processCommand(com.ibm.wiotp.sdk.gateway.Command) method is invoked whenever any command is published on the subscribed criteria.

    • Method Detail

      • processCommand

        void processCommand(Command<T> cmd)
        Method to be called by the GatewayClient when any command is published on the subscribed criteria.
        Parameters:
        cmd - an instance of Command.
      • processNotification

        void processNotification(Notification notification)

        If a gateways subscribes to a topic of a device or sends data on behalf of a device where the gateway does not have permission for, the message or the subscription is being ignored. This behavior is different compared to applications where the connection will be terminated. The Gateway will be notified on the notification topic:.

        • iot-2/type/+/id/+/notify
        Parameters:
        notification - Notification from the Watson IoT Platform that needs to be processed.

Copyright © 2019. All rights reserved.