Package net.solarnetwork.ocpp.util
Class OcppInstructionUtils
java.lang.Object
net.solarnetwork.ocpp.util.OcppInstructionUtils
Utilities for OCPP instruction handling.
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAPI for handling the results of decoding a JSON OCPP instruction. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA node instruction parameter name for an OCPP action name.static final StringA node instruction parameter name for an OCPP ChargePoint entity ID.static final StringA node instruction parameter name for an OCPP ChargePoint identifier.static final StringA node instruction parameter name for an OCPP message (e.g.static final StringA node instruction topic for OCPP v1.6 actions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TdecodeJsonOcppInstructionMessage(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ocpp.domain.Action action, Map<String, String> params, ocpp.json.ActionPayloadDecoder chargePointActionPayloadDecoder, OcppInstructionUtils.JsonOcppInstructionMessageHandler<T> handler) Decode a JSON OCPP instruction message.
-
Field Details
-
OCPP_V16_TOPIC
A node instruction topic for OCPP v1.6 actions.- See Also:
-
OCPP_ACTION_PARAM
A node instruction parameter name for an OCPP action name.- See Also:
-
OCPP_CHARGER_IDENTIFIER_PARAM
A node instruction parameter name for an OCPP ChargePoint identifier.- See Also:
-
OCPP_CHARGE_POINT_ID_PARAM
A node instruction parameter name for an OCPP ChargePoint entity ID.- See Also:
-
OCPP_MESSAGE_PARAM
A node instruction parameter name for an OCPP message (e.g. JSON).- See Also:
-
-
Constructor Details
-
OcppInstructionUtils
public OcppInstructionUtils()
-
-
Method Details
-
decodeJsonOcppInstructionMessage
public static <T> T decodeJsonOcppInstructionMessage(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ocpp.domain.Action action, Map<String, String> params, ocpp.json.ActionPayloadDecoder chargePointActionPayloadDecoder, OcppInstructionUtils.JsonOcppInstructionMessageHandler<T> handler) Decode a JSON OCPP instruction message.This method will decode the
Instructionparameters of a JSON OCPP action message into an OCPP message instance. Ifparamscontains aOCPP_MESSAGE_PARAMvalue, that will be treated as an OCPP JSON message and decoded directly. Otherwise the keys ofparamswill be used as JavaBean style property values for the OCPP message.- Type Parameters:
T- the return type- Parameters:
objectMapper- the mapper to useaction- the message action to decodeparams- the instruction parameterschargePointActionPayloadDecoder- the action decoder to usehandler- a handler for the results- Returns:
- the handler result
-