Package org.forgerock.audit.events
Class AuditEventHelper
- java.lang.Object
 - 
- org.forgerock.audit.events.AuditEventHelper
 
 
- 
public final class AuditEventHelper extends Object
Helper methods for AuditEvents. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringARRAY_TYPEJson array value type.static StringBOOLEAN_TYPEJson boolean value type.static StringNUMBER_TYPEJson number value type.static StringOBJECT_TYPEJson Object value type.static StringSTRING_TYPEJson String value type. 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringdotNotationToJsonPointer(String fieldName)Converts dotted-path field identifier to JsonPointer form.static JsonValuegetAuditEventProperties(JsonValue auditEvent)Gets the Audit Event schema properties.static JsonValuegetAuditEventSchema(JsonValue auditEvent)Gets the Audit Event schema.static List<String>getConfiguredAuditEventHandlers(JsonValue auditEvent)Gets the AuditEventHandlers that the audit event is configure to log to.static StringgetPropertyType(JsonValue auditEvent, JsonPointer property)Gets a AuditEvent property type.static booleanisPropertyRequired(JsonValue auditEvent, JsonPointer property)Gets whether a AuditEvent property is required.static StringjsonPointerToDotNotation(String fieldName)Converts JsonPointer field identifier to dotted-path form. 
 - 
 
- 
- 
Field Detail
- 
STRING_TYPE
public static final String STRING_TYPE
Json String value type.- See Also:
 - Constant Field Values
 
 
- 
OBJECT_TYPE
public static final String OBJECT_TYPE
Json Object value type.- See Also:
 - Constant Field Values
 
 
- 
BOOLEAN_TYPE
public static final String BOOLEAN_TYPE
Json boolean value type.- See Also:
 - Constant Field Values
 
 
- 
NUMBER_TYPE
public static final String NUMBER_TYPE
Json number value type.- See Also:
 - Constant Field Values
 
 
- 
ARRAY_TYPE
public static final String ARRAY_TYPE
Json array value type.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
isPropertyRequired
public static boolean isPropertyRequired(JsonValue auditEvent, JsonPointer property)
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
public static List<String> getConfiguredAuditEventHandlers(JsonValue auditEvent)
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
public static JsonValue getAuditEventProperties(JsonValue auditEvent) throws ResourceException
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
public static JsonValue getAuditEventSchema(JsonValue auditEvent) throws ResourceException
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
public static String jsonPointerToDotNotation(String fieldName)
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.
 
 
 - 
 
 -