Interface IMqttServerAuthHandler

  • All Known Implementing Classes:
    DefaultMqttServerAuthHandler
    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 IMqttServerAuthHandler
    mqtt 服务端,认证处理器
    Author:
    L.cm
    • Field Detail

      • logger

        static final org.slf4j.Logger logger
    • Method Detail

      • verifyAuthenticate

        default boolean verifyAuthenticate​(org.tio.core.ChannelContext context,
                                           String uniqueId,
                                           String clientId,
                                           String userName,
                                           String password)
        认证
        Parameters:
        context - ChannelContext
        uniqueId - mqtt 内唯一id,默认和 clientId 相同
        clientId - 客户端 ID
        userName - 用户名
        password - 密码
        Returns:
        是否认证成功
      • authenticate

        boolean authenticate​(org.tio.core.ChannelContext context,
                             String uniqueId,
                             String clientId,
                             String userName,
                             String password)
        认证
        Parameters:
        context - ChannelContext
        uniqueId - mqtt 内唯一id,默认和 clientId 相同
        clientId - 客户端 ID
        userName - 用户名
        password - 密码
        Returns:
        是否认证成功