org.rhq.core.domain.resource
Class ResourceError
java.lang.Object
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
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
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 occurrederrorType
- identifies this kind of error this representssummary
- a summary of the errordetail
- a detailed description of the error - typically a stack trace; may be nulltimeOccurred
- 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 occurrederrorType
- identifies this kind of error this representsexception
- exception whose stack will be used as this object's error messagetimeOccurred
- the epoch time when the error occurred
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 RHQ Project Advisory Board (Red Hat, Inc. and Hyperic, Inc.). All Rights Reserved.