com.rhi.architecture.parc
Class AbstractError

java.lang.Object
  extended bycom.rhi.architecture.parc.AbstractError
All Implemented Interfaces:
Error

public abstract class AbstractError
extends java.lang.Object
implements Error

AbstractError class. Provides basic error functionality common to all interface Errors.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
AbstractError()
          default constructor.
AbstractError(ErrorType type)
          default constructor.
 
Method Summary
 java.lang.Exception getException()
          If the ErrorType has the printStackTrace() flag enabled, this method should return the exception object so that the stack trace can be written to the logfile.
 java.util.Properties getProperties()
          Return all properties
 java.lang.String getProperty(java.lang.String name)
          Lookup a single property.
 Record getRecord()
          Get the Record which has the error.
 ErrorType getType()
          Get the ErrorType object.
 void setException(java.lang.Exception ex)
          Set the exception object being logged.
 void setRecord(Record record)
          Sets the Record to which this Error belongs.
 void setType(ErrorType type)
          Set the ErrorType object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rhi.architecture.parc.Error
generateLogMessage
 

Constructor Detail

AbstractError

public AbstractError()
default constructor.


AbstractError

public AbstractError(ErrorType type)
default constructor.

Parameters:
type -
Method Detail

getType

public ErrorType getType()
Get the ErrorType object. The type should never be null as it drives behaviour in the Logger class.

Specified by:
getType in interface Error
Returns:
Since:
1.0

setType

public void setType(ErrorType type)
Set the ErrorType object

Parameters:
type -
Since:
1.0

getException

public java.lang.Exception getException()
If the ErrorType has the printStackTrace() flag enabled, this method should return the exception object so that the stack trace can be written to the logfile. If there is no exception, or if the printStackTrace flag is disabled, the exception can be left unset. (null).

Returns:
Exception - the Exception that caused the error. Null if N/A.
Since:
1.0

setException

public void setException(java.lang.Exception ex)
Set the exception object being logged.

Parameters:
ex - - the Exception that caused the error.
Since:
1.0

getRecord

public Record getRecord()
Get the Record which has the error. The Logger uses this record to do one or more of the following: 1) Update the GIT record appropriately. 2) Add an appropriate error record to the interface error table. 3) set the appropriate tag values in the template error message. If the error is not a record level error, (e.g. DB connection cannot be established.), this method can return null.

Specified by:
getRecord in interface Error
Returns:
the Record associated w/ this error.
Since:
1.0

setRecord

public void setRecord(Record record)
Sets the Record to which this Error belongs.

Parameters:
record -
Since:
1.0

getProperties

public java.util.Properties getProperties()
Return all properties

Returns:
Properties

getProperty

public java.lang.String getProperty(java.lang.String name)
Lookup a single property.

Parameters:
name -
Returns:
String


Copyright © 2002-2004 Robert Half International. All Rights Reserved.