diff --git a/.classpath b/.classpath
new file mode 100644
index 000000000..06c221d7f
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 000000000..862bb3d6d
--- /dev/null
+++ b/.project
@@ -0,0 +1,16 @@
+
+
+ spring-data-redis
+ Spring Data Redis
+
+
+ org.eclipse.jdt.core.javanature
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..8c9e1f31e
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,13 @@
+#
+#Wed Apr 04 09:18:47 EEST 2012
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
diff --git a/build.gradle b/build.gradle
index b561df415..7ce199f4a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -87,6 +87,7 @@ dependencies {
// Redis Drivers
compile "redis.clients:jedis:$jedisVersion"
+ compile "com.github.spullara.redis:client:$srpVersion"
compile("org.jredis:jredis-anthonylauzon:$jredisVersion") { optional = true }
compile("org.idevlab:rjc:$rjcVersion") { optional = true }
diff --git a/gradle.properties b/gradle.properties
index 66da45e04..7ca1a04e2 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -15,7 +15,8 @@ mockitoVersion = 1.8.5
# Drivers
jedisVersion = 2.1.0
jredisVersion = 03122010
-rjcVersion= 0.6.4
+rjcVersion = 0.6.4
+srpVersion = 0.2
# Manifest properties
@@ -24,6 +25,7 @@ spring.range = "[3.1.0, 4.0.0)"
jedis.range = "[2.1.0, 2.1.0]"
jackson.range = "[1.6, 2.0.0)"
rjc.range = "[0.6.4, 0.6.4]"
+srp.range = "[0.2, 1.0)"
# --------------------
# Project wide version
diff --git a/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java
new file mode 100644
index 000000000..ae56e207b
--- /dev/null
+++ b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java
@@ -0,0 +1,1824 @@
+/*
+ * Copyright 2011 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.springframework.data.redis.connection.srp;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+
+import org.springframework.dao.DataAccessException;
+import org.springframework.data.redis.RedisConnectionFailureException;
+import org.springframework.data.redis.RedisSystemException;
+import org.springframework.data.redis.connection.DataType;
+import org.springframework.data.redis.connection.MessageListener;
+import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.connection.RedisSubscribedConnectionException;
+import org.springframework.data.redis.connection.SortParameters;
+import org.springframework.data.redis.connection.Subscription;
+import org.springframework.util.Assert;
+
+import redis.Command;
+import redis.client.RedisClient;
+import redis.client.RedisClient.Pipeline;
+import redis.client.RedisException;
+import redis.reply.Reply;
+
+import com.google.common.base.Charsets;
+
+/**
+ * {@code RedisConnection} implementation on top of spullara Redis Protocol library.
+ *
+ * @author Costin Leau
+ */
+public class SrpConnection implements RedisConnection {
+
+ private final RedisClient client;
+ private final BlockingQueue queue;
+
+ private boolean isClosed = false;
+ private boolean isMulti = false;
+ private Pipeline pipeline;
+ private volatile SrpSubscription subscription;
+
+ public SrpConnection(String host, int port, BlockingQueue queue) {
+ try {
+ this.client = new RedisClient(host, port);
+ this.queue = queue;
+ } catch (IOException e) {
+ throw new RedisConnectionFailureException("Could not connect", e);
+ }
+ }
+
+ protected DataAccessException convertSRAccessException(Exception ex) {
+ if (ex instanceof RedisException) {
+ return SrpUtils.convertSRedisAccessException((RedisException) ex);
+ }
+ if (ex instanceof IOException) {
+ return new RedisConnectionFailureException("Redis connection failed", (IOException) ex);
+ }
+
+ return new RedisSystemException("Unknown SRedis exception", ex);
+ }
+
+ public Object execute(String command, byte[]... args) {
+ Assert.hasText(command, "a valid command needs to be specified");
+ String name = command.trim().toUpperCase();
+ Command cmd = new Command(name.getBytes(Charsets.UTF_8), args);
+ if (isPipelined()) {
+ client.pipeline(name, cmd);
+ return null;
+ }
+ else {
+ return client.execute(name, cmd);
+ }
+ }
+
+ public void close() throws DataAccessException {
+ isClosed = true;
+ queue.remove(this);
+
+ try {
+ client.close();
+ } catch (IOException ex) {
+ throw convertSRAccessException(ex);
+ }
+ }
+
+ public boolean isClosed() {
+ return isClosed;
+ }
+
+ public RedisClient getNativeConnection() {
+ return client;
+ }
+
+
+ public boolean isQueueing() {
+ return isMulti;
+ }
+
+ public boolean isPipelined() {
+ return (pipeline != null);
+ }
+
+
+ public void openPipeline() {
+ if (pipeline == null) {
+ pipeline = client.pipeline();
+ }
+ }
+
+ public List