use of de.rwth.idsg.steve.ocpp.ws.data.ActionResponsePair in project steve by RWTH-i5-IDSG.
the class AbstractChargePointServiceInvoker method run.
/**
* Actual processing
*/
private void run(String chargeBoxId, CommunicationTask task) {
RequestType request = task.getRequest();
String messageId = UUID.randomUUID().toString();
ActionResponsePair pair = typeStore.findActionResponse(request);
if (pair == null) {
throw new SteveException("Action name is not found");
}
OcppJsonCall call = new OcppJsonCall();
call.setMessageId(messageId);
call.setPayload(request);
call.setAction(pair.getAction());
FutureResponseContext frc = new FutureResponseContext(task, pair.getResponseClass());
CommunicationContext context = new CommunicationContext(endpoint.getSession(chargeBoxId), chargeBoxId);
context.setOutgoingMessage(call);
context.setFutureResponseContext(frc);
outgoingCallPipeline.accept(context);
}
use of de.rwth.idsg.steve.ocpp.ws.data.ActionResponsePair in project steve by RWTH-i5-IDSG.
the class TypeStoreTest method ocpp15Test.
@Test
public void ocpp15Test() {
ActionResponsePair actionResponse = Ocpp15TypeStore.INSTANCE.findActionResponse(new ocpp.cp._2012._06.UpdateFirmwareRequest());
Assert.assertNotNull(actionResponse);
Assert.assertEquals("UpdateFirmware", actionResponse.getAction());
Assert.assertEquals(ocpp.cp._2012._06.UpdateFirmwareResponse.class, actionResponse.getResponseClass());
}
use of de.rwth.idsg.steve.ocpp.ws.data.ActionResponsePair in project steve by RWTH-i5-IDSG.
the class TypeStoreTest method ocpp12Test.
@Test
public void ocpp12Test() {
ActionResponsePair actionResponse = Ocpp12TypeStore.INSTANCE.findActionResponse(new ocpp.cp._2010._08.ResetRequest());
Assert.assertNotNull(actionResponse);
Assert.assertEquals("Reset", actionResponse.getAction());
Assert.assertEquals(ocpp.cp._2010._08.ResetResponse.class, actionResponse.getResponseClass());
}
Aggregations