uws.job
Class ErrorSummary

java.lang.Object
  extended by uws.job.SerializableUWSObject
      extended by uws.job.ErrorSummary
All Implemented Interfaces:
java.io.Serializable

public class ErrorSummary
extends SerializableUWSObject

This class gives a short description of the occurred error (if any) during a job execution. A fuller representation of the error may be retrieved from {jobs}/(job-id)/error.

Version:
02/2011
Author:
Grégory Mantelet (CDS)
See Also:
Serialized Form

Field Summary
protected  java.lang.String details
          [Optional] The URI/URL toward the file which contains a more detailed description of the error (i.e. an Exception stack trace).
protected  java.lang.String message
          [Required] A short description of the error.
protected  ErrorType type
          [Required] The type of the error.
 
Constructor Summary
ErrorSummary(java.lang.Exception ex, ErrorType errorType, java.lang.String detailedMsgURI)
          Builds an error summary from an Exception.
ErrorSummary(java.lang.Exception ex, ErrorType errorType, java.net.URL detailedMsg)
          Deprecated. Replaced by ErrorSummary(Exception, ErrorType, String)
ErrorSummary(java.lang.String msg, ErrorType errorType)
          Builds an error summary with the given short description.
ErrorSummary(java.lang.String msg, ErrorType errorType, java.lang.String detailedMsgURI)
          Builds an error summary with the given short description and with the URL to access to a detailed description.
ErrorSummary(java.lang.String msg, ErrorType errorType, java.net.URL detailedMsg)
          Deprecated. Replaced by ErrorSummary(String, ErrorType, String)
 
Method Summary
 java.lang.String getDetails()
          Gets the URI/URL where the details about the occurred error can be found.
 java.lang.String getMessage()
          Gets a short description of the occurred error.
 ErrorType getType()
          Gets the type of the occurred error (ErrorType.FATAL by default).
 boolean hasDetail()
          Indicates whether there are more details about the occurred error.
 java.lang.String serialize(UWSSerializer serializer, java.lang.String ownerId)
          Serializes the whole object considering the given owner ID (supposed to be the ID of the current user) and thanks to the given serializer.
 java.lang.String toString()
           
 
Methods inherited from class uws.job.SerializableUWSObject
serialize, serialize, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

message

protected java.lang.String message
[Required] A short description of the error.


type

protected ErrorType type
[Required] The type of the error.


details

protected java.lang.String details
[Optional] The URI/URL toward the file which contains a more detailed description of the error (i.e. an Exception stack trace).

Constructor Detail

ErrorSummary

public ErrorSummary(java.lang.Exception ex,
                    ErrorType errorType,
                    java.lang.String detailedMsgURI)

Builds an error summary from an Exception.

WARNING: No file is written: that is the responsibility of the creator of this error summary !

Parameters:
ex - The Exception which describes the error. Only the message is used (Throwable.getMessage()).
errorType - The type of this error. (if null the error type is by default set to ErrorType.FATAL )
detailedMsgURI - null or the URI/URL at which a detailed error message is given (different from {jobs}/(job-id)/error).
See Also:
ErrorSummary(String, ErrorType, String)

ErrorSummary

public ErrorSummary(java.lang.String msg,
                    ErrorType errorType)
Builds an error summary with the given short description.

Parameters:
msg - A short description of the error.
errorType - The type of the error. (if null the error type is by default set to ErrorType.FATAL )
See Also:
ErrorSummary(String, ErrorType, String)

ErrorSummary

public ErrorSummary(java.lang.String msg,
                    ErrorType errorType,
                    java.lang.String detailedMsgURI)

Builds an error summary with the given short description and with the URL to access to a detailed description.

Warning: No file is written: that is the responsibility of the creator of this error summary !

Parameters:
msg - A short description of the error.
errorType - The type of the error. (if null the error type is by default set to ErrorType.FATAL )
detailedMsgURI - null or the URI/URL at which a detailed error message is given (different from {jobs}/(job-id)/error).

ErrorSummary

@Deprecated
public ErrorSummary(java.lang.Exception ex,
                               ErrorType errorType,
                               java.net.URL detailedMsg)
Deprecated. Replaced by ErrorSummary(Exception, ErrorType, String)

Builds an error summary from an Exception.

WARNING: No file is written: that is the responsibility of the creator of this error summary !

Parameters:
ex - The Exception which describes the error. Only the message is used (Throwable.getMessage()).
errorType - The type of this error. (if null the error type is by default set to ErrorType.FATAL )
detailedMsg - null or the URL at which a detailed error message is given (different from {jobs}/(job-id)/error).
See Also:
ErrorSummary(String, ErrorType, URL)

ErrorSummary

@Deprecated
public ErrorSummary(java.lang.String msg,
                               ErrorType errorType,
                               java.net.URL detailedMsg)
Deprecated. Replaced by ErrorSummary(String, ErrorType, String)

Builds an error summary with the given short description and with the URL to access to a detailed description.

Warning: No file is written: that is the responsibility of the creator of this error summary !

Parameters:
msg - A short description of the error.
errorType - The type of the error. (if null the error type is by default set to ErrorType.FATAL )
detailedMsg - null or the URL at which a detailed error message is given (different from {jobs}/(job-id)/error).
Method Detail

getMessage

public final java.lang.String getMessage()
Gets a short description of the occurred error.

Returns:
A short error message.

getType

public final ErrorType getType()
Gets the type of the occurred error (ErrorType.FATAL by default).

Returns:
The error type.
See Also:
ErrorType

hasDetail

public final boolean hasDetail()
Indicates whether there are more details about the occurred error.
If true these details can be found at {jobs}/(job-id)/error.

Returns:
true if there are more details, false otherwise.

getDetails

public final java.lang.String getDetails()
Gets the URI/URL where the details about the occurred error can be found.

Returns:
The error details.

serialize

public java.lang.String serialize(UWSSerializer serializer,
                                  java.lang.String ownerId)
                           throws UWSException
Description copied from class: SerializableUWSObject
Serializes the whole object considering the given owner ID (supposed to be the ID of the current user) and thanks to the given serializer.

Specified by:
serialize in class SerializableUWSObject
Parameters:
serializer - The serializer to use.
ownerId - The ID of the current user.
Returns:
The serialized representation of this object.
Throws:
UWSException - If there is an error during the serialization.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object