@Override public CommandAsyncExecutor enableRedissonReferenceSupport(RedissonClient redisson) { if (redisson != null) { this.redisson = redisson; enableRedissonReferenceSupport(redisson.getConfig()); this.redissonReactive = null; this.redissonRx = null; } return this; }
@Override public CommandAsyncExecutor enableRedissonReferenceSupport(RedissonClient redisson) { if (redisson != null) { this.redisson = redisson; enableRedissonReferenceSupport(redisson.getConfig()); this.redissonReactive = null; this.redissonRx = null; } return this; }
public RMap<String, Object> getMap(String sessionId) { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; String name = keyPrefix + separator + "redisson:tomcat_session:" + sessionId; return redisson.getMap(name, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); }
public RMap<String, Object> getMap(String sessionId) { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; String name = keyPrefix + separator + "redisson:tomcat_session:" + sessionId; return redisson.getMap(name, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); }
public RMap<String, Object> getMap(String sessionId) { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; String name = keyPrefix + separator + "redisson:tomcat_session:" + sessionId; return redisson.getMap(name, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); }
public RMap<String, Object> getMap(String sessionId) { String separator = keyPrefix == null || keyPrefix.isEmpty() ? "" : ":"; String name = keyPrefix + separator + "redisson:tomcat_session:" + sessionId; return redisson.getMap(name, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); }
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
public RedissonSession(String keyPrefix, String sessionId) { this.delegate = new MapSession(sessionId); map = redisson.getMap(keyPrefix + sessionId, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); principalName = resolvePrincipal(delegate); }
public RedissonSession(String keyPrefix, String sessionId) { this.delegate = new MapSession(sessionId); map = redisson.getMap(keyPrefix + sessionId, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); principalName = resolvePrincipal(delegate); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
public RedissonSession(String keyPrefix) { this.delegate = new MapSession(); map = redisson.getMap(keyPrefix + delegate.getId(), new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); principalName = resolvePrincipal(delegate); Map<String, Object> newMap = new HashMap<String, Object>(3); newMap.put("session:creationTime", delegate.getCreationTime()); newMap.put("session:lastAccessedTime", delegate.getLastAccessedTime()); newMap.put("session:maxInactiveInterval", delegate.getMaxInactiveIntervalInSeconds()); map.putAll(newMap); updateExpiration(); String channelName = getEventsChannelName(delegate.getId()); RTopic topic = redisson.getTopic(channelName, StringCodec.INSTANCE); topic.publish(delegate.getId()); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
public RedissonSession(String keyPrefix) { this.delegate = new MapSession(); map = redisson.getMap(keyPrefix + delegate.getId(), new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); principalName = resolvePrincipal(delegate); Map<String, Object> newMap = new HashMap<String, Object>(3); newMap.put("session:creationTime", delegate.getCreationTime()); newMap.put("session:lastAccessedTime", delegate.getLastAccessedTime()); newMap.put("session:maxInactiveInterval", delegate.getMaxInactiveIntervalInSeconds()); map.putAll(newMap); updateExpiration(); String channelName = getEventsChannelName(delegate.getId()); RTopic topic = redisson.getTopic(channelName, StringCodec.INSTANCE); topic.publish(delegate.getId()); }
@SneakyThrows public RedisClient(@NonNull RedissonClient redisson, int expiryInSeconds) { log.trace("RedisClient created. config={}, expiryInSeconds={}", redisson.getConfig().toJSON(), expiryInSeconds); this.redisson = redisson; if (expiryInSeconds >= 0) { this.expiryInSeconds = expiryInSeconds; } }
@SneakyThrows public RedisClient(@NonNull RedissonClient redisson, int expiryInSeconds) { log.trace("RedisClient created. config={}, expiryInSeconds={}", redisson.getConfig().toJSON(), expiryInSeconds); this.redisson = redisson; if (expiryInSeconds >= 0) { this.expiryInSeconds = expiryInSeconds; } }
public RedissonSession(String sessionId) { this.delegate = new MapSession(sessionId); map = redisson.getMap(keyPrefix + sessionId, new CompositeCodec(StringCodec.INSTANCE, redisson.getConfig().getCodec())); principalName = resolvePrincipal(delegate); }