Implemented SLAVEOF

This commit is contained in:
Jonathan Leibiusky
2010-08-08 13:53:45 -03:00
parent f0a426a7c7
commit 50405b4d18
2 changed files with 19 additions and 0 deletions

View File

@@ -539,4 +539,12 @@ public class Client extends Connection {
public void monitor() {
sendCommand("MONITOR");
}
public void slaveof(String host, int port) {
sendCommand("SLAVEOF", host, String.valueOf(port));
}
public void slaveofNoOne() {
sendCommand("SLAVEOF", "no", "one");
}
}

View File

@@ -643,4 +643,15 @@ public class Jedis {
client.monitor();
jedisMonitor.proceed(client);
}
public String slaveof(String host, int port) {
client.slaveof(host, port);
return client.getStatusCodeReply();
}
public String slaveofNoOne() {
client.slaveofNoOne();
return client.getStatusCodeReply();
}
}