All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.leopard.web.session.StoreRedisImpl Maven / Gradle / Ivy

Go to download

分布式session实现。基于Leopard Memcache接口实现,目前Leopard已实现基于Memcached、Redis两种实现。

There is a newer version: 0.9.12
Show newest version
package io.leopard.web.session;

import io.leopard.redis.Redis;

public class StoreRedisImpl implements IStore {

	private static Redis redis;

	public static void setRedis(Redis redis) {
		 StoreRedisImpl.redis = redis;
	}

	@Override
	public boolean isEnable() {
		return redis != null;
	}

	@Override
	public String get(String key) {
		// System.err.println("StoreRedisImpl get:" + key);
		return redis.get(key);
	}

	@Override
	public String set(String key, String value, int seconds) {
		return redis.set(key, value, seconds);
	}

	@Override
	public Long del(String key) {
		return redis.del(key);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy