+ add expireAt on RedisConnection

This commit is contained in:
Costin Leau
2010-11-30 20:44:44 +02:00
parent cbc061cf4e
commit a20fabd7f3
3 changed files with 24 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ public interface RedisCommands extends RedisTxCommands, RedisStringCommands, Red
Boolean expire(byte[] key, int seconds);
Boolean expireAt(byte[] key, long unixTime);
Boolean persist(byte[] key);
Integer ttl(byte[] key);

View File

@@ -190,6 +190,19 @@ public class JedisConnection implements RedisConnection {
}
}
@Override
public Boolean expireAt(byte[] key, long unixTime) {
try {
if (isQueueing()) {
transaction.expireAt(key, unixTime);
return null;
}
return (jedis.expireAt(key, unixTime) == 1);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
@Override
public Collection<byte[]> keys(byte[] pattern) {
try {

View File

@@ -134,6 +134,15 @@ public class JredisConnection implements RedisConnection {
}
}
@Override
public Boolean expireAt(byte[] key, long unixTime) {
try {
return jredis.expireat(JredisUtils.convert(charset, key), unixTime);
} catch (RedisException ex) {
throw JredisUtils.convertJredisAccessException(ex);
}
}
@Override
public Collection<byte[]> keys(byte[] pattern) {
try {