Interface RecordMessage

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addLatencyChainPoint​(java.lang.String pointName, java.time.Instant instant)
      Adds a latency chain point
      void clearFields()
      Removes all the fields previously added to this RecordMessage
      boolean containsField​(java.lang.String fieldName)
      Determines whether the message contains the specified field
      java.lang.String getField​(java.lang.String fieldName)
      Gets the value of the specified field.
      java.util.List<Field> getFields()
      Gets the fields within this RecordMessage, in the order of which the fields were sent.
      void removeField​(java.lang.String fieldName)
      Removes all occurrences given field from this RecordMessage.
      void setField​(java.lang.String fieldName, java.lang.String value)
      Sets a field value.
      void setInitialLatencyChainTime​(java.time.Instant instant)
      Starts a latency chain if enabled using the latencyChainManager configuration option.
    • Method Detail

      • clearFields

        void clearFields()
        Removes all the fields previously added to this RecordMessage
      • containsField

        boolean containsField​(java.lang.String fieldName)
        Determines whether the message contains the specified field
        Parameters:
        fieldName - Name of the field.
        Returns:
        true if the message contains the field, otherwise, false.
      • getFields

        java.util.List<Field> getFields()
        Gets the fields within this RecordMessage, in the order of which the fields were sent. This can include duplicate field names for different values.
        Returns:
        A read-only list of the fields.
      • setField

        void setField​(java.lang.String fieldName,
                      java.lang.String value)

        Sets a field value.

         

        If the field does not exist in this RecordMessage, the field is added to it. Otherwise the existing occurrence of the field is updated to the new value.

        Parameters:
        fieldName - The name of the field.
        value - The new value of the field.
        Throws:
        java.lang.IllegalArgumentException - Raised when the fieldName is not defined in the Fields configuration file.
      • getField

        java.lang.String getField​(java.lang.String fieldName)

        Gets the value of the specified field. If the field does not exist in this RecordMessage, null is returned.

        Parameters:
        fieldName - The name of the field to get.
        Returns:
        The value of the field with the name fieldName, or null if there is no such field in this RecordMessage.
        Throws:
        java.lang.IllegalArgumentException - Raised when the fieldName is not defined in the Fields configuration file.
      • removeField

        void removeField​(java.lang.String fieldName)
        Removes all occurrences given field from this RecordMessage.
        Parameters:
        fieldName - The name of the field to remove.
      • setInitialLatencyChainTime

        void setInitialLatencyChainTime​(java.time.Instant instant)

        Starts a latency chain if enabled using the latencyChainManager configuration option.

        Parameters:
        instant - The first time in the latency chain as a Java Instant. This could be: the time the data was created; the time the data entered the DataSource adaptor; or the time the data entered the DataSource API. The time is of the same form as the value of Instant.now().
        Throws:
        java.lang.IllegalStateException - Raised when called twice on the same RecordMessage instance.
      • addLatencyChainPoint

        void addLatencyChainPoint​(java.lang.String pointName,
                                  java.time.Instant instant)

        Adds a latency chain point

        Parameters:
        pointName - The name associated with the latency measurement.
        instant - The timestamp as a Java Instant. The time is of the same form as the value of Instant.now().
        Throws:
        java.lang.IllegalStateException - Raised when the initial timestamp has not be initialised.