Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.data.redis.connection
Interface RedisConnection

All Superinterfaces:
  RedisCommands, RedisConnectionCommands, RedisHashCommands, RedisKeyCommands, RedisListCommands, RedisPubSubCommands, RedisScriptingCommands, RedisServerCommands, RedisSetCommands, RedisStringCommands, RedisTxCommands, RedisZSetCommands

All Known Subinterfaces:
  StringRedisConnection

All Known Implementing Classes:
  DefaultStringRedisConnection, JedisConnection, JredisConnection, LettuceConnection, SrpConnection

    public interface RedisConnection

extends RedisCommands

A connection to a Redis server. Acts as an common abstraction across various Redis client libraries (or drivers). Additionally performs exception translation between the underlying Redis client library and Spring DAO exceptions. The methods follow as much as possible the Redis names and conventions.

Nested Class Summary

Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
`RedisStringCommands.BitOperation`

Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
`RedisListCommands.Position`

Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
`RedisZSetCommands.Aggregate, RedisZSetCommands.Tuple`

Method Summary
`void` | `close()` Closes (or quits) the connection.
`List<Object>` | `closePipeline()` Executes the commands in the pipeline and returns their result.
`Object` | `getNativeConnection()` Returns the native connection (the underlying library/driver object).
`boolean` | `isClosed()` Indicates whether the underlying connection is closed or not.
`boolean` | `isPipelined()` Indicates whether the connection is currently pipelined or not.
`boolean` | `isQueueing()` Indicates whether the connection is in "queue"(or "MULTI") mode or not.
`void` | `openPipeline()` Activates the pipeline mode for this connection.

Methods inherited from interface org.springframework.data.redis.connection.RedisCommands
`execute`

Methods inherited from interface org.springframework.data.redis.connection.RedisKeyCommands
`del, dump, exists, expire, expireAt, keys, move, persist, pExpire, pExpireAt, pTtl, randomKey, rename, renameNX, restore, sort, sort, ttl, type`

Methods inherited from interface org.springframework.data.redis.connection.RedisStringCommands
`append, bitCount, bitCount, bitOp, decr, decrBy, get, getBit, getRange, getSet, incr, incrBy, incrBy, mGet, mSet, mSetNX, set, setBit, setEx, setNX, setRange, strLen`

Methods inherited from interface org.springframework.data.redis.connection.RedisListCommands
`bLPop, bRPop, bRPopLPush, lIndex, lInsert, lLen, lPop, lPush, lPushX, lRange, lRem, lSet, lTrim, rPop, rPopLPush, rPush, rPushX`

Methods inherited from interface org.springframework.data.redis.connection.RedisSetCommands
`sAdd, sCard, sDiff, sDiffStore, sInter, sInterStore, sIsMember, sMembers, sMove, sPop, sRandMember, sRandMember, sRem, sUnion, sUnionStore`

Methods inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
`zAdd, zAdd, zCard, zCount, zIncrBy, zInterStore, zInterStore, zRange, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByScore, zRevRange, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScore, zUnionStore, zUnionStore`

Methods inherited from interface org.springframework.data.redis.connection.RedisHashCommands
`hDel, hExists, hGet, hGetAll, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hSet, hSetNX, hVals`

Methods inherited from interface org.springframework.data.redis.connection.RedisTxCommands
`discard, exec, multi, unwatch, watch`

Methods inherited from interface org.springframework.data.redis.connection.RedisPubSubCommands
`getSubscription, isSubscribed, pSubscribe, publish, subscribe`

Methods inherited from interface org.springframework.data.redis.connection.RedisConnectionCommands
`echo, ping, select`

Methods inherited from interface org.springframework.data.redis.connection.RedisServerCommands
`bgSave, bgWriteAof, dbSize, flushAll, flushDb, getConfig, info, info, lastSave, resetConfigStats, save, setConfig, shutdown`

Methods inherited from interface org.springframework.data.redis.connection.RedisScriptingCommands
`eval, evalSha, scriptExists, scriptFlush, scriptKill, scriptLoad`

Method Detail

### close

    void close()
               throws DataAccessException

  Closes (or quits) the connection.

  Throws:
    `DataAccessException`

### isClosed

    boolean isClosed()

  Indicates whether the underlying connection is closed or not.

  Returns:
    true if the connection is closed, false otherwise.

### getNativeConnection

    Object getNativeConnection()

  Returns the native connection (the underlying library/driver object).

  Returns:
    underlying, native object

### isQueueing

    boolean isQueueing()

  Indicates whether the connection is in "queue"(or "MULTI") mode or not. When queueing, all commands are postponed until EXEC or DISCARD commands are issued. Since in queueing no results are returned, the connection will return NULL on all operations that interact with the data.

  Returns:
    true if the connection is in queue/MULTI mode, false otherwise

### isPipelined

    boolean isPipelined()

  Indicates whether the connection is currently pipelined or not.

  Returns:
    true if the connection is pipelined, false otherwise
  See Also:
    `openPipeline()`, `isQueueing()`

### openPipeline

    void openPipeline()

  Activates the pipeline mode for this connection. When pipelined, all commands return null (the reply is read at the end through `closePipeline()`. Calling this method when the connection is already pipelined has no effect. Pipelining is used for issuing commands without requesting the response right away but rather at the end of the batch. While somewhat similar to MULTI, pipelining does not guarantee atomicity - it only tries to improve performance when issuing a lot of commands (such as in batching scenarios).

  Note:

  Consider doing some performance testing before using this feature since in many cases the performance benefits are minimal yet the impact on usage are not.

  See Also:
    `RedisTxCommands.multi()`

### closePipeline

    List<Object> closePipeline()
                               throws RedisPipelineException

  Executes the commands in the pipeline and returns their result. If the connection is not pipelined, an empty collection is returned.

  Returns:
    the result of the executed commands.
  Throws:
    `RedisPipelineException` - if the pipeline contains any incorrect/invalid statements

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD