Interface AuthorizerProvider

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface AuthorizerProvider
    The authorizer provider allows to implement custom logic for the authorization for specific actions (i.e subscribing, publishing etc.) of MQTT clients. For each client an Authorizer for the specific action can be provided that contains the authorization logic.
    Since:
    4.0.0, CE 2019.1
    • Method Detail

      • getAuthorizer

        @Nullable Authorizer getAuthorizer​(@NotNull AuthorizerProviderInput authorizerProviderInput)
        This method is called for each client by HiveMQ.

        Either the same Authorizer (stateless or must be thread-safe) or a new one (stateful, must not be thread-safe) can be supplied on each call.

        null can be returned if no authorization for the client is necessary.

        Returns:
        Either an implementation of SubscriptionAuthorizer or an implementation of PublishAuthorizer. null is ignored and has the same effect as if this provider would had not been set for the connecting client. Returning any other implementation of the Authorizer interface is an error.
        Since:
        4.0.0, CE 2019.1