com.bea.wli.config.resource
Class Diagnostics

java.lang.Object
  extended by com.bea.wli.config.resource.Diagnostics
All Implemented Interfaces:
Serializable

public class Diagnostics
extends Object
implements Serializable

Container for a collection of Diagnostic entries relevant to a particular resource.

See Also:
Serialized Form

Constructor Summary
Diagnostics(Ref ref)
          Constructor for creating a Diagnostics object with an empty collection of Diagnostic objects.
Diagnostics(Ref ref, Collection<Diagnostic> diagnostics)
          Constructor for creating a Diagnostics object with the given initial set of Diagnostic object.
 
Method Summary
 void add(Diagnostic d)
          Add a diagnostic.
 void addAll(Collection<Diagnostic> dlist)
          add a list of diagnostic objects.
 Set<Diagnostic> getDiagnostics()
          Returns an immutable view of all diagnostic objects contained
 Diagnostic getFirstError()
          returns the first diagnostic entry whose severity is either Diagnostic.Severity.CannotCommit or Diagnostic.Severity.CannotCreate.
 Ref getRef()
          returns the reference for the resource which this diagnostics relate to
 Diagnostic.Severity getSeverity()
          Returns the aggregated severity of all the diagnostic objects contained.
 String toString()
          Returns a string representation of this diagnostics object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Diagnostics

public Diagnostics(Ref ref)
Constructor for creating a Diagnostics object with an empty collection of Diagnostic objects.

Parameters:
ref - the reference to the resource which this collection of diagnostics relate to. Cannot be null. This method does not check the existence of the given resource.

Diagnostics

public Diagnostics(Ref ref,
                   Collection<Diagnostic> diagnostics)
Constructor for creating a Diagnostics object with the given initial set of Diagnostic object. More diagnostic objects can be added via the add(com.bea.wli.config.resource.Diagnostic) method.

Parameters:
ref - the reference to the resource which this collection of diagnostics relate to. Cannot be null. This method does not check the existence of the given resource.
diagnostics - initial collection of diagnostics. Cannot be null. A copy of this collection is used. Therefore unmodifiable collections can be passed.
Method Detail

getSeverity

public Diagnostic.Severity getSeverity()
Returns the aggregated severity of all the diagnostic objects contained.

See Also:
Diagnostic.Severity.combine(com.bea.wli.config.resource.Diagnostic.Severity, com.bea.wli.config.resource.Diagnostic.Severity)

add

public void add(Diagnostic d)
Add a diagnostic. The aggregate severity of this container is properly adjusted.

Parameters:
d -

addAll

public void addAll(Collection<Diagnostic> dlist)
add a list of diagnostic objects.

Parameters:
dlist -

getDiagnostics

public Set<Diagnostic> getDiagnostics()
Returns an immutable view of all diagnostic objects contained


getFirstError

public Diagnostic getFirstError()
returns the first diagnostic entry whose severity is either Diagnostic.Severity.CannotCommit or Diagnostic.Severity.CannotCreate. If there is no such entry, returns null.


getRef

public Ref getRef()
returns the reference for the resource which this diagnostics relate to


toString

public String toString()
Returns a string representation of this diagnostics object

Overrides:
toString in class Object