public class TsiError extends Object
| => Level of entire group.
:
|;|;... => Level of affected components
:
|||;... => The individual errors
,
| => The next group.
| Modifier and Type | Class and Description |
|---|---|
static class |
TsiError.DefaultErrorPolicy
The default policy.
|
| Modifier and Type | Field and Description |
|---|---|
static char |
COLON
The separator char between the group, the component and the list.
|
static char |
COMMA
The separator char between individual groups.
|
private String |
component
The component the error occured at.
|
private String |
detail
The detailed message, unparsed for escaped parts.
|
private String |
error
The error message as a string.
|
static int |
ERROR
The bit describing a serious error, disabling parts of the telescope
|
static int |
INFO
The bit defining a status.
|
private int |
level
The level of that error, a bit from above.
|
private static String |
LEVELS
The old designations for the error level.
|
static int |
PANIC
The bit describing the most severe error, can't continue.
|
static char |
PIPE
The separator char between individual parts of the error.
|
private static TsiErrorPolicy |
policy
The error handling policy class, changed at run-time with
TSI_ERROR_POLICY. |
static char |
SEMICOLON
The separator char between the list of errors on same group.
|
static String |
TSI_ERROR_POLICY
The system key for a class that replaces the default policy.
|
private static String |
TSIPACKAGE
The package name, where individual classes reside.
|
static int |
WARNING
Errors that do not currently, but might might lead to disabling errs.
|
| Constructor and Description |
|---|
TsiError(String err,
String det,
int lev,
String what)
Constructs a new tsi error from all its components without parsing.
|
| Modifier and Type | Method and Description |
|---|---|
private static TsiError |
createTsiError(String err,
String det,
int lev,
String comp)
Try to crete a customized error, if the error name matches a known class
name or produce a standard error.
|
static TsiError |
deprecated(String read)
Parses the old error format, where the level is a single-letter in
and the component is within |
boolean |
equals(Object other)
On equal, we check for equal error, level, detail and component.
|
int |
getAccumulateCount()
The default implementation for the maximum allowed occurence for
accumulation test on an error.
|
long |
getAccumulateSpan()
The default implementation for the maximum accumulation time span for an
error of this type.
|
String |
getComponent()
Returns the component onto which this error occured.
|
String |
getDetail()
Returns the unparsed detail message.
|
String |
getError()
Returns the error designation.
|
int |
getLevel()
Returns the error level.
|
long |
getResetLag()
The default implementation for the minimum time-lag between resetting an
error of this type.
|
int |
getResetMax()
The default implementation for the maximum allowed occurence for
resetting an error.
|
int |
hashCode()
Hash code is hash from error.
|
boolean |
ignore()
Returns true, if this error should be ignored.
|
static TsiError |
parse(String read)
Parses a TsiError from a string formatted according to:
error|detail|level|comp
like
ERR_USV_BatteryAlarm|USV\\| Alarm|4|CABINET The separator
char is '|'. |
protected void |
setComponent(String err)
Sets the main error occurence component.
|
protected void |
setDetail(String err)
Sets the main error detail.
|
protected void |
setError(String err)
Sets the main error designation.
|
protected void |
setLevel(int err)
Sets the main error level.
|
String |
toString()
Converts that TsiError to a parsable string.
|
public static final String TSI_ERROR_POLICY
public static final char PIPE
public static final char SEMICOLON
public static final char COLON
public static final char COMMA
public static final int PANIC
public static final int ERROR
public static final int WARNING
public static final int INFO
private static final String LEVELS
private static final String TSIPACKAGE
private String error
private String detail
private int level
private String component
private static TsiErrorPolicy policy
TSI_ERROR_POLICY.public static TsiError parse(String read) throws ParseException
error|detail|level|comp
like
ERR_USV_BatteryAlarm|USV\\| Alarm|4|CABINET The separator
char is '|'. Parsing is done such that the component is the part after
the last '|', the level the integer between the last and the second last
'|', and the error is the part until the first '|'. Everything between
the first and the second-to-last '|' is the detail, no parsing for
escaped sequences is done here.ParseExceptionprivate static TsiError createTsiError(String err, String det, int lev, String comp)
public static TsiError deprecated(String read) throws ParseException
and the component is within . The error is
the rest, trimmed. Old format e.g.
ERR_oil_Level_low [I] (CABINET)
ParseExceptionpublic String getError()
public String getDetail()
public int getLevel()
public String getComponent()
public boolean ignore()
public int getResetMax()
TSI_ERROR_POLICY. If that points to a valid, default
constructable class, we use an instance of this class for the policy,
otherwise the default policy is used.public int getAccumulateCount()
TSI_ERROR_POLICY. If that points to a valid, default
constructable class, we use an instance of this class for the policy,
otherwise the default policy is used.public long getAccumulateSpan()
TSI_ERROR_POLICY. If that points to a valid, default
constructable class, we use an instance of this class for the policy,
otherwise the default policy is used.public long getResetLag()
TSI_ERROR_POLICY. If that points to a valid, default
constructable class, we use an instance of this class for the policy,
otherwise the default policy is used.protected void setError(String err)
protected void setDetail(String err)
protected void setComponent(String err)
protected void setLevel(int err)
public String toString()
public boolean equals(Object other)