Class AuditEvent.AuditEventBuilder
java.lang.Object
com.sodius.oslc.server.audit.model.AuditEvent.AuditEventBuilder
- Enclosing class:
AuditEvent
A builder of audit events.
- Since:
- 3.7.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdds a resource that is affected by the event.Adds an attribute for the event to generate, to help at identifying the context of the event.build()Builds the configured audit event.changedValue(String title, Object from, Object to) Adds a value that was changed along the event, to trace the previous and new values.level(CoverageLevel coverageLevel) Uses the given coverage level for the event to generate.
-
Method Details
-
level
Uses the given coverage level for the event to generate. Default coverage level used by the builder isCoverageLevel.BASE.- Parameters:
coverageLevel- the event coverage level- Returns:
- this builder
- Throws:
NullPointerException- if coverageLevel is null
-
attribute
Adds an attribute for the event to generate, to help at identifying the context of the event.- Parameters:
title- the attribute titlevalue- the attribute value (to convert to a String), which may benull- Returns:
- this builder
- Throws:
NullPointerException- if title is null
-
changedValue
Adds a value that was changed along the event, to trace the previous and new values.- Parameters:
title- the title associated to the valuefrom- the previous value (to convert to a String), which may benullto- the new value (to convert to a String), which may benull- Returns:
- this builder
- Throws:
NullPointerException- if title is null
-
affects
Adds a resource that is affected by the event. The resource must have a label and may have a URI, which the administrator can navigate to, when event is displayed in audit page.- Parameters:
affectedResource- the resource affected by the event- Returns:
- this builder
- Throws:
NullPointerException- if affectedResource or its label is null
-
build
Builds the configured audit event.- Returns:
- an audit event
-