T
- the type of the builderpublic class ConfigAuditEventBuilder<T extends ConfigAuditEventBuilder<T>> extends AuditEventBuilder<T>
This builder should not be used directly but be specialized for each product to allow to define new specific fields, e.g
class OpenProductConfigAuditEventBuilder <T extends OpenProductConfigAuditEventBuilder<T>>
extends ConfigAuditEventBuilder <T>
{
public static <T>
OpenProductConfigAuditEventBuilder <?>
productConfigEvent() {
return new OpenProductConfigAuditEventBuilder();
}
public T someField(String v) {
jsonValue.put("someField", v);
return self();
}
...
}
Modifier and Type | Field and Description |
---|---|
static String |
AFTER |
static String |
BEFORE |
static String |
CHANGED_FIELDS |
static String |
OBJECT_ID |
static String |
OPERATION |
static String |
REVISION |
static String |
RUN_AS |
EVENT_NAME, jsonValue, TIMESTAMP, TRACKING_IDS, TRANSACTION_ID, USER_ID
Modifier | Constructor and Description |
---|---|
protected |
ConfigAuditEventBuilder()
Creates the builder.
|
Modifier and Type | Method and Description |
---|---|
T |
after(JsonValue state)
Records the new state of the modified object as JSON.
|
T |
after(String state)
Records the new state of the modified object as a String.
|
T |
before(JsonValue state)
Records the previous state of the modified object as JSON.
|
T |
before(String state)
Records the previous state of the modified object as a String.
|
T |
changedFields(String... fieldNames)
Sets the list of fields that were changed by this update.
|
static ConfigAuditEventBuilder<?> |
configEvent()
Starts to build an audit config event.
|
T |
objectId(String objectId)
Sets the provided objectId for the event.
|
T |
objectIdFromCrestRequest(Request request)
Sets objectId method from
Request . |
T |
operation(String operation)
Sets the provided operation for the event.
|
T |
operationFromCrestRequest(Request request)
Sets operation method from
Request . |
T |
revision(String newRevision)
Sets the revision for the event.
|
T |
runAs(String id)
Sets the provided runAs for the event.
|
protected void |
setDefaults()
Called by
AuditEventBuilder.toEvent() to allow any unset fields to be given their default value. |
protected void |
validate()
Called by
AuditEventBuilder.toEvent() to ensure that the audit event will be created in a valid state. |
eventName, requireField, self, timestamp, toEvent, trackingId, trackingIds, transactionId, transactionIdFromContext, userId
public static final String RUN_AS
public static final String OBJECT_ID
public static final String OPERATION
public static final String BEFORE
public static final String AFTER
public static final String REVISION
public static final String CHANGED_FIELDS
public static ConfigAuditEventBuilder<?> configEvent()
Note: it is preferable to use a specialized builder that allow to add fields specific to a product.
protected void setDefaults()
AuditEventBuilder.toEvent()
to allow any unset fields to be given their default value.
When overriding this method, the super class implementation must be called.setDefaults
in class AuditEventBuilder<T extends org.forgerock.audit.events.StateChangeAuditEventBuilder<T>>
protected void validate()
AuditEventBuilder.toEvent()
to ensure that the audit event will be created in a valid state.
When overriding this method, the super class implementation must be called.validate
in class AuditEventBuilder<T extends org.forgerock.audit.events.StateChangeAuditEventBuilder<T>>
public final T runAs(String id)
id
- the id of user this operation was performed as.public final T objectId(String objectId)
objectId
- the resource identifier.public final T operation(String operation)
operation
- the type of operation (e.g. CREATE, READ, UPDATE, DELETE, PATCH, QUERY, or the ACTION name).public final T before(String state)
state
- A String representation of the object's previous state.public final T before(JsonValue state)
state
- A JSON representation of the object's previous state.public final T after(String state)
state
- A String representation of the object's new state.public final T after(JsonValue state)
state
- A JSON representation of the object's new state.public final T revision(String newRevision)
newRevision
- resulting revision of the affected object.public final T changedFields(String... fieldNames)
fieldNames
- of the object that were updated.public final T objectIdFromCrestRequest(Request request)
Request
.request
- The CREST request.Copyright © 2025 Open Identity Platform Community. All rights reserved.