-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathSingleConnection.java
More file actions
54 lines (42 loc) · 1.17 KB
/
SingleConnection.java
File metadata and controls
54 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.redislabs.redisgraph.impl.api;
import com.redislabs.redisgraph.Connection;
import redis.clients.jedis.Client;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.commands.ProtocolCommand;
/**
* Single Connection implementation of the Connection interface for RedisGraph
*/
public class SingleConnection implements Connection {
protected final Jedis jedis;
public SingleConnection(Jedis jedis) {
this.jedis = jedis;
}
@Override
public Object sendCommand(ProtocolCommand cmd, String... args) {
return jedis.sendCommand(cmd, args);
}
@Override
public Object sendBlockingCommand(ProtocolCommand cmd, String... args) {
return jedis.sendBlockingCommand(cmd, args);
}
@Override
public void close() {
// Doesn't actually close the connection
}
@Override
public String watch(String... keys) {
return jedis.watch(keys);
}
@Override
public String unwatch() {
return jedis.unwatch();
}
@Override
public Client getClient() {
return jedis.getClient();
}
@Override
public void disconnect() {
jedis.close();
}
}