本文整理汇总了Java中com.lambdaworks.redis.RedisURI.getPassword方法的典型用法代码示例。如果您正苦于以下问题:Java RedisURI.getPassword方法的具体用法?Java RedisURI.getPassword怎么用?Java RedisURI.getPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lambdaworks.redis.RedisURI
的用法示例。
在下文中一共展示了RedisURI.getPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RedisMasterSlaveNode
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
RedisMasterSlaveNode(String host, int port, RedisURI seed, Role role) {
RedisURI.Builder builder = RedisURI.Builder
.redis(host, port)
.withSsl(seed.isSsl())
.withVerifyPeer(seed.isVerifyPeer())
.withStartTls(seed.isStartTls());
if (seed.getPassword() != null && seed.getPassword().length != 0) {
builder.withPassword(new String(seed.getPassword()));
}
if (seed.getClientName() != null) {
builder.withClientName(seed.getClientName());
}
builder.withDatabase(seed.getDatabase());
this.redisURI = builder.build();
this.role = role;
}
示例2: addPasswordIfNeeded
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
private void addPasswordIfNeeded(List<RedisNodeDescription> nodes, RedisURI seed) {
if (seed.getPassword() != null && seed.getPassword().length != 0) {
for (RedisNodeDescription node : nodes) {
node.getUri().setPassword(new String(seed.getPassword()));
}
}
}
示例3: applyUriConnectionSettings
import com.lambdaworks.redis.RedisURI; //导入方法依赖的package包/类
/**
* Apply {@link RedisURI} settings such as SSL/Timeout/password.
*
* @param from from {@link RedisURI}.
* @param to from {@link RedisURI}.
*/
static void applyUriConnectionSettings(RedisURI from, RedisURI to) {
if (from.getPassword() != null && from.getPassword().length != 0) {
to.setPassword(new String(from.getPassword()));
}
to.setTimeout(from.getTimeout());
to.setUnit(from.getUnit());
to.setSsl(from.isSsl());
to.setStartTls(from.isStartTls());
to.setVerifyPeer(from.isVerifyPeer());
}