Class AuditEvent.AuditEventBuilder
- java.lang.Object
-
- com.sodius.oslc.server.audit.model.AuditEvent.AuditEventBuilder
-
- Enclosing class:
- AuditEvent
public static class AuditEvent.AuditEventBuilder extends Object
A builder of audit events.- Since:
- 3.7.0
- See Also:
AuditEvent.builder(String)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuditEvent.AuditEventBuilder
affects(Link affectedResource)
Adds a resource that is affected by the event.AuditEvent.AuditEventBuilder
attribute(String title, Object value)
Adds an attribute for the event to generate, to help at identifying the context of the event.AuditEvent
build()
Builds the configured audit event.AuditEvent.AuditEventBuilder
changedValue(String title, Object from, Object to)
Adds a value that was changed along the event, to trace the previous and new values.AuditEvent.AuditEventBuilder
level(CoverageLevel coverageLevel)
Uses the given coverage level for the event to generate.
-
-
-
Method Detail
-
level
public AuditEvent.AuditEventBuilder level(CoverageLevel coverageLevel)
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
public AuditEvent.AuditEventBuilder attribute(String title, Object value)
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
public AuditEvent.AuditEventBuilder changedValue(String title, Object from, Object to)
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 benull
to
- the new value (to convert to a String), which may benull
- Returns:
- this builder
- Throws:
NullPointerException
- if title is null
-
affects
public AuditEvent.AuditEventBuilder affects(Link affectedResource)
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
public AuditEvent build()
Builds the configured audit event.- Returns:
- an audit event
-
-