Class InitializationReport

java.lang.Object
com.aquima.interactions.foundation.report.InitializationReport
All Implemented Interfaces:
IInitializationReport, Serializable

public class InitializationReport extends Object implements IInitializationReport
This class is used to gather all the error and warning messages that are detected during the initialization of an application.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • InitializationReport

      public InitializationReport()
    • InitializationReport

      public InitializationReport(ErrorCode code, String[] parameters)
      Constructs an initialisation report.
      Parameters:
      code - The error code of the initialisation report.
      parameters - The parameters of the code.
  • Method Details

    • hasMessages

      public boolean hasMessages()
      Description copied from interface: IInitializationReport
      This method returns a boolean indicating if any messages have been added to the report.
      Specified by:
      hasMessages in interface IInitializationReport
      Returns:
      a boolean indicating if any messages have been added to the report.
    • addMessage

      public void addMessage(Category category, ErrorCode code, String[] parameters, Severity severity)
      Description copied from interface: IInitializationReport
      This method will add an initialisation error to the report for the specified error code and parameters, but may optionally choose to re-throw the initialisation error if it is deemed too severe in the current context.
      Specified by:
      addMessage in interface IInitializationReport
      Parameters:
      category - The category (component) where the message originated from.
      code - Error code identifying the message.
      parameters - array of parameters for the message.
      severity - The severity of the message.
    • addMessage

      public void addMessage(Category category, ErrorCode code, String[] parameters, Severity severity, Throwable cause)
      Description copied from interface: IInitializationReport
      This method will add an initialisation error to the report for the specified error code and parameters, but may optionally choose to re-throw the initialisation error if it is deemed too severe in the current context. In addition a cause can be added in case of spurious errors.
      Specified by:
      addMessage in interface IInitializationReport
      Parameters:
      category - The category (component) where the message originated from.
      code - Error code identifying the message.
      parameters - array of parameters for the message.
      severity - The severity of the message.
      cause - The exception which causes the error which is added to the report.
    • getMessages

      public InitializationMessage[] getMessages(Severity severity)
      Description copied from interface: IInitializationReport
      This method returns an array containing all the messages of the requested severity. If no messages with the requested severity are found, an empty array is returned.
      Specified by:
      getMessages in interface IInitializationReport
      Parameters:
      severity - The severity of the requested messages.
      Returns:
      an array containing all the messages of the requested severity.
    • getMessageCount

      public int getMessageCount(Severity severity)
      Description copied from interface: IInitializationReport
      This method returns the number of messages with the requested severity.
      Specified by:
      getMessageCount in interface IInitializationReport
      Parameters:
      severity - The severity of the requested message count.
      Returns:
      the number of messages with the requested severity.
    • getMessageCount

      public int getMessageCount()
      Description copied from interface: IInitializationReport
      This method returns the total number of messages that is present in the report.
      Specified by:
      getMessageCount in interface IInitializationReport
      Returns:
      the total number of messages that is present in the report.
    • getFatalCount

      public int getFatalCount()
      This method returns the number of messages with the Severity FATAL that are present in the report.
      Returns:
      the number of messages with the Severity FATAL that are present in the report.
    • getErrorCount

      public int getErrorCount()
      This method returns the number of messages with the Severity ERROR that are present in the report.
      Returns:
      the number of messages with the Severity ERROR that are present in the report.
    • getDeprecationCount

      public int getDeprecationCount()
      This method returns the number of messages with the Severity DEPRECATION that are present in the report.
      Returns:
      the number of messages with the Severity DEPRECATION that are present in the report.
    • getExperimentalCount

      public int getExperimentalCount()
      This method returns the number of messages with the Severity EXPERIMENTAL that are present in the report
      Returns:
      the number of messages with the Severity EXPERIMENTAL that are present in the report
    • getWarningCount

      public int getWarningCount()
      This method returns the number of messages with the Severity WARNING that are present in the report.
      Returns:
      the number of messages with the Severity WARNING that are present in the report.
    • getSeverities

      public Severity[] getSeverities()
      This method returns an array containing the severities of the messages in the report.
      Returns:
      an array containing the severities of the messages in the report.
    • toXml

      public IXmlElement toXml()
      Description copied from interface: IInitializationReport
      This method returns an XML representation of the report.
      Specified by:
      toXml in interface IInitializationReport
      Returns:
      an XML representation of the report.
    • getSeverityXml

      protected IXmlElement getSeverityXml(Severity severity)
    • getMessageXml

      protected IXmlElement getMessageXml(InitializationMessage message)
    • getRootMessage

      public InitializationMessage getRootMessage()
      Description copied from interface: IInitializationReport
      This message returns the first explaining message of the initialization report, possibly this message has children which results in a nesting tree of messages.
      Specified by:
      getRootMessage in interface IInitializationReport
      Returns:
      The root message of the initialisation report.
    • endScope

      public void endScope(int scopeId)
      Description copied from interface: IInitializationReport
      This method ends the scope of the initialisation report.
      Specified by:
      endScope in interface IInitializationReport
      Parameters:
      scopeId - The unique id which was retrieved by the beginscope call.
    • beginScope

      public int beginScope(Category category, ErrorCode code, String[] parameters)
      Description copied from interface: IInitializationReport
      This method starts a new initialisation report scope, when error's are added during the time this scope is active initialisation messages are nested within an initialisation message of the given code. Using this structure gives the initialisation messages a tree like structure.
      Specified by:
      beginScope in interface IInitializationReport
      Parameters:
      category - The category (component) where the message/scope originated from.
      code - The code of the initialisation message which is used only if an initialisation message is added.
      parameters - array of parameters for the message.
      Returns:
      A unique identifier which can be used to end the current scope.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addReport

      public void addReport(IInitializationReport other)
      Specified by:
      addReport in interface IInitializationReport