Search in sources :

Example 1 with BasicPacketWithClientAddress

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

the class GNSApp method sendToClient.

/**
   * Delegates client messaging to gigapaxos.
   *
   * @param responseJSON
   * @throws java.io.IOException
   */
@Override
public void sendToClient(Request response, JSONObject responseJSON) throws IOException {
    if (DELEGATE_CLIENT_MESSAGING) {
        assert (response instanceof ClientRequest);
        Request originalRequest = this.outstanding.remove(((RequestIdentifier) response).getRequestID());
        assert (originalRequest != null && originalRequest instanceof BasicPacketWithClientAddress) : ((ClientRequest) response).getSummary();
        if (originalRequest != null && originalRequest instanceof BasicPacketWithClientAddress) {
            ((BasicPacketWithClientAddress) originalRequest).setResponse((ClientRequest) response);
            incrResponseCount((ClientRequest) response);
        }
        GNSConfig.getLogger().log(Level.FINE, "{0} set response {1} for requesting client {2} for request {3}", new Object[] { this, response, ((BasicPacketWithClientAddress) originalRequest).getClientAddress(), originalRequest.getSummary() });
        return;
    }
// else
}
Also used : ReconfigurableRequest(edu.umass.cs.reconfiguration.interfaces.ReconfigurableRequest) Request(edu.umass.cs.gigapaxos.interfaces.Request) ClientRequest(edu.umass.cs.gigapaxos.interfaces.ClientRequest) BasicPacketWithClientAddress(edu.umass.cs.gnsserver.gnsapp.packet.BasicPacketWithClientAddress) ClientRequest(edu.umass.cs.gigapaxos.interfaces.ClientRequest)

Aggregations

ClientRequest (edu.umass.cs.gigapaxos.interfaces.ClientRequest)1 Request (edu.umass.cs.gigapaxos.interfaces.Request)1 BasicPacketWithClientAddress (edu.umass.cs.gnsserver.gnsapp.packet.BasicPacketWithClientAddress)1 ReconfigurableRequest (edu.umass.cs.reconfiguration.interfaces.ReconfigurableRequest)1