use of de.rwth.idsg.steve.ocpp.ws.data.OcppJsonResponse in project steve by RWTH-i5-IDSG.
the class OcppJsonChargePoint method onMessage.
@OnWebSocketMessage
public void onMessage(Session session, String msg) {
try {
OcppJsonResponse response = deserializer.extractResponse(msg);
ResponseContext ctx = responseContextMap.remove(response.getMessageId());
if (response instanceof OcppJsonResult) {
ctx.responseHandler.accept(((OcppJsonResult) response).getPayload());
} else if (response instanceof OcppJsonError) {
ctx.errorHandler.accept((OcppJsonError) response);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (receivedResponsesSignal != null) {
receivedResponsesSignal.countDown();
}
}
}
Aggregations