org.idevlab.rjc
Interface Session

All Superinterfaces:
RedisOperations, SingleRedisOperations

public interface Session
extends SingleRedisOperations

Author:
Evgeny Dolgov

Method Summary
 void close()
           
 String discard()
          Flushes all previously queued commands in a transaction and restores the connection state to normal.
 List<Object> exec()
          Executes all previously queued commands in a transaction and restores the connection state to normal.
 String multi()
          Marks the start of a transaction block.
 String select(int index)
           
 String unwatch()
          O(1).
 String watch(String... keys)
          O(1) for every keys.
 
Methods inherited from interface org.idevlab.rjc.SingleRedisOperations
auth, bgrewriteaof, bgsave, blpop, brpop, brpoplpush, configGet, configSet, dbSize, debug, echo, flushAll, flushDB, info, lastsave, mget, monitor, move, mset, msetnx, ping, pipeline, quit, randomKey, rename, renamenx, rpoplpush, save, sdiff, sdiffstore, shutdown, sinter, sinterstore, slaveof, slaveofNoOne, smove, sort, sort, sunion, sunionstore, sync, zinterstore, zinterstore, zunionstore, zunionstore
 
Methods inherited from interface org.idevlab.rjc.RedisOperations
append, decr, decrBy, del, exists, expire, expireAt, get, getBit, getRange, getSet, hdel, hexists, hget, hgetAll, hincrBy, hkeys, hlen, hmget, hmset, hset, hsetnx, hvals, incr, incrBy, keys, lindex, linsert, llen, lpop, lpush, lpushx, lrange, lrem, lset, ltrim, persist, publish, rpop, rpush, rpushx, sadd, scard, set, setBit, setex, setnx, setRange, sismember, smembers, sort, sort, spop, srandmember, srem, strlen, ttl, type, zadd, zcard, zcount, zincrby, zrange, zrangeByScore, zrangeByScore, zrangeByScoreWithScores, zrangeByScoreWithScores, zrangeWithScores, zrank, zrem, zremrangeByRank, zremrangeByScore, zrevrange, zrevrangeByScore, zrevrangeByScore, zrevrangeByScoreWithScores, zrevrangeByScoreWithScores, zrevrangeWithScores, zrevrank, zscore
 

Method Detail

select

String select(int index)

multi

String multi()
Marks the start of a transaction block. Subsequent commands will be queued for atomic execution using EXEC.

Returns:
always OK

discard

String discard()
Flushes all previously queued commands in a transaction and restores the connection state to normal.

If WATCH was used, DISCARD unwatches all keys.

Returns:
always OK

watch

String watch(String... keys)
O(1) for every keys.

Marks the given keys to be watched for conditional execution of a transaction.

Parameters:
keys - keys to be watched
Returns:
always OK.
Since:
2.1.0

unwatch

String unwatch()
O(1).

Flushes all the previously watched keys for a transaction.

If you call EXEC or DISCARD, there's no need to manually call UNWATCH.

Returns:
always OK.
Since:
2.1.0

exec

List<Object> exec()
Executes all previously queued commands in a transaction and restores the connection state to normal.

When using WATCH, EXEC will execute commands only if the watched keys were not modified, allowing for a check-and-set mechanism.

Returns:
each element being the reply to each of the commands in the atomic transaction.

When using WATCH, EXEC can return a Null multi-bulk reply if the execution was aborted.


close

void close()


Copyright © 2011. All Rights Reserved.