org.rhq.core.domain.resource
Class ResourceError

java.lang.Object
  extended by org.rhq.core.domain.resource.ResourceError
All Implemented Interfaces:
Serializable

public class ResourceError
extends Object
implements Serializable

Represents some error that has occurred in or is associated with a Resource.

See Also:
Serialized Form

Field Summary
static String QUERY_DELETE_BY_RESOURCES
           
static String QUERY_FIND_BY_RESOURCE_ID
           
static String QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE
           
 
Constructor Summary
protected ResourceError()
           
  ResourceError(Resource resource, ResourceErrorType errorType, String summary, String detail, long timeOccurred)
          Constructor for ResourceError.
  ResourceError(Resource resource, ResourceErrorType errorType, Throwable exception, long timeOccurred)
          Constructor for ResourceError that uses setDetailFromThrowable(Throwable) to convert the given exception to an error message.
 
Method Summary
 String getDetail()
           
 ResourceErrorType getErrorType()
           
 int getId()
           
 Resource getResource()
           
 String getSummary()
           
 long getTimeOccurred()
           
 void setDetail(String detail)
           
 void setDetailFromThrowable(Throwable t)
          Convenience method that sets the error message to the given throwable's stack trace.
 void setErrorType(ResourceErrorType errorType)
           
 void setId(int id)
           
 void setResource(Resource resource)
           
 void setSummary(String summary)
           
 void setTimeOccurred(long timeOccurred)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_DELETE_BY_RESOURCES

public static final String QUERY_DELETE_BY_RESOURCES
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_ID

public static final String QUERY_FIND_BY_RESOURCE_ID
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE

public static final String QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE
See Also:
Constant Field Values
Constructor Detail

ResourceError

protected ResourceError()

ResourceError

public ResourceError(@NotNull
                     Resource resource,
                     @NotNull
                     ResourceErrorType errorType,
                     @NotNull
                     String summary,
                     @Nullable
                     String detail,
                     long timeOccurred)
Constructor for ResourceError.

Parameters:
resource - the resource that is associated with the error that occurred
errorType - identifies this kind of error this represents
summary - a summary of the error
detail - a detailed description of the error - typically a stack trace; may be null
timeOccurred - the epoch time when the error occurred

ResourceError

public ResourceError(@NotNull
                     Resource resource,
                     @NotNull
                     ResourceErrorType errorType,
                     @NotNull
                     Throwable exception,
                     long timeOccurred)
Constructor for ResourceError that uses setDetailFromThrowable(Throwable) to convert the given exception to an error message.

Parameters:
resource - the resource that is associated with the error that occurred
errorType - identifies this kind of error this represents
exception - exception whose stack will be used as this object's error message
timeOccurred - the epoch time when the error occurred
Method Detail

getId

public int getId()

setId

public void setId(int id)

getResource

public Resource getResource()

setResource

public void setResource(Resource resource)

getErrorType

public ResourceErrorType getErrorType()

setErrorType

public void setErrorType(ResourceErrorType errorType)

getSummary

public String getSummary()

setSummary

public void setSummary(String summary)

getDetail

@Nullable
public String getDetail()

setDetail

public void setDetail(String detail)

setDetailFromThrowable

public void setDetailFromThrowable(@NotNull
                                   Throwable t)
Convenience method that sets the error message to the given throwable's stack trace.

Parameters:
t - throwable whose message and stack trace will make up the error message (must not be null)
Throws:
NullPointerException - if t is null

getTimeOccurred

public long getTimeOccurred()

setTimeOccurred

public void setTimeOccurred(long timeOccurred)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.