use of org.springframework.data.redis.connection.RedisNode in project cas by apereo.
the class RedisObjectFactory method createRedisNodesForProperties.
private List<RedisNode> createRedisNodesForProperties(final BaseRedisProperties redis) {
final List<RedisNode> redisNodes = new ArrayList<RedisNode>();
if (redis.getSentinel().getNode() != null) {
final List<String> nodes = redis.getSentinel().getNode();
for (final String hostAndPort : nodes) {
final String[] args = StringUtils.split(hostAndPort, ":");
redisNodes.add(new RedisNode(args[0], Integer.parseInt(args[1])));
}
}
return redisNodes;
}
use of org.springframework.data.redis.connection.RedisNode in project thingsboard by thingsboard.
the class TBRedisClusterConfiguration method getNodes.
private List<RedisNode> getNodes(String nodes) {
List<RedisNode> result;
if (StringUtils.isBlank(nodes)) {
result = Collections.emptyList();
} else {
result = new ArrayList<>();
for (String hostPort : nodes.split(COMMA)) {
String host = hostPort.split(COLON)[0];
Integer port = Integer.valueOf(hostPort.split(COLON)[1]);
result.add(new RedisNode(host, port));
}
}
return result;
}
use of org.springframework.data.redis.connection.RedisNode in project incubator-shenyu by apache.
the class RateLimiterPluginDataHandler method createRedisNode.
private List<RedisNode> createRedisNode(final String url) {
List<RedisNode> redisNodes = new ArrayList<>();
List<String> nodes = Lists.newArrayList(Splitter.on(";").split(url));
for (String node : nodes) {
String[] parts = StringUtils.split(node, ":");
Assert.state(Objects.requireNonNull(parts).length == 2, "Must be defined as 'host:port'");
redisNodes.add(new RedisNode(parts[0], Integer.parseInt(parts[1])));
}
return redisNodes;
}
Aggregations