Class OcppInstructionUtils

java.lang.Object
net.solarnetwork.ocpp.util.OcppInstructionUtils

public final class OcppInstructionUtils extends Object
Utilities for OCPP instruction handling.
Version:
1.0
Author:
matt
  • Field Details

    • OCPP_V16_TOPIC

      public static final String OCPP_V16_TOPIC
      A node instruction topic for OCPP v1.6 actions.
      See Also:
    • OCPP_ACTION_PARAM

      public static final String OCPP_ACTION_PARAM
      A node instruction parameter name for an OCPP action name.
      See Also:
    • OCPP_CHARGER_IDENTIFIER_PARAM

      public static final String OCPP_CHARGER_IDENTIFIER_PARAM
      A node instruction parameter name for an OCPP ChargePoint identifier.
      See Also:
    • OCPP_CHARGE_POINT_ID_PARAM

      public static final String OCPP_CHARGE_POINT_ID_PARAM
      A node instruction parameter name for an OCPP ChargePoint entity ID.
      See Also:
    • OCPP_MESSAGE_PARAM

      public static final String 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 Instruction parameters of a JSON OCPP action message into an OCPP message instance. If params contains a OCPP_MESSAGE_PARAM value, that will be treated as an OCPP JSON message and decoded directly. Otherwise the keys of params will be used as JavaBean style property values for the OCPP message.

      Type Parameters:
      T - the return type
      Parameters:
      objectMapper - the mapper to use
      action - the message action to decode
      params - the instruction parameters
      chargePointActionPayloadDecoder - the action decoder to use
      handler - a handler for the results
      Returns:
      the handler result