Script commands are supported.

This commit is contained in:
Ivo Ramirez
2011-12-15 17:45:14 +01:00
committed by ivowiblo
parent 9dc89626ac
commit 3c86ebcd36
6 changed files with 189 additions and 3 deletions

View File

@@ -2740,4 +2740,26 @@ public class Jedis extends BinaryJedis implements JedisCommands {
return getEvalResult();
}
public Boolean scriptExists(String sha1){
String[] a = new String[1];
a[0] = sha1;
return scriptExists(a).get(0);
}
public List<Boolean> scriptExists(String... sha1){
client.scriptExists(sha1);
List<Object> result = client.getObjectMultiBulkReply();
List<Boolean> exists = new ArrayList<Boolean>();
for(Object value : result)
exists.add(((Long)value) == 1);
return exists;
}
public String scriptLoad(String script){
client.scriptLoad(script);
return client.getBulkReply();
}
}