Class RuleUtils

java.lang.Object
com.framed.arn.RuleUtils

public final class RuleUtils extends Object
Runtime helpers shared by Reactor and its concrete implementations: extracting a logical timestamp from an incoming message and publishing a result envelope to a reactor's output channels.
  • Method Details

    • publishResult

      public static void publishResult(EventBus eventBus, Object value, String id, List<String> outputChannels, Instant timestamp)
      Publishes a result envelope (timestamp, className, value, channelID) to each output channel and announces those channels so sinks can discover them.
      Parameters:
      eventBus - the bus to publish on
      value - the result value
      id - the producing reactor's classification id
      outputChannels - channels to publish the result to
      timestamp - the logical timestamp of the result
    • extractTimestamp

      public static Instant extractTimestamp(Object latest)
      Parses the logical timestamp from an incoming message, if present.
      Parameters:
      latest - the latest message for a channel (expected to be a JSONObject)
      Returns:
      the parsed Instant, or null if absent/unparseable