Class ValueMapper

java.lang.Object
org.eso.ias.converter.ValueMapper
All Implemented Interfaces:
Function<String,String>

public class ValueMapper extends Object implements Function<String,String>
The function to convert a string received from a plugin (i.e. a MonitorPointData) to a value to send to the core of the AIS (i.e. a IASValue.

If something went wrong during the mapping, the exception is masked and a log issued for investigation. In that case the received monitor point is lost.

Author:
acaproni
  • Field Details

    • logger

      public static final org.slf4j.Logger logger
      The logger
  • Constructor Details

    • ValueMapper

      public ValueMapper(IasioConfigurationDAO configDao, IasValueStringSerializer iasValueStrSerializer, String converterID)
      Constructor
      Parameters:
      configDao - The DAO to get the configuration of monitor points
      iasValueStrSerializer - The serializer to transform a IASValue in the proper string
      converterID - The identifier of the converter
  • Method Details

    • translate

      public IASValue<?> translate(org.eso.ias.types.Identifier identifier, MonitorPointData remoteSystemData, IASTypes type, long receptionTStamp, Optional<Integer> minTemplateIndex, Optional<Integer> maxTemplateIndex)
      Convert the MonitorPointData received by a plugin to a IASValue to send to the core of the IAS
      Parameters:
      identifier - : the Identifier of the monitor point
      remoteSystemData - the monitor point to translate
      type - the type of the monitor point
      receptionTStamp - the timestamp when the monitor point data has been received
      Returns:
      the IASValue corresponding on the monitor point
    • getId

      public String getId(org.eso.ias.types.Identifier identifier)
      Get the id taking template into account
      Parameters:
      identifier - The identifier
      Returns:
      the ID cleaned of the template index
    • apply

      public String apply(String mpString)
      Effectively translate the string received from the plugin in the string to send to the core of the IAS
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      mpString - The string received from the plugin
      See Also: