Search in sources :

Example 1 with OcppJsonMessage

use of de.rwth.idsg.steve.ocpp.ws.data.OcppJsonMessage in project steve by RWTH-i5-IDSG.

the class IncomingPipeline method accept.

@Override
public void accept(CommunicationContext context) {
    deserializer.accept(context);
    // When the incoming could not be deserialized
    if (context.isSetOutgoingError()) {
        serializer.accept(context);
        sender.accept(context);
        return;
    }
    OcppJsonMessage msg = context.getIncomingMessage();
    if (msg instanceof OcppJsonCall) {
        handler.accept(context);
        serializer.accept(context);
        sender.accept(context);
    } else if (msg instanceof OcppJsonResult) {
        context.getResultHandler().accept((OcppJsonResult) msg);
    } else if (msg instanceof OcppJsonError) {
        context.getErrorHandler().accept((OcppJsonError) msg);
    }
}
Also used : OcppJsonResult(de.rwth.idsg.steve.ocpp.ws.data.OcppJsonResult) OcppJsonError(de.rwth.idsg.steve.ocpp.ws.data.OcppJsonError) OcppJsonCall(de.rwth.idsg.steve.ocpp.ws.data.OcppJsonCall) OcppJsonMessage(de.rwth.idsg.steve.ocpp.ws.data.OcppJsonMessage)

Aggregations

OcppJsonCall (de.rwth.idsg.steve.ocpp.ws.data.OcppJsonCall)1 OcppJsonError (de.rwth.idsg.steve.ocpp.ws.data.OcppJsonError)1 OcppJsonMessage (de.rwth.idsg.steve.ocpp.ws.data.OcppJsonMessage)1 OcppJsonResult (de.rwth.idsg.steve.ocpp.ws.data.OcppJsonResult)1