Class AuditLog

  • Direct Known Subclasses:
    OMRSAuditLog

    public class AuditLog
    extends MessageFormatter
    AuditLog is the superclass of audit log implementations. It is concrete and so can be used directly as well.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AuditLog.AuditLogActivity
      Count up the number of records of each severity logged by a component.
    • Constructor Summary

      Constructors 
      Constructor Description
      AuditLog​(AuditLogDestination destination, int componentId, ComponentDevelopmentStatus componentDevelopmentStatus, java.lang.String componentName, java.lang.String componentDescription, java.lang.String componentWikiURL)
      Typical constructor: each component using the audit log will create their own AuditLog instance and will push log records to it.
      AuditLog​(AuditLogDestination destination, ComponentDescription reportingComponent)
      Constructor used to create the root audit log for a process/server
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AuditLog createNewAuditLog​(int componentId, ComponentDevelopmentStatus componentDevelopmentStatus, java.lang.String componentName, java.lang.String componentDescription, java.lang.String componentWikiURL)
      Clone request is used to create an audit log for a component outside the OMRS.
      AuditLog createNewAuditLog​(ComponentDescription childComponent)
      Constructor used to create the root audit log for OMRS
      java.util.Map<java.lang.String,​java.lang.String> getOriginatorProperties()
      Return the map of properties used to describe the originator process/server.
      AuditLogReport getReport()
      Return a report describing the audit log's properties and activity.
      void logException​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition, java.lang.String additionalInformation, java.lang.Throwable caughtException)
      Log an audit log message associated with a caught exception.
      void logException​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition, java.lang.Throwable caughtException)
      Log an audit log message associated with a caught exception.
      void logException​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition, java.util.List<java.lang.String> additionalInformation, java.lang.Throwable caughtException)
      Log an audit log message associated with a caught exception.
      void logMessage​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition)
      Log an audit log message.
      void logMessage​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition, java.lang.String additionalInformation)
      Log an audit log message.
      void logMessage​(java.lang.String actionDescription, AuditLogMessageDefinition messageDefinition, java.util.List<java.lang.String> additionalInformation)
      Log an audit log message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuditLog

        public AuditLog​(AuditLogDestination destination,
                        int componentId,
                        ComponentDevelopmentStatus componentDevelopmentStatus,
                        java.lang.String componentName,
                        java.lang.String componentDescription,
                        java.lang.String componentWikiURL)
        Typical constructor: each component using the audit log will create their own AuditLog instance and will push log records to it.
        Parameters:
        destination - destination for the log records
        componentId - numerical identifier for the component
        componentDevelopmentStatus - development status
        componentName - display name for the component
        componentDescription - description of the component
        componentWikiURL - link to more information
      • AuditLog

        public AuditLog​(AuditLogDestination destination,
                        ComponentDescription reportingComponent)
        Constructor used to create the root audit log for a process/server
        Parameters:
        destination - new logging destination
        reportingComponent - information about the component that will use this instance of the audit log.
    • Method Detail

      • createNewAuditLog

        public AuditLog createNewAuditLog​(int componentId,
                                          ComponentDevelopmentStatus componentDevelopmentStatus,
                                          java.lang.String componentName,
                                          java.lang.String componentDescription,
                                          java.lang.String componentWikiURL)
        Clone request is used to create an audit log for a component outside the OMRS.
        Parameters:
        componentId - numerical identifier for the component
        componentDevelopmentStatus - development status
        componentName - display name for the component
        componentDescription - description of the component
        componentWikiURL - link to more information
        Returns:
        new logging destination
      • createNewAuditLog

        public AuditLog createNewAuditLog​(ComponentDescription childComponent)
        Constructor used to create the root audit log for OMRS
        Parameters:
        childComponent - information about the component that will use this instance of the audit log.
        Returns:
        new logging destination
      • logMessage

        public void logMessage​(java.lang.String actionDescription,
                               AuditLogMessageDefinition messageDefinition)
        Log an audit log message.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
      • logMessage

        public void logMessage​(java.lang.String actionDescription,
                               AuditLogMessageDefinition messageDefinition,
                               java.lang.String additionalInformation)
        Log an audit log message.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
        additionalInformation - supporting information
      • logMessage

        public void logMessage​(java.lang.String actionDescription,
                               AuditLogMessageDefinition messageDefinition,
                               java.util.List<java.lang.String> additionalInformation)
        Log an audit log message.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
        additionalInformation - supporting information
      • logException

        public void logException​(java.lang.String actionDescription,
                                 AuditLogMessageDefinition messageDefinition,
                                 java.lang.Throwable caughtException)
        Log an audit log message associated with a caught exception.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
        caughtException - the exception associated with the message
      • logException

        public void logException​(java.lang.String actionDescription,
                                 AuditLogMessageDefinition messageDefinition,
                                 java.lang.String additionalInformation,
                                 java.lang.Throwable caughtException)
        Log an audit log message associated with a caught exception.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
        additionalInformation - supporting information
        caughtException - the exception associated with the message
      • logException

        public void logException​(java.lang.String actionDescription,
                                 AuditLogMessageDefinition messageDefinition,
                                 java.util.List<java.lang.String> additionalInformation,
                                 java.lang.Throwable caughtException)
        Log an audit log message associated with a caught exception.
        Parameters:
        actionDescription - short description of the activity
        messageDefinition - message content to log
        additionalInformation - supporting information
        caughtException - the exception associated with the message
      • getOriginatorProperties

        public java.util.Map<java.lang.String,​java.lang.String> getOriginatorProperties()
        Return the map of properties used to describe the originator process/server.
        Returns:
        map of name-value pairs
      • getReport

        public AuditLogReport getReport()
        Return a report describing the audit log's properties and activity.
        Returns:
        audit log report structure