org.openmdx.kernel.application.configuration
Class Report

java.lang.Object
  extended by org.openmdx.kernel.application.configuration.Report
Direct Known Subclasses:
ConfigurationValidationReport

public class Report
extends Object

This class holds the results from a configuration verification/validation.


Field Summary
protected  List reports
          verification reports
protected  boolean success
          validation/verification state
protected  boolean warning
          validation/verification state
 
Constructor Summary
Report(String name, VersionNumber version, String context)
          Creates a new validation report object.
 
Method Summary
 void addAll(Report report)
          Include the contents of another report.
 void addError(String message)
          Report an error.
 void addError(String report, Throwable cause)
          Report an error including its cause.
 void addInfo(String message)
          Report an information.
 void addWarning(String message)
          Report a warning.
 void addWarning(String message, Throwable cause)
          Report a warning including its cause.
 String getContext()
          Returns the configuration context.
 String getName()
          Returns the configuration name.
 VersionNumber getVersion()
          Returns the configuration's version.
 boolean hasWarning()
          Returns validation result.
 boolean isSuccess()
          Returns validation result.
 String toString()
          Returns a string representation of the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

success

protected boolean success
validation/verification state


warning

protected boolean warning
validation/verification state


reports

protected final List reports
verification reports

Constructor Detail

Report

public Report(String name,
              VersionNumber version,
              String context)
Creates a new validation report object. It does not contain any reports and the 'valid' flag is set to true.

Parameters:
name - The name of this configuration
context - The name of the context
majorVersion - The major version of the configuration [0,1,2,..]
minorVersion - The minor version of the configuration [0,1,2,..]
Method Detail

isSuccess

public boolean isSuccess()
Returns validation result.

Returns:
true unless addError has been called at least once.
See Also:
addError(java.lang.String), addError(java.lang.String,java.lang.Throwable)

hasWarning

public boolean hasWarning()
Returns validation result.

Returns:
false unless addWarning has been called at least once.
See Also:
addWarning(java.lang.String), addWarning(java.lang.String,java.lang.Throwable)

addError

public void addError(String message)
Report an error. A ConfigurationValidationReport may have any number of reports.

E.g.:


addError

public void addError(String report,
                     Throwable cause)
Report an error including its cause.

Parameters:
report -
cause -

addWarning

public void addWarning(String message)
Report a warning.


addWarning

public void addWarning(String message,
                       Throwable cause)
Report a warning including its cause.

Parameters:
message -
cause -

addInfo

public void addInfo(String message)
Report an information.


addAll

public void addAll(Report report)
Include the contents of another report.

Parameters:
report -

getName

public String getName()
Returns the configuration name.

Returns:
A configuration name string

getContext

public String getContext()
Returns the configuration context.

Returns:
A configuration context string

getVersion

public VersionNumber getVersion()
Returns the configuration's version.

Returns:
the configuration version

toString

public String toString()
Returns a string representation of the report.

Overrides:
toString in class Object
Returns:
a stringified report


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.