Class AuditEventHelper


  • public final class AuditEventHelper
    extends Object
    Helper methods for AuditEvents.
    • 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.
      • dotNotationToJsonPointer

        public static String dotNotationToJsonPointer​(String fieldName)
        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.