Java Code Examples for org.springframework.data.redis.connection.RedisConnection#getConfig()

The following examples show how to use org.springframework.data.redis.connection.RedisConnection#getConfig() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigureNotifyKeyspaceEventsAction.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
private String getNotifyOptions(RedisConnection connection) {
    try {
        Properties config = connection.getConfig(CONFIG_NOTIFY_KEYSPACE_EVENTS);
        if (config.isEmpty()) {
            return "";
        }
        return config.getProperty(config.stringPropertyNames().iterator().next());
    } catch (InvalidDataAccessApiUsageException e) {
        throw new IllegalStateException(
            "Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedevent",
            e);
    }
}
 
Example 2
Source File: ConfigureNotifyKeyspaceEventsAction.java    From J2Cache with Apache License 2.0 5 votes vote down vote up
private String getNotifyOptions(RedisConnection connection) {
	try {
		List<String> config = connection.getConfig(CONFIG_NOTIFY_KEYSPACE_EVENTS);
		if (config.size() < 2) {
			return "";
		}
		return config.get(1);
	}
	catch (InvalidDataAccessApiUsageException e) {
		throw new IllegalStateException(
				"Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedevent",
				e);
	}
}
 
Example 3
Source File: ConfigureNotifyKeyspaceEventsAction.java    From J2Cache with Apache License 2.0 5 votes vote down vote up
private String getNotifyOptions(RedisConnection connection) {
	try {
		Properties config = connection.getConfig(CONFIG_NOTIFY_KEYSPACE_EVENTS);
		if (config.isEmpty()) {
			return "";
		}
		return config.getProperty(config.stringPropertyNames().iterator().next());
	}
	catch (InvalidDataAccessApiUsageException e) {
		throw new IllegalStateException(
				"Unable to configure Redis to keyspace notifications. See http://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisoperationssessionrepository-sessiondestroyedevent",
				e);
	}
}
 
Example 4
Source File: ConfigureNotifyKeyspaceEventsAction.java    From spring-session with Apache License 2.0 5 votes vote down vote up
private String getNotifyOptions(RedisConnection connection) {
	try {
		Properties config = connection.getConfig(CONFIG_NOTIFY_KEYSPACE_EVENTS);
		if (config.isEmpty()) {
			return "";
		}
		return config.getProperty(config.stringPropertyNames().iterator().next());
	}
	catch (InvalidDataAccessApiUsageException ex) {
		throw new IllegalStateException(
				"Unable to configure Redis to keyspace notifications. See https://docs.spring.io/spring-session/docs/current/reference/html5/#api-redisindexedsessionrepository-sessiondestroyedevent",
				ex);
	}
}