Package com.hazelcast.auditlog
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 Summary
Modifier and TypeMethodDescriptionaddParameter
(String key, Object value) Adds single event parameter to the parameters Map.build()
Builds theAuditableEvent
instance.Sets error/exception which caused the event (if any).Sets the eventLevel
.void
log()
Builds the event and logs it to the service which provided this builder (if any).parameters
(Map<String, Object> parameters) timestamp
(long timestamp) If provided value greater than zero, then it sets the event timestamp explicitly.
-
Method Details
-
message
- Parameters:
message
- event message. May benull
- Returns:
- this instance
-
parameters
- Parameters:
parameters
- event parameters. Must not benull
- Returns:
- this instance
-
addParameter
Adds single event parameter to the parameters Map.- Parameters:
key
- Must not benull
value
-- Returns:
- this instance
-
level
Sets the eventLevel
. The default value isLevel.INFO
.- Parameters:
level
-- Returns:
- this instance
-
cause
Sets error/exception which caused the event (if any).- Parameters:
throwable
-- Returns:
- this instance
-
timestamp
If provided value greater than zero, then it sets the event timestamp explicitly. Otherwise the timestamp is filled by callingbuild()
method.- Parameters:
throwable
-- Returns:
- this instance
-
build
AuditableEvent build()Builds theAuditableEvent
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:
-