Search in sources :

Example 1 with InternalCommandPacket

use of edu.umass.cs.gnsserver.gnsapp.packet.InternalCommandPacket in project GNS by MobilityFirst.

the class ActiveGNSClient method read.

@Override
public JSONObject read(InternalRequestHeader header, String targetGUID, String field) throws ClientException, InternalRequestException {
    try {
        Request request = this.executeCommand(GNSCommandInternal.fieldRead(targetGUID, field, header));
        InternalCommandPacket packet = (InternalCommandPacket) request;
        return packet.getResultJSONObject();
    } catch (IOException | JSONException e) {
        throw new ClientException(e);
    }
}
Also used : Request(edu.umass.cs.gigapaxos.interfaces.Request) InternalCommandPacket(edu.umass.cs.gnsserver.gnsapp.packet.InternalCommandPacket) JSONException(org.json.JSONException) IOException(java.io.IOException) ClientException(edu.umass.cs.gnscommon.exceptions.client.ClientException)

Aggregations

Request (edu.umass.cs.gigapaxos.interfaces.Request)1 ClientException (edu.umass.cs.gnscommon.exceptions.client.ClientException)1 InternalCommandPacket (edu.umass.cs.gnsserver.gnsapp.packet.InternalCommandPacket)1 IOException (java.io.IOException)1 JSONException (org.json.JSONException)1