Interface Subscription

    • Method Detail

      • getKey

        Subscription.Key getKey()
        Gets the key to identify a subscription in the list of (same-type) subscriptions of an MQTT Endpoint.
        Returns:
        The key.
      • getTenant

        String getTenant()
        Gets the tenant from topic or authentication.
        Returns:
        The tenant (never null).
      • getDeviceId

        String getDeviceId()
        Gets the device id from topic or authentication.
        Returns:
        The device id (never null).
      • getAuthenticatedDeviceId

        String getAuthenticatedDeviceId()
        Gets the device id from authentication.
        Returns:
        The device id or null.
      • getEndpoint

        String getEndpoint()
        Gets the endpoint of the subscription.
        Returns:
        The endpoint.
      • getQos

        io.netty.handler.codec.mqtt.MqttQoS getQos()
        Gets the QoS of the subscription.
        Returns:
        The QoS value.
      • getTopic

        String getTopic()
        Gets the subscription topic.
        Returns:
        The topic.
      • isAuthenticated

        boolean isAuthenticated()
        Gets the authentication status, which indicates the need to publish on tenant/device-id for unauthenticated devices.
        Returns:
        true if created with an authenticated device.
      • isGatewaySubscriptionForSpecificDevice

        boolean isGatewaySubscriptionForSpecificDevice()
        Checks whether this subscription represents the case of a gateway subscribing for a specific device that it acts on behalf of.
        Returns:
        true if a gateway is subscribing for a specific device.
      • containsTenantId

        boolean containsTenantId()
        Checks if the topic contains a tenant identifier.
        Returns:
        true if the topic contains a tenant id.
      • containsDeviceId

        boolean containsDeviceId()
        Checks if the topic contains a device identifier.
        Returns:
        true if the topic contains a device id.
      • logSubscribeSuccess

        void logSubscribeSuccess​(io.opentracing.Span span)
        Logs a successful subscription attempt to the given span.
        Parameters:
        span - The span to log to.
        Throws:
        NullPointerException - if span is null.
      • logSubscribeFailure

        void logSubscribeFailure​(io.opentracing.Span span,
                                 Throwable error)
        Logs a failed subscription attempt to the given span.
        Parameters:
        span - The span to log to.
        error - The error to log.
        Throws:
        NullPointerException - if span or error is null.
      • logUnsubscribe

        void logUnsubscribe​(io.opentracing.Span span)
        Logs the unsubscription to the given span.
        Parameters:
        span - The span to log to.
        Throws:
        NullPointerException - if span is null.