Package org.forgerock.audit.events
Class AuditEventHelper
java.lang.Object
org.forgerock.audit.events.AuditEventHelper
Helper methods for AuditEvents.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
dotNotationToJsonPointer
(String fieldName) Converts dotted-path field identifier to JsonPointer form.static JsonValue
getAuditEventProperties
(JsonValue auditEvent) Gets the Audit Event schema properties.static JsonValue
getAuditEventSchema
(JsonValue auditEvent) Gets the Audit Event schema.getConfiguredAuditEventHandlers
(JsonValue auditEvent) Gets the AuditEventHandlers that the audit event is configure to log to.static String
getPropertyType
(JsonValue auditEvent, JsonPointer property) Gets a AuditEvent property type.static boolean
isPropertyRequired
(JsonValue auditEvent, JsonPointer property) Gets whether a AuditEvent property is required.static String
jsonPointerToDotNotation
(String fieldName) Converts JsonPointer field identifier to dotted-path form.
-
Field Details
-
STRING_TYPE
Json String value type.- See Also:
-
OBJECT_TYPE
Json Object value type.- See Also:
-
BOOLEAN_TYPE
Json boolean value type.- See Also:
-
NUMBER_TYPE
Json number value type.- See Also:
-
ARRAY_TYPE
Json array value type.- See Also:
-
-
Method Details
-
isPropertyRequired
Gets whether a AuditEvent property is required.- Parameters:
auditEvent
- the audit event to get the property of.property
- the property to check if required.- Returns:
- true if the property is required; false otherwise.
-
getPropertyType
public static String getPropertyType(JsonValue auditEvent, JsonPointer property) throws ResourceException Gets a AuditEvent property type.- Parameters:
auditEvent
- the audit event to get the property of.property
- the property to check if required.- Returns:
- true if the property is required; false otherwise.
- Throws:
ResourceException
- if the property is unknown
-
getConfiguredAuditEventHandlers
Gets the AuditEventHandlers that the audit event is configure to log to.- Parameters:
auditEvent
- the audit event JsonValue definition.- Returns:
- List of audit event handler names to log to.
-
getAuditEventProperties
Gets the Audit Event schema properties.- Parameters:
auditEvent
- the audit event JsonValue definition.- Returns:
- JsonValue containing all the properties for the audit event.
- Throws:
ResourceException
- if no audit event is defined
-
getAuditEventSchema
Gets the Audit Event schema.- Parameters:
auditEvent
- the audit event JsonValue definition.- Returns:
- JsonValue containing the schema object for the audit event.
- Throws:
ResourceException
- if no audit event is defined
-
jsonPointerToDotNotation
Converts JsonPointer field identifier to dotted-path form.- Parameters:
fieldName
- The JsonPointer reference to a field within a JSON object.- Returns:
- The field name in dotted-path form.
-
dotNotationToJsonPointer
Converts dotted-path field identifier to JsonPointer form.- Parameters:
fieldName
- The dotted-path reference to a field within a JSON object.- Returns:
- The field name in JsonPointer form.
-