Interface EventBuilder
public interface EventBuilder
Builder interface to create
Event for the EventService to notify HiveMQ Edge of any event regarding
components such as protocol adapters.-
Method Summary
Modifier and TypeMethodDescriptionvoidfire()This method is to be called after populating the builder with information to fire this event via the EventService.withAssociatedObject(@NotNull TypeIdentifier associatedObject) withMessage(@NotNull String message) withPayload(@NotNull Object data) withPayload(Payload.ContentType contentType, @NotNull String content) withSeverity(@NotNull Event.SEVERITY severity) withSource(@NotNull TypeIdentifier source) withTimestamp(@NotNull Long timestamp)
-
Method Details
-
withSeverity
- Parameters:
severity- the severity of the event- Returns:
- the builder for a fluent api
-
withMessage
- Parameters:
message- the message of the event- Returns:
- the builder for a fluent api
-
withPayload
@NotNull @NotNull EventBuilder withPayload(@NotNull Payload.ContentType contentType, @NotNull @NotNull String content) - Parameters:
contentType- the content type of the payloadcontent- the content of the payload- Returns:
- the builder for a fluent api
-
withPayload
- Parameters:
data- a Jackson annotated Object from which the object mapper creates a json from.- Returns:
- the builder for a fluent api
-
withTimestamp
- Parameters:
timestamp- the unix timestamp of this event- Returns:
- the builder for a fluent api
-
withAssociatedObject
@NotNull @NotNull EventBuilder withAssociatedObject(@NotNull @NotNull TypeIdentifier associatedObject) - Parameters:
associatedObject- the type identifier of the associated object for this event- Returns:
- the builder for a fluent api
-
withSource
- Parameters:
source- the type identifier of the source of this evemt- Returns:
- the builder for a fluent api
-
fire
void fire()This method is to be called after populating the builder with information to fire this event via the EventService.
-