Interface EventBuilder<T extends EventBuilder<T>>

Type Parameters:
T - builder type

public interface EventBuilder<T extends EventBuilder<T>>
Builder interface for AuditableEvent instances. The mandatory typeId is expected to be initiated by constructing the builder.

Warning: The text message and object parameters may provide more details about the event, but Hazelcast doesn't guarantee their content (e.g. exact text value of the message, parameter names, object types used in parameters). They can change between versions.

See Also:
  • Method Details

    • message

      T message(String message)
      Parameters:
      message - event message. May be null
      Returns:
      this instance
    • parameters

      T parameters(Map<String,Object> parameters)
      Parameters:
      parameters - event parameters. Must not be null
      Returns:
      this instance
    • addParameter

      T addParameter(String key, Object value)
      Adds single event parameter to the parameters Map.
      Parameters:
      key - Must not be null
      Returns:
      this instance
    • level

      T level(Level level)
      Sets the event Level. The default value is Level.INFO.
      Returns:
      this instance
    • cause

      T cause(Throwable throwable)
      Sets error/exception which caused the event (if any).
      Returns:
      this instance
    • timestamp

      T timestamp(long timestamp)
      If provided value greater than zero, then it sets the event timestamp explicitly. Otherwise, the timestamp is filled by calling build() method.
      Returns:
      this instance
    • build

      Builds the AuditableEvent instance. If the timestamp is not configured explicitly, then the call sets event timestamp too.
      Returns:
      not-null event instance ready to be logged
    • log

      void log()
      Builds the event and logs it to the service which provided this builder (if any).
      See Also: