当前位置: 首页>>代码示例>>Java>>正文


Java ClientCredentialsData类代码示例

本文整理汇总了Java中com.hivemq.spi.security.ClientCredentialsData的典型用法代码示例。如果您正苦于以下问题:Java ClientCredentialsData类的具体用法?Java ClientCredentialsData怎么用?Java ClientCredentialsData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClientCredentialsData类属于com.hivemq.spi.security包,在下文中一共展示了ClientCredentialsData类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCredentials

import com.hivemq.spi.security.ClientCredentialsData; //导入依赖的package包/类
@Override
public Boolean checkCredentials(final ClientCredentialsData clientData) throws AuthenticationException {
    if (clientData.getUsername().isPresent() && clientData.getPassword().isPresent()) {
        //You probably want to use caching here. You can either implement it your own,
        //use a caching framework or use the HiveMQ @Cached annotation on this method
        return lookupInDB(clientData);
    }
    return false;
}
 
开发者ID:hivemq,项目名称:hivemq-database-example-plugin,代码行数:10,代码来源:DBAuthenticationCallback.java

示例2: checkCredentials

import com.hivemq.spi.security.ClientCredentialsData; //导入依赖的package包/类
/**
 * Method which checks username/password from credential file against the provided username/password using a cache
 *
 * @param clientCredentialsData holds all data about the connecting client
 * @return true, if the credentials are ok, false otherwise.
 */
@Override
public Boolean checkCredentials(final ClientCredentialsData clientCredentialsData) {
    try {
        return this.cache.get(new ClientCredentialWrapper(clientCredentialsData));
    } catch (ExecutionException e) {
        log.error("Unable to load from Cache", e);
        return false;
    }
}
 
开发者ID:hivemq,项目名称:file-auth-plugin,代码行数:16,代码来源:FileAuthenticator.java

示例3: ClientCredentialWrapper

import com.hivemq.spi.security.ClientCredentialsData; //导入依赖的package包/类
private ClientCredentialWrapper(ClientCredentialsData clientCredentialsData) {
    inetAddress = clientCredentialsData.getInetAddress();
    password = clientCredentialsData.getPassword();
    clientId = clientCredentialsData.getClientId();
    username = clientCredentialsData.getUsername();
}
 
开发者ID:hivemq,项目名称:file-auth-plugin,代码行数:7,代码来源:FileAuthenticator.java

示例4: checkCredentials

import com.hivemq.spi.security.ClientCredentialsData; //导入依赖的package包/类
/**
 * Checks the credentials after a CONNECT message arrives.
 * <p/>
 * return <code>true</code> when the authentication with the credentials was successful, <code>false</code> otherwise
 *
 * @param clientData the client credentials
 * @return <code>true</code> when the authentication was successful
 * @throws AuthenticationException when you want the client to disconnect immediately with a given return code
 */
Boolean checkCredentials(ClientCredentialsData clientData) throws AuthenticationException;
 
开发者ID:hivemq,项目名称:hivemq-spi,代码行数:11,代码来源:OnAuthenticationCallback.java


注:本文中的com.hivemq.spi.security.ClientCredentialsData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。