Commit 646b68bd authored by legoc's avatar legoc
Browse files

Moved classes

parent c47890ba
......@@ -16,8 +16,6 @@
package fr.ill.ics.cameo.base;
import fr.ill.ics.cameo.base.impl.TimeCondition;
public class ConnectionChecker {
public static interface Handler {
......
......@@ -10,38 +10,38 @@ import fr.ill.ics.cameo.messages.Messages;
public class RequestSocket {
private RequestSocketImpl socket;
private RequestSocketImpl impl;
private Parser parser;
public RequestSocket(Context context, int timeout, Parser parser) {
//TODO replace with a factory call.
this.socket = new RequestSocketZmq(context, timeout);
this.impl = new RequestSocketZmq(context, timeout);
this.parser = parser;
}
public void setTimeout(int timeout) {
this.socket.setTimeout(timeout);
this.impl.setTimeout(timeout);
}
public void connect(String endpoint) {
socket.connect(endpoint);
impl.connect(endpoint);
}
public byte[][] request(byte[] part1) {
return socket.request(part1, -1);
return impl.request(part1, -1);
}
public byte[][] request(byte[] part1, byte[] part2) {
return socket.request(part1, part2, -1);
return impl.request(part1, part2, -1);
}
public byte[][] request(byte[] part1, byte[] part2, byte[] part3) {
return socket.request(part1, part2, part3, -1);
return impl.request(part1, part2, part3, -1);
}
public JSONObject requestJSON(JSONObject request, int timeout) throws ConnectionTimeout {
byte[][] reply = socket.request(Messages.serialize(request), timeout);
byte[][] reply = impl.request(Messages.serialize(request), timeout);
try {
return parser.parse(Messages.parseString(reply[0]));
......@@ -57,7 +57,7 @@ public class RequestSocket {
public JSONObject requestJSON(JSONObject request, byte[] data, int timeout) throws ConnectionTimeout {
byte[][] reply = socket.request(Messages.serialize(request), data, timeout);
byte[][] reply = impl.request(Messages.serialize(request), data, timeout);
try {
return parser.parse(Messages.parseString(reply[0]));
......@@ -72,6 +72,6 @@ public class RequestSocket {
}
public void terminate() {
socket.terminate();
impl.terminate();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment