Interface InterceptHandler

  • All Known Implementing Classes:
    AbstractInterceptHandler

    public interface InterceptHandler
    This interface is used to inject code for intercepting broker events.

    The events can act only as observers.

    Almost every method receives a subclass of MqttMessage, except onDisconnect that receives the client id string and onSubscribe and onUnsubscribe that receive a Subscription object.

    • Field Detail

      • ALL_MESSAGE_TYPES

        static final Class<?>[] ALL_MESSAGE_TYPES
    • Method Detail

      • getID

        String getID()
        Returns:
        the identifier of this intercept handler.
      • getInterceptedMessageTypes

        Class<?>[] getInterceptedMessageTypes()
        Returns:
        the InterceptMessage subtypes that this handler can process. If the result is null or equal to ALL_MESSAGE_TYPES, all the message types will be processed.
      • onPublish

        void onPublish​(InterceptPublishMessage msg)
        Called when a message is published. The receiver MUST release the payload of the message, either by calling super.onPublish, or by calling msg.getPayload.release() directly.
        Parameters:
        msg - The message that was published.