diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 08df960f4..1f38653f4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,9 +2,9 @@
Here are some ways for you to get involved in the community:
-* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.springsource.org/forumdisplay.php?87-Hadoop) by responding to questions and joining the debate.
-* Create [JIRA](https://jira.springframework.org/browse/SHDP) tickets for bugs and new features and comment and vote on the ones that you are interested in.
-* Watch for upcoming articles on Spring by [subscribing](http://www.springsource.org/node/feed) to springframework.org.
+* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.spring.io/forum/spring-projects/data/nosql) by responding to questions and joining the debate.
+* Create [JIRA](https://jira.springframework.org/browse/DATAREDIS) tickets for bugs and new features and comment and vote on the ones that you are interested in.
+* Watch for upcoming articles on Spring by [subscribing](https://spring.io/blog) to spring.io.
-Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, read the Spring Framework [contributor guidelines] (https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md).
+Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, read the Spring Framework [contributor guidelines] (https://github.com/spring-projects/spring-framework/blob/master/CONTRIBUTING.md).
diff --git a/README.md b/README.md
index 08ff3450a..80161befc 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,11 @@ This modules provides integration with the [Redis] (http://redis.io/) store.
# Docs
-You can find out more details from the [user documentation](http://static.springsource.org/spring-data/redis/docs/current/reference/) or by browsing the [javadocs](http://static.springsource.org/spring-data/redis/docs/current/api/).
+You can find out more details from the [user documentation](http://docs.spring.io/spring-data/data-redis/docs/current/reference/html/) or by browsing the [javadocs](http://docs.spring.io/spring-data/data-redis/docs/current/api/).
# Examples
-For examples on using the Spring Data Key Value, see the dedicated project, also available on [GitHub](https://github.com/SpringSource/spring-data-keyvalue-examples)
+For examples on using the Spring Data Key Value, see the dedicated project, also available on [GitHub](https://github.com/spring-projects/spring-data-keyvalue-examples)
# Artifacts
@@ -29,14 +29,14 @@ For examples on using the Spring Data Key Value, see the dedicated project, also
spring-maven-snapshottrueSpringframework Maven SNAPSHOT Repository
- http://repo.springsource.org/libs-release
+ http://repo.spring.io/libs-releasespring-maven-milestoneSpringframework Maven Milestone Repository
- http://repo.springsource.org/libs-milestone
+ http://repo.spring.io/libs-milestone
~~~~~
@@ -44,8 +44,8 @@ For examples on using the Spring Data Key Value, see the dedicated project, also
~~~~~ groovy
repositories {
- maven { url "http://repo.springsource.org/libs-milestone" }
- maven { url "http://repo.springsource.org/libs-snapshot" }
+ maven { url "http://repo.spring.io/libs-milestone" }
+ maven { url "http://repo.spring.io/libs-snapshot" }
}
// used for nightly builds
@@ -54,7 +54,7 @@ dependencies {
}
~~~~~
-Latest GA release is _1.1.0.RELEASE_
+Latest GA release is _1.1.1.RELEASE_
Latest nightly is _1.2.0.BUILD-SNAPSHOT_
# Usage (for the impatient)
@@ -112,13 +112,13 @@ depending on your editor.
Here are some ways for you to get involved in the community:
-* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.springsource.org/forumdisplay.php?80-NoSQL) by responding to questions and joining the debate.
+* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.spring.io/forum/spring-projects/data/nosql) by responding to questions and joining the debate.
* Create [JIRA](https://jira.springframework.org/browse/DATAREDIS) tickets for bugs and new features and comment and vote on the ones that you are interested in.
-* Watch for upcoming articles on Spring by [subscribing](http://www.springsource.org/node/feed) to springframework.org.
+* Watch for upcoming articles on Spring by [subscribing](https://spring.io/blog) to spring.io.
-Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, read the Spring Framework [contributor guidelines] (https://github.com/SpringSource/spring-framework/blob/master/CONTRIBUTING.md).
+Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, read the Spring Framework [contributor guidelines] (https://github.com/spring-projects/spring-framework/blob/master/CONTRIBUTING.md).
# Staying in touch
Follow the project team ([@thomasdarimont](http://twitter.com/thomasdarimont), [@stroblchristoph](http://twitter.com/stroblchristoph)) on Twitter. In-depth articles can be
-found at the SpringSource [team blog](https://spring.io/blog), and releases are announced via our [news feed](https://spring.io/blog/category/news).
+found at the Spring [team blog](https://spring.io/blog), and releases are announced via our [news feed](https://spring.io/blog/category/news).
diff --git a/build.gradle b/build.gradle
index 8251ad57a..8c86b1635 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
buildscript {
repositories {
- maven { url 'http://repo.springsource.org/plugins-release' }
+ maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:bundlor-plugin:0.1.2'
@@ -13,8 +13,8 @@ description = 'Spring Data Redis'
group = 'org.springframework.data'
repositories {
- maven { url "http://repo.springsource.org/libs-snapshot" }
- maven { url "http://repo.springsource.org/plugins-release" }
+ maven { url "http://repo.spring.io/libs-snapshot" }
+ maven { url "http://repo.spring.io/plugins-release" }
mavenCentral()
}
@@ -112,8 +112,8 @@ jar {
manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes['Implementation-Title'] = 'spring-data-redis'
manifest.attributes['Implementation-Version'] = project.version
- manifest.attributes['Implementation-URL'] = "http://www.springsource.org/spring-data/redis"
- manifest.attributes['Implementation-Vendor'] = "SpringSource"
+ manifest.attributes['Implementation-URL'] = "http://projects.spring.io/spring-data-redis"
+ manifest.attributes['Implementation-Vendor'] = "Pivotal Software, Inc."
manifest.attributes['Implementation-Vendor-Id'] = "org.springframework"
from("$rootDir/docs/src/info") {
diff --git a/docs/src/api/overview.html b/docs/src/api/overview.html
index d2bdf9b41..cfff7c8f3 100644
--- a/docs/src/api/overview.html
+++ b/docs/src/api/overview.html
@@ -16,7 +16,7 @@ This document is the API specification for the Spring Data project.
If you are interested in commercial training, consultancy and
support for the Spring Data Framework,
- SpringSource provides
+ Pivotal Software, Inc. provides
such commercial support.
diff --git a/docs/src/info/changelog.txt b/docs/src/info/changelog.txt
index 97bfad0c7..9182ce6da 100644
--- a/docs/src/info/changelog.txt
+++ b/docs/src/info/changelog.txt
@@ -1,8 +1,8 @@
SPRING DATA REDIS INTEGRATION CHANGELOG
=======================================
-http://www.springsource.org/spring-data/redis
+http://projects.spring.io/spring-data-redis/
-Commit changelog: http://github.com/SpringSource/spring-data-redis/tree/v[version]
+Commit changelog: http://github.com/spring-projects/spring-data-redis/tree/v[version]
Issues changelog: http://jira.springsource.org/secure/ReleaseNote.jspa?projectId=10604
Changes in version 1.1.0.RELEASE (2013-09-09)
diff --git a/docs/src/info/readme.txt b/docs/src/info/readme.txt
index 2d31de9c4..dbb9a4b56 100644
--- a/docs/src/info/readme.txt
+++ b/docs/src/info/readme.txt
@@ -1,6 +1,6 @@
SPRING DATA REDIS
-----------------
-http://www.springsource.org/spring-data/redis
+http://projects.spring.io/spring-data-redis/
1. INTRODUCTION
@@ -20,9 +20,9 @@ The Spring Data Redis jars files can be found in the 'dist' directory.
4. GETTING STARTED
Please see the reference documentation.
-Additionally the blog at http://blog.springsource.com as well as sections of interest in the reference documentation.
+Additionally the blog at https://spring.io/blog as well as sections of interest in the reference documentation.
ADDITIONAL RESOURCES
Spring Data Homepage: http://projects.spring.io/spring-data-redis/
-Spring Data Forum : http://forum.springsource.org/forumdisplay.php?f=80
+Spring Data Forum : http://forum.spring.io/forum/spring-projects/data/nosql
Redis Homepage : http://redis.io
\ No newline at end of file
diff --git a/docs/src/reference/docbook/index.xml b/docs/src/reference/docbook/index.xml
index 33376a1d0..9b3e4e3f2 100644
--- a/docs/src/reference/docbook/index.xml
+++ b/docs/src/reference/docbook/index.xml
@@ -21,10 +21,15 @@
HickeySpringSource
-
+ ChristophStrobl
- Pivotal
+ Pivotal Software, Inc.
+
+
+ Thomas
+ Darimont
+ Pivotal Software, Inc.
diff --git a/docs/src/reference/docbook/introduction/getting-started.xml b/docs/src/reference/docbook/introduction/getting-started.xml
index b769eaf62..c063981dc 100644
--- a/docs/src/reference/docbook/introduction/getting-started.xml
+++ b/docs/src/reference/docbook/introduction/getting-started.xml
@@ -17,15 +17,15 @@
Knowing Spring
- Spring Data uses heavily Spring framework's core functionality,
- such as the IoC container,
- resource abstract or
- AOP infrastructure. While it is not important
+ Spring Data uses heavily Spring framework's core functionality,
+ such as the IoC container,
+ resource abstract or
+ AOP infrastructure. While it is not important
to know the Spring APIs, understanding the concepts behind them is. At a minimum, the idea behind IoC should be familiar.
That being said, the more knowledge one has about the Spring, the faster she will pick up Spring Data Redis.
Besides the very comprehensive (and sometimes disarming) documentation that explains in detail the Spring Framework,
- there are a lot of articles, blog entries and books on the matter - take a look at the Spring framework
- home page for more information. In general, this should be the starting point for
+ there are a lot of articles, blog entries and books on the matter - take a look at the Spring Guides
+ home page for more information. In general, this should be the starting point for
developers wanting to try Spring DR.
@@ -40,7 +40,7 @@
Trying Out The SamplesOne can find various samples for key value stores in the dedicated example repo, at
- http://github.com/SpringSource/spring-data-keyvalue-examples. For Spring Data Redis,
+ http://github.com/spring-projects/spring-data-keyvalue-examples. For Spring Data Redis,
of interest is the retwisj sample, a Twitter-clone built on top of Redis which can be run locally or be deployed into the cloud. See its
documentation, the following blog
entry or the
@@ -55,13 +55,13 @@
Community Support
- The Spring Data forum is a message board for all Spring Data (not just Redis) users to
+ The Spring Data forum is a message board for all Spring Data (not just Redis) users to
share information and help each other. Note that registration is needed only for posting.
Professional Support
- Professional, from-the-source support, with guaranteed response time, is available from SpringSource,
+ Professional, from-the-source support, with guaranteed response time, is available from Pivotal Software, Inc.,
the company behind Spring Data and Spring.
@@ -71,16 +71,16 @@
Following DevelopmentFor information on the Spring Data source code repository, nightly builds and snapshot artifacts please see the Spring Data home
- page.
+ page.
You can help make Spring Data best serve the needs of the Spring community by interacting with developers through the Spring Community
- forums.
+ forums.If you encounter a bug or want to suggest an improvement,
please create a ticket on the Spring Data issue tracker.To stay up to date with the latest news and announcements in the Spring eco system, subscribe to the
- Spring Community Portal.
- Lastly, you can follow the SpringSource Data blog or the project team on Twitter
- (Jennifer)
+ Spring Community Portal.
+ Lastly, you can follow the Spring blog or the project team (Thomas and Christoph) on Twitter.
+
\ No newline at end of file
diff --git a/docs/src/reference/docbook/introduction/requirements.xml b/docs/src/reference/docbook/introduction/requirements.xml
index 5245c88c3..681660fe7 100644
--- a/docs/src/reference/docbook/introduction/requirements.xml
+++ b/docs/src/reference/docbook/introduction/requirements.xml
@@ -2,8 +2,8 @@
RequirementsSpring Data Redis 1.2.x binaries requires JDK level 6.0 and above,
- and Spring Framework
- 3.2.7 and above.
+ and Spring Framework
+ 3.2.8 and above.
In terms of key value stores, Redis 2.6.x or higher
is required. Spring Data Redis is currently tested against the latest 2.6 and 2.8 releases.
diff --git a/docs/src/reference/docbook/reference/redis.xml b/docs/src/reference/docbook/reference/redis.xml
index 0840f4008..a798e5c85 100644
--- a/docs/src/reference/docbook/reference/redis.xml
+++ b/docs/src/reference/docbook/reference/redis.xml
@@ -36,7 +36,7 @@
explains the abstraction built on top of the low-level Connection API to handle the
infrastructural concerns and object conversion.
Support Classes - that offer reusable components (built on the aforementioned abstractions) such as
- java.util.Collection or Spring 3.1 cache implementation backed by
+ java.util.Collection or Spring cache implementation backed by
Redis as documented in
@@ -58,7 +58,7 @@
RedisConnection provides the building block for Redis communication as it handles the communication with the Redis back-end.
It also automatically translates the underlying connecting library exceptions to Spring's consistent DAO exception
- hierarchy so one can switch the connectors
+ hierarchy so one can switch the connectors
without any code changes as the operation semantics remain the same.For the corner cases where the native library API is required, RedisConnection provides a dedicated method
@@ -67,7 +67,7 @@
Active RedisConnections are created through RedisConnectionFactory. In addition, the factories act as
PersistenceExceptionTranslators, meaning once declared, they allow one to do transparent exception translation. For example, exception translation through the use of the
@Repository annotation and AOP. For more information see the dedicated
- section in Spring Framework documentation.
+ section in Spring Framework documentation.Depending on the underlying configuration, the factory can return a new connection or an existing connection (in case a pool or shared native connection is used).
@@ -394,7 +394,7 @@
(package org.springframework.data.redis.serializer) which as the name implies, takes care of the serialization process. Multiple implementations are
available out of the box, two of which have been already mentioned before in this documentation: the StringRedisSerializer and
the JdkSerializationRedisSerializer. However one can use OxmSerializer for Object/XML mapping through Spring 3
- OXM support or either JacksonJsonRedisSerializer or
+ OXM support or either JacksonJsonRedisSerializer or
Jackson2JsonRedisSerializer for storing data in JSON format. Do note that the storage format is not limited only to values - it can be used for keys, values or hashes
without any restrictions.
diff --git a/maven.gradle b/maven.gradle
index a293499a2..7e66ab706 100644
--- a/maven.gradle
+++ b/maven.gradle
@@ -31,10 +31,10 @@ def customizePom(pom, gradleProject) {
generatedPom.project {
name = gradleProject.description
description = gradleProject.description
- url = 'http://github.com/SpringSource/spring-data-redis'
+ url = 'http://github.com/spring-projects/spring-data-redis'
organization {
- name = 'SpringSource'
- url = 'http://www.springsource.org/spring-data/redis'
+ name = 'Pivotal Software, Inc.'
+ url = 'http://projects.spring.io/spring-data-redis'
}
licenses {
license {
@@ -44,9 +44,9 @@ def customizePom(pom, gradleProject) {
}
}
scm {
- url = 'http://github.com/SpringSource/spring-data-redis'
- connection = 'scm:git:git://github.com/SpringSource/spring-data-redis'
- developerConnection = 'scm:git:git://github.com/SpringSource/spring-data-redis'
+ url = 'http://github.com/spring-projects/spring-data-redis'
+ connection = 'scm:git:git://github.com/spring-projects/spring-data-redis'
+ developerConnection = 'scm:git:git://github.com/spring-projects/spring-data-redis'
}
developers {
developer {
@@ -57,6 +57,27 @@ def customizePom(pom, gradleProject) {
twitter = 'costinl'
}
}
+ developer {
+ id = 'jencompgeek'
+ name = 'Jennifer Hickey'
+ properties {
+ twitter = 'jencompgeek'
+ }
+ }
+ developer {
+ id = 'christophstrobl'
+ name = 'Christoph Strobl'
+ properties {
+ twitter = 'stroblchristoph'
+ }
+ }
+ developer {
+ id = 'thomasdarimont'
+ name = 'Thomas Darimont'
+ properties {
+ twitter = 'thomasdarimont'
+ }
+ }
}
}
}
diff --git a/src/main/java/org/springframework/data/redis/cache/package-info.java b/src/main/java/org/springframework/data/redis/cache/package-info.java
index 701a830e4..14230b11d 100644
--- a/src/main/java/org/springframework/data/redis/cache/package-info.java
+++ b/src/main/java/org/springframework/data/redis/cache/package-info.java
@@ -1,5 +1,5 @@
/**
- * Package providing a Redis implementation for Spring cache abstraction.
+ * Package providing a Redis implementation for Spring cache abstraction.
*/
package org.springframework.data.redis.cache;
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
index 689d0ff0a..42b47fc8d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisConnectionCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,12 +19,32 @@ package org.springframework.data.redis.connection;
* Connection-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisConnectionCommands {
+ /**
+ * Select the DB with given positive {@code dbIndex}.
+ *
+ * @see http://redis.io/commands/select
+ * @param dbIndex
+ */
void select(int dbIndex);
+ /**
+ * Returns {@code message} via server roundtrip.
+ *
+ * @see http://redis.io/commands/echo
+ * @param message
+ * @return
+ */
byte[] echo(byte[] message);
+ /**
+ * Test connection.
+ *
+ * @see http://redis.io/commands/ping
+ * @return Server response message - usually {@literal PONG}.
+ */
String ping();
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
index c3457c017..3a0bbfc7d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.redis.connection;
import java.util.List;
@@ -24,32 +23,136 @@ import java.util.Set;
* Hash-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisHashCommands {
+ /**
+ * Set the {@code value} of a hash {@code field}.
+ *
+ * @see http://redis.io/commands/hset
+ * @param key
+ * @param field
+ * @param value
+ * @return
+ */
Boolean hSet(byte[] key, byte[] field, byte[] value);
+ /**
+ * Set the {@code value} of a hash {@code field} only if {@code field} does not exist.
+ *
+ * @see http://redis.io/commands/hsetnx
+ * @param key
+ * @param field
+ * @param value
+ * @return
+ */
Boolean hSetNX(byte[] key, byte[] field, byte[] value);
+ /**
+ * Get value for given {@code field} from hash at {@code key}.
+ *
+ * @see http://redis.io/commands/hget
+ * @param key
+ * @param field
+ * @return
+ */
byte[] hGet(byte[] key, byte[] field);
+ /**
+ * Get values for given {@code fields} from hash at {@code key}.
+ *
+ * @see http://redis.io/commands/hmget
+ * @param key
+ * @param fields
+ * @return
+ */
List hMGet(byte[] key, byte[]... fields);
+ /**
+ * Set multiple hash fields to multiple values using data provided in {@code hashes}
+ *
+ * @see http://redis.io/commands/hmset
+ * @param key
+ * @param hashes
+ */
void hMSet(byte[] key, Map hashes);
+ /**
+ * Increment {@code value} of a hash {@code field} by the given {@code delta}.
+ *
+ * @see http://redis.io/commands/hincrby
+ * @param key
+ * @param field
+ * @param delta
+ * @return
+ */
Long hIncrBy(byte[] key, byte[] field, long delta);
+ /**
+ * Increment {@code value} of a hash {@code field} by the given {@code delta}.
+ *
+ * @see http://redis.io/commands/hincrbyfloat
+ * @param key
+ * @param field
+ * @param delta
+ * @return
+ */
Double hIncrBy(byte[] key, byte[] field, double delta);
+ /**
+ * Determine if given hash {@code field} exists.
+ *
+ * @see http://redis.io/commands/hexits
+ * @param key
+ * @param field
+ * @return
+ */
Boolean hExists(byte[] key, byte[] field);
+ /**
+ * Delete given hash {@code fields}.
+ *
+ * @see http://redis.io/commands/hdel
+ * @param key
+ * @param fields
+ * @return
+ */
Long hDel(byte[] key, byte[]... fields);
+ /**
+ * Get size of hash at {@code key}.
+ *
+ * @see http://redis.io/commands/hlen
+ * @param key
+ * @return
+ */
Long hLen(byte[] key);
+ /**
+ * Get key set (fields) of hash at {@code key}.
+ *
+ * @see http://redis.io/commands/h?
+ * @param key
+ * @return
+ */
Set hKeys(byte[] key);
+ /**
+ * Get entry set (values) of hash at {@code field}.
+ *
+ * @see http://redis.io/commands/hvals
+ * @param key
+ * @return
+ */
List hVals(byte[] key);
+ /**
+ * Get entire hash stored at {@code key}.
+ *
+ * @see http://redis.io/commands/hgetall
+ * @param key
+ * @return
+ */
Map hGetAll(byte[] key);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
index 9737239fb..84506960a 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,45 +22,187 @@ import java.util.Set;
* Key-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisKeyCommands {
+ /**
+ * Determine if given {@code key} exists.
+ *
+ * @see http://redis.io/commands/exists
+ * @param key
+ * @return
+ */
Boolean exists(byte[] key);
+ /**
+ * Delete given {@code keys}.
+ *
+ * @see http://redis.io/commands/del
+ * @param keys
+ * @return The number of keys that were removed.
+ */
Long del(byte[]... keys);
+ /**
+ * Determine the type stored at {@code key}.
+ *
+ * @see http://redis.io/commands/type
+ * @param key
+ * @return
+ */
DataType type(byte[] key);
+ /**
+ * Find all keys matching the given {@code pattern}.
+ *
+ * @see http://redis.io/commands/keys
+ * @param pattern
+ * @return
+ */
Set keys(byte[] pattern);
+ /**
+ * Return a random key from the keyspace.
+ *
+ * @see http://redis.io/commands/randomkey
+ * @return
+ */
byte[] randomKey();
+ /**
+ * Rename key {@code oleName} to {@code newName}.
+ *
+ * @see http://redis.io/commands/rename
+ * @param oldName
+ * @param newName
+ */
void rename(byte[] oldName, byte[] newName);
+ /**
+ * Rename key {@code oleName} to {@code newName} only if {@code newName} does not exist.
+ *
+ * @see http://redis.io/commands/renamenx
+ * @param oldName
+ * @param newName
+ * @return
+ */
Boolean renameNX(byte[] oldName, byte[] newName);
+ /**
+ * Set time to live for given {@code key} in seconds.
+ *
+ * @see http://redis.io/commands/expire
+ * @param key
+ * @param seconds
+ * @return
+ */
Boolean expire(byte[] key, long seconds);
+ /**
+ * Set time to live for given {@code key} in milliseconds.
+ *
+ * @see http://redis.io/commands/pexpire
+ * @param key
+ * @param millis
+ * @return
+ */
Boolean pExpire(byte[] key, long millis);
+ /**
+ * Set the expiration for given {@code key} as a {@literal UNIX} timestamp.
+ *
+ * @see http://redis.io/commands/expireat
+ * @param key
+ * @param unixTime
+ * @return
+ */
Boolean expireAt(byte[] key, long unixTime);
+ /**
+ * Set the expiration for given {@code key} as a {@literal UNIX} timestamp in milliseconds.
+ *
+ * @see http://redis.io/commands/pexpireat
+ * @param key
+ * @param unixTimeInMillis
+ * @return
+ */
Boolean pExpireAt(byte[] key, long unixTimeInMillis);
+ /**
+ * Remove the expiration from given {@code key}.
+ *
+ * @see http://redis.io/commands/persist
+ * @param key
+ * @return
+ */
Boolean persist(byte[] key);
+ /**
+ * Move given {@code key} to database with {@code index}.
+ *
+ * @see http://redis.io/commands/move
+ * @param key
+ * @param dbIndex
+ * @return
+ */
Boolean move(byte[] key, int dbIndex);
+ /**
+ * Get the time to live for {@code key} in seconds.
+ *
+ * @see http://redis.io/commands/ttl
+ * @param key
+ * @return
+ */
Long ttl(byte[] key);
+ /**
+ * Get the time to live for {@code key} in milliseconds.
+ *
+ * @see http://redis.io/commands/pttl
+ * @param key
+ * @return
+ */
Long pTtl(byte[] key);
- // sort commands
+ /**
+ * Sort the elements for {@code key}.
+ *
+ * @see http://redis.io/commands/sort
+ * @param key
+ * @param params
+ * @return
+ */
List sort(byte[] key, SortParameters params);
+ /**
+ * Sort the elements for {@code key} and store result in {@code storeKey}.
+ *
+ * @see http://redis.io/commands/sort
+ * @param key
+ * @param params
+ * @param storeKey
+ * @return
+ */
Long sort(byte[] key, SortParameters params, byte[] storeKey);
+ /**
+ * Retrieve serialized version of the value stored at {@code key}.
+ *
+ * @see http://redis.io/commands/dump
+ * @param key
+ * @return
+ */
byte[] dump(byte[] key);
+ /**
+ * Create {@code key} using the {@code serializedValue}, previously obtained using {@link #dump(byte[])}.
+ *
+ * @see http://redis.io/commands/restore
+ * @param key
+ * @param ttlInMillis
+ * @param serializedValue
+ */
void restore(byte[] key, long ttlInMillis, byte[] serializedValue);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
index abf7dafcd..350a4d988 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisListCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.redis.connection;
import java.util.List;
@@ -22,6 +21,7 @@ import java.util.List;
* List-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisListCommands {
@@ -32,37 +32,179 @@ public interface RedisListCommands {
BEFORE, AFTER
}
+ /**
+ * Append {@code values} to {@code key}.
+ *
+ * @see http://redis.io/commands/rpush
+ * @param key
+ * @param values
+ * @return
+ */
Long rPush(byte[] key, byte[]... values);
+ /**
+ * Prepend {@code values} to {@code key}.
+ *
+ * @see http://redis.io/commands/lpush
+ * @param key
+ * @param value
+ * @return
+ */
Long lPush(byte[] key, byte[]... value);
+ /**
+ * Append {@code} values to {@code key} only if the list exists.
+ *
+ * @see http://redis.io/commands/rpushx
+ * @param key
+ * @param values
+ * @return
+ */
Long rPushX(byte[] key, byte[] value);
+ /**
+ * Prepend {@code values} to {@code key} only if the list exits.
+ *
+ * @see http://redis.io/commands/lpushx
+ * @param key
+ * @param value
+ * @return
+ */
Long lPushX(byte[] key, byte[] value);
+ /**
+ * Get the size of list stored at {@code key}.
+ *
+ * @see http://redis.io/commands/llen
+ * @param key
+ * @return
+ */
Long lLen(byte[] key);
+ /**
+ * Get elements between {@code begin} and {@code end} from list at {@code key}.
+ *
+ * @see http://redis.io/commands/lrange
+ * @param key
+ * @param begin
+ * @param end
+ * @return
+ */
List lRange(byte[] key, long begin, long end);
+ /**
+ * Trim list at {@code key} to elements between {@code begin} and {@code end}.
+ *
+ * @see http://redis.io/commands/ltrim
+ * @param key
+ * @param begin
+ * @param end
+ */
void lTrim(byte[] key, long begin, long end);
+ /**
+ * Get element at {@code index} form list at {@code key}.
+ *
+ * @see http://redis.io/commands/lindex
+ * @param key
+ * @param index
+ * @return
+ */
byte[] lIndex(byte[] key, long index);
+ /**
+ * Insert {@code value} {@link Position#BEFORE} or {@link Position#AFTER} existing {@code pivot} for {@code key}.
+ *
+ * @see http://redis.io/commands/linsert
+ * @param key
+ * @param where
+ * @param pivot
+ * @param value
+ * @return
+ */
Long lInsert(byte[] key, Position where, byte[] pivot, byte[] value);
+ /**
+ * Set the {@code value} list element at {@code index}.
+ *
+ * @see http://redis.io/commands/lset
+ * @param key
+ * @param index
+ * @param value
+ */
void lSet(byte[] key, long index, byte[] value);
+ /**
+ * Removes the first {@code count} occurrences of {@code value} from the list stored at {@code key}.
+ *
+ * @see http://redis.io/commands/lrem
+ * @param key
+ * @param count
+ * @param value
+ * @return
+ */
Long lRem(byte[] key, long count, byte[] value);
+ /**
+ * Removes and returns first element in list stored at {@code key}.
+ *
+ * @see http://redis.io/commands/lpop
+ * @param key
+ * @return
+ */
byte[] lPop(byte[] key);
+ /**
+ * Removes and returns last element in list stored at {@code key}.
+ *
+ * @see http://redis.io/commands/rpop
+ * @param key
+ * @return
+ */
byte[] rPop(byte[] key);
+ /**
+ * Removes and returns first element from lists stored at {@code keys} (see: {@link #lPop(byte[])}).
+ * Blocks connection until element available or {@code timeout} reached.
+ *
+ * @see http://redis.io/commands/blpop
+ * @param timeout
+ * @param keys
+ * @return
+ */
List bLPop(int timeout, byte[]... keys);
+ /**
+ * Removes and returns last element from lists stored at {@code keys} (see: {@link #rPop(byte[])}).
+ * Blocks connection until element available or {@code timeout} reached.
+ *
+ * @see http://redis.io/commands/brpop
+ * @param timeout
+ * @param keys
+ * @return
+ */
List bRPop(int timeout, byte[]... keys);
+ /**
+ * Remove the last element from list at {@code srcKey}, append it to {@code dstKey} and return its value.
+ *
+ * @see http://redis.io/commands/rpoplpush
+ * @param srcKey
+ * @param dstKey
+ * @return
+ */
byte[] rPopLPush(byte[] srcKey, byte[] dstKey);
+ /**
+ * Remove the last element from list at {@code srcKey}, append it to {@code dstKey} and return its value (see
+ * {@link #rPopLPush(byte[], byte[])}).
+ * Blocks connection until element available or {@code timeout} reached.
+ *
+ * @see http://redis.io/commands/brpoplpush
+ * @param timeout
+ * @param srcKey
+ * @param dstKey
+ * @return
+ */
byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
index 8012b67df..29a61da45 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisScriptingCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2013 the original author or authors.
+ * Copyright 2012-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.redis.connection;
import java.util.List;
@@ -22,18 +21,64 @@ import java.util.List;
* Scripting commands.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisScriptingCommands {
+ /**
+ * Flush lua script cache.
+ *
+ * @see http://redis.io/commands/script-flush
+ */
void scriptFlush();
+ /**
+ * Kill current lua script execution.
+ *
+ * @see http://redis.io/commands/script-kill
+ */
void scriptKill();
+ /**
+ * Load lua script into scripts cache, without executing it.
+ * Execute the script by calling {@link #evalSha(String, ReturnType, int, byte[])}.
+ *
+ * @see http://redis.io/commands/script-load
+ * @param script
+ * @return
+ */
String scriptLoad(byte[] script);
- List scriptExists(String... scriptSha1);
+ /**
+ * Check if given {@code scriptShas} exist in script cache.
+ *
+ * @see http://redis.io/commands/script-exits
+ * @param scriptShas
+ * @return one entry per given scriptSha in returned list.
+ */
+ List scriptExists(String... scriptShas);
+ /**
+ * Evaluate given {@code script}.
+ *
+ * @see http://redis.io/commands/eval
+ * @param script
+ * @param returnType
+ * @param numKeys
+ * @param keysAndArgs
+ * @return
+ */
T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
- T evalSha(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
+ /**
+ * Evaluate given {@code scriptSha}.
+ *
+ * @see http://redis.io/commands/evalsha
+ * @param script
+ * @param returnType
+ * @param numKeys
+ * @param keysAndArgs
+ * @return
+ */
+ T evalSha(String scriptSha, ReturnType returnType, int numKeys, byte[]... keysAndArgs);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
index ce325e808..1589e87a1 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java
@@ -26,30 +26,109 @@ import java.util.Properties;
*/
public interface RedisServerCommands {
+ /**
+ * Start an {@literal Append Only File} rewrite process on server.
+ *
+ * @see http://redis.io/commands/bgrewriteaof
+ */
void bgWriteAof();
+ /**
+ * Start background saving of db on server.
+ *
+ * @see http://redis.io/commands/bgsave
+ */
void bgSave();
+ /**
+ * Get time of last {@link #bgSave()} operation in seconds.
+ *
+ * @see http://redis.io/commands/lastsave
+ * @return
+ */
Long lastSave();
+ /**
+ * Synchronous save current db snapshot on server.
+ *
+ * @see http://redis.io/commands/save
+ */
void save();
+ /**
+ * Get the total number of available keys in currently selected database.
+ *
+ * @see http://redis.io/commands/dbsize
+ * @return
+ */
Long dbSize();
+ /**
+ * Delete all keys of the currently selected database.
+ *
+ * @see http://redis.io/commands/flushdb
+ */
void flushDb();
+ /**
+ * Delete all all keys from all databases.
+ *
+ * @see http://redis.io/commands/flushall
+ */
void flushAll();
+ /**
+ * Load {@literal default} server information like
+ *
+ *
mempory
+ *
cpu utilization
+ *
replication
+ *
+ *
+ * @see http://redis.io/commands/info
+ * @return
+ */
Properties info();
+ /**
+ * Load server information for given {@code selection}.
+ *
+ * @see http://redis.io/commands/info
+ * @return
+ */
Properties info(String section);
+ /**
+ * Shutdown server.
+ *
+ * @see http://redis.io/commands/shutdown
+ */
void shutdown();
+ /**
+ * Load configuration parameters for given {@code pattern} from server.
+ *
+ * @see http://redis.io/commands/config-get
+ * @param pattern
+ * @return
+ */
List getConfig(String pattern);
+ /**
+ * Set server configuration for {@code key} to {@code value}.
+ *
+ * @see http://redis.io/commands/config-set
+ * @param param
+ * @param value
+ */
void setConfig(String param, String value);
+ /**
+ * Reset statistic counters on server.
+ * Counters can be retrieved using {@link #info()}.
+ *
+ * @see http://redis.io/commands/config-resetstat
+ */
void resetConfigStats();
/**
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
index d10ca959a..d196ce05e 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.redis.connection;
import java.util.List;
@@ -23,36 +22,148 @@ import java.util.Set;
* Set-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisSetCommands {
+ /**
+ * Add given {@code values} to set at {@code key}.
+ *
+ * @see http://redis.io/commands/sadd
+ * @param key
+ * @param values
+ * @return
+ */
Long sAdd(byte[] key, byte[]... values);
+ /**
+ * Remove given {@code values} from set at {@code key} and return the number of removed elements.
+ *
+ * @see http://redis.io/commands/srem
+ * @param key
+ * @param values
+ * @return
+ */
Long sRem(byte[] key, byte[]... values);
+ /**
+ * Remove and return a random member from set at {@code key}.
+ *
+ * @see http://redis.io/commands/spop
+ * @param key
+ * @return
+ */
byte[] sPop(byte[] key);
+ /**
+ * Move {@code value} from {@code srcKey} to {@destKey}
+ *
+ * @see http://redis.io/commands/smove
+ * @param srcKey
+ * @param destKey
+ * @param value
+ * @return
+ */
Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value);
+ /**
+ * Get size of set at {@code key}.
+ *
+ * @see http://redis.io/commands/scard
+ * @param key
+ * @return
+ */
Long sCard(byte[] key);
+ /**
+ * Check if set at {@code key} contains {@code value}.
+ *
+ * @see http://redis.io/commands/sismember
+ * @param key
+ * @param value
+ * @return
+ */
Boolean sIsMember(byte[] key, byte[] value);
+ /**
+ * Returns the members intersecting all given sets at {@code keys}.
+ *
+ * @see http://redis.io/commands/sinter
+ * @param keys
+ * @return
+ */
Set sInter(byte[]... keys);
+ /**
+ * Intersect all given sets at {@code keys} and store result in {@code destKey}.
+ *
+ * @see http://redis.io/commands/sinterstore
+ * @param destKey
+ * @param keys
+ * @return
+ */
Long sInterStore(byte[] destKey, byte[]... keys);
+ /**
+ * Union all sets at given {@code keys}.
+ *
+ * @see http://redis.io/commands/sunion
+ * @param keys
+ * @return
+ */
Set sUnion(byte[]... keys);
+ /**
+ * Union all sets at given {@code keys} and store result in {@code destKey}.
+ *
+ * @see http://redis.io/commands/sunionstore
+ * @param keys
+ * @return
+ */
Long sUnionStore(byte[] destKey, byte[]... keys);
+ /**
+ * Diff all sets for given {@code keys}.
+ *
+ * @see http://redis.io/commands/sdiff
+ * @param keys
+ * @return
+ */
Set sDiff(byte[]... keys);
+ /**
+ * Diff all sets for given {@code keys} and store result in {@code destKey}
+ *
+ * @see http://redis.io/commands/sdiffstore
+ * @param keys
+ * @return
+ */
Long sDiffStore(byte[] destKey, byte[]... keys);
+ /**
+ * Get all elements of set at {@code key}.
+ *
+ * @see http://redis.io/commands/smembers
+ * @param key
+ * @return
+ */
Set sMembers(byte[] key);
+ /**
+ * Get random element from set at {@code key}.
+ *
+ * @see http://redis.io/commands/srandmember
+ * @param key
+ * @return
+ */
byte[] sRandMember(byte[] key);
+ /**
+ * Get {@code count} random elements from set at {@code key}.
+ *
+ * @see http://redis.io/commands/srandmember
+ * @param key
+ * @return
+ */
List sRandMember(byte[] key, long count);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
index a64297fdd..afc951cde 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisStringCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.springframework.data.redis.connection;
import java.util.List;
@@ -23,6 +22,7 @@ import java.util.Map;
* String/Value-specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisStringCommands {
@@ -30,47 +30,215 @@ public interface RedisStringCommands {
AND, OR, XOR, NOT;
}
+ /**
+ * Get the value of {@code key}.
+ *
+ * @see http://redis.io/commands/get
+ * @param key
+ * @return
+ */
byte[] get(byte[] key);
+ /**
+ * Set value of {@code key} and return its old value.
+ *
+ * @see http://redis.io/commands/getset
+ * @param key
+ * @param value
+ * @return
+ */
byte[] getSet(byte[] key, byte[] value);
+ /**
+ * Get the values of all given {@code keys}.
+ *
+ * @see http://redis.io/commands/mget
+ * @param keys
+ * @return
+ */
List mGet(byte[]... keys);
+ /**
+ * Set {@code value} for {@code key}.
+ *
+ * @see http://redis.io/commands/set
+ * @param key
+ * @param value
+ */
void set(byte[] key, byte[] value);
+ /**
+ * Set {@code value} for {@code key}, only if {@code key} does not exist.
+ *
+ * @see http://redis.io/commands/setnx
+ * @param key
+ * @param value
+ * @return
+ */
Boolean setNX(byte[] key, byte[] value);
+ /**
+ * Set the {@code value} and expiration in {@code seconds} for {@code key}.
+ *
+ * @see http://redis.io/commands/setex
+ * @param key
+ * @param seconds
+ * @param value
+ */
void setEx(byte[] key, long seconds, byte[] value);
+ /**
+ * Set multiple keys to multiple values using key-value pairs provided in {@code tuple}.
+ *
+ * @see http://redis.io/commands/mset
+ * @param tuple
+ */
void mSet(Map tuple);
+ /**
+ * Set multiple keys to multiple values using key-value pairs provided in {@code tuple} only if the provided key does
+ * not exist.
+ *
+ * @see http://redis.io/commands/msetnx
+ * @param tuple
+ */
Boolean mSetNX(Map tuple);
+ /**
+ * Increment value of {@code key} by 1.
+ *
+ * @see http://redis.io/commands/incr
+ * @param key
+ * @return
+ */
Long incr(byte[] key);
+ /**
+ * Increment value of {@code key} by {@code value}.
+ *
+ * @see http://redis.io/commands/incrby
+ * @param key
+ * @return
+ */
Long incrBy(byte[] key, long value);
+ /**
+ * Increment value of {@code key} by {@code value}.
+ *
+ * @see http://redis.io/commands/incrbyfloat
+ * @param key
+ * @return
+ */
Double incrBy(byte[] key, double value);
+ /**
+ * Decrement value of {@code key} by 1.
+ *
+ * @see http://redis.io/commands/decr
+ * @param key
+ * @return
+ */
Long decr(byte[] key);
+ /**
+ * Increment value of {@code key} by {@code value}.
+ *
+ * @see http://redis.io/commands/decrby
+ * @param key
+ * @param value
+ * @return
+ */
Long decrBy(byte[] key, long value);
+ /**
+ * Append a {@code value} to {@code key}.
+ *
+ * @see http://redis.io/commands/append
+ * @param key
+ * @param value
+ * @return
+ */
Long append(byte[] key, byte[] value);
+ /**
+ * Get a substring of value of {@code key} between {@code begin} and {@code end}.
+ *
+ * @see http://redis.io/commands/getrange
+ * @param key
+ * @param begin
+ * @param end
+ * @return
+ */
byte[] getRange(byte[] key, long begin, long end);
+ /**
+ * Overwrite parts of {@code key} starting at the specified {@code offset} with given {@code value}.
+ *
+ * @see http://redis.io/commands/setrange
+ * @param key
+ * @param value
+ * @param offset
+ */
void setRange(byte[] key, byte[] value, long offset);
+ /**
+ * Get the bit value at {@code offset} of value at {@code key}.
+ *
+ * @see http://redis.io/commands/getbit
+ * @param key
+ * @param offset
+ * @return
+ */
Boolean getBit(byte[] key, long offset);
+ /**
+ * Sets the bit at {@code offset} in value stored at {@code key}.
+ *
+ * @see http://redis.io/commands/setbit
+ * @param key
+ * @param offset
+ * @param value
+ */
void setBit(byte[] key, long offset, boolean value);
+ /**
+ * Count the number of set bits (population counting) in value stored at {@code key}.
+ *
+ * @see http://redis.io/commands/bitcount
+ * @param key
+ * @return
+ */
Long bitCount(byte[] key);
+ /**
+ * Count the number of set bits (population counting) of value stored at {@code key} between {@code begin} and
+ * {@code end}.
+ *
+ * @see http://redis.io/commands/bitcount
+ * @param key
+ * @param begin
+ * @param end
+ * @return
+ */
Long bitCount(byte[] key, long begin, long end);
+ /**
+ * Perform bitwise operations between strings.
+ *
+ * @see http://redis.io/commands/bitop
+ * @param op
+ * @param destination
+ * @param keys
+ * @return
+ */
Long bitOp(BitOperation op, byte[] destination, byte[]... keys);
+ /**
+ * Get the length of the value stored at {@code key}.
+ *
+ * @see http://redis.io/commands/strlen
+ * @param key
+ * @return
+ */
Long strLen(byte[] key);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
index b4631ac0a..293f3a70d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisTxCommands.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2013 the original author or authors.
+ * Copyright 2011-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,16 +21,47 @@ import java.util.List;
* Transaction/Batch specific commands supported by Redis.
*
* @author Costin Leau
+ * @author Christoph Strobl
*/
public interface RedisTxCommands {
+ /**
+ * Mark the start of a transaction block.
+ * Commands will be queued and can then be executed by calling {@link #exec()} or rolled back using {@link #discard()}
+ * .
+ *
+ * @see http://redis.io/commands/multi
+ */
void multi();
+ /**
+ * Executes all queued commands in a transaction started with {@link #multi()}.
+ * If used along with {@link #watch(byte[])} the operation will fail if any of watched keys has been modified.
+ *
+ * @see http://redis.io/commands/exec
+ * @return List of replies for each executed command.
+ */
List