public class ErrorEvent extends MessageEvent
ERROR_TOKEN or
STATUS_TOKEN, augmented by a one-digit number indicating some
severeness level. The only difference between an error and a status
message is in the handling of the follow-up. Follow-ups in status messages
are deliberately ignored (if not already set to NONE.PIPE the
entire message is passed to the scheduler.Sequencing instance to
augment the current instruction flow, either as a sequnece of single
instructions or as a single command.
As in version 3.0, following follow-ups are defined (but not necessarily coded):
NONE: No follow-ups of this error.SHUT_DOWN: The escape pod for any unknown error recovery
strategy. Completely shuts down the site.STOP_TIME: stop internal exposure time count.CONT_TIME: continue internal exposure time count.CLOSE_SHUTTER: close the shutter.OPEN_SHUTTER: (re)open shutter.ABORT_EXPOSURE: abort integration (exposure). Image
readout is nevertheless initiated.ABORT_TARGET: abort target. Includes abort exposure.REPOSITION: re-position telescope.MOVE_HOME: move telescope to next defined encoder
position.MOVE_PARK: move telescope to park position.CLOSE_ROOF: close roof.MAIL_HOME: e-mail someone remote .MAIL_LOCAL: e-mail someone on site.ALARM_ON: start (audible) alarm.ALARM_OFF: stop (audible) alarm.RESET_TEL: resetting the telescope.RESET_ADAPTER: resetting the adapter.RESET_SPEC: resetting the spectrograph.RESET_CCD: resetting the ccd.RESET_ENV: resetting the environment control.| Modifier and Type | Field and Description |
|---|---|
static String |
ABORT_EXPOSURE
The follow-up for abort integration (exposure).
|
static String |
ABORT_TARGET
The follow-up for abort target.
|
static String |
ALARM_OFF
The follow-up for stop (audible) alarm.
|
static String |
ALARM_ON
The follow-up for start (audible) alarm.
|
static String |
BAD_SEEING
The follow-up for too high guiding failures due to bad seeing.
|
static String |
BAD_WEATHER
The follow-up for bad weather.
|
static String |
CLEAR_TEL
The follow-up for resetting the telescope.
|
static String |
CLOSE_COVER
The follow-up for close cover.
|
static String |
CLOSE_ROOF
The follow-up for close roof.
|
static String |
CLOSE_SHUTTER
The follow-up for close shutter.
|
private boolean |
consumed
Indicates that this error event was already handled.
|
static String |
CONT_TIME
The follow-up for continue internal exposure time count.
|
private static String |
DEFFOLLOWUP
The default follow-up (NONE).
|
private static boolean |
DEFPIPE
The default pipe flag (false).
|
private static int |
DEFSEV
The default severeness level (trivial status message).
|
static String |
ERROR_TOKEN
The type token for errors.
|
private String |
errorClass
The optional name of the error class, as a class name in the ERROR sub.
|
protected static char |
ERRORCOMBINE
The char for combining single follow-ups.
|
static String |
ERRORPACKAGE
The package name of the error subdir to prepend to the class name.
|
private String |
followUp
The follow-up actions.
|
static String |
GOOD_WEATHER
The follow-up for good weather.
|
static String |
HIGH_WIND
The follow-up for too high guiding failures under wind condition.
|
private String[] |
human
The human readable part of the error message.
|
static String |
MAIL_HOME
The follow-up for e-mail someone remote .
|
static String |
MAIL_LOCAL
The follow-up for e-mail someone on site .
|
static String |
MOVE_HOME
The follow-up for move telescope to home position.
|
static String |
MOVE_PARK
The follow-up for move telescope to park position.
|
static String |
NONE
The no-follow-up.
|
static String |
OPEN_COVER
The follow-up for close cover.
|
static String |
OPEN_SHUTTER
The follow-up for (re)open shutter.
|
private boolean |
pipe
The pipe-to-scheduler flag.
|
protected static String |
PIPE
The pipe-through flag as a string.
|
static String |
REACQUIRE
The follow-up for re-acquiring a pointing/guiding.
|
static String |
REPOSITION
The follow-up for re-position telescope.
|
static String |
RESEND_COMMAND
The follow-up for resend command.
|
static String |
RESET_ADAPTER
The follow-up for resetting the adapter.
|
static String |
RESET_CALIBRATION
The follow-up for resetting the spectrograph.
|
static String |
RESET_CCD
The follow-up for resetting the ccd.
|
static String |
RESET_ENV
The follow-up for resetting the ccd.
|
static String |
RESET_ERRORS
The follow-up for ignoring telescope errors and simply reset them.
|
static String |
RESET_SPEC
The follow-up for resetting the spectrograph.
|
static String |
RESET_TEL
The follow-up for parking and intitializing the telescope.
|
static String |
SHUT_DOWN
The follow-up for shutdown.
|
static String |
STATUS_TOKEN
The type token for status messages.
|
static String |
STOP_TIME
The follow-up for stop internal exposure time count.
|
SEPCHARlocalHost, sourceNamesource| Modifier | Constructor and Description |
|---|---|
protected |
ErrorEvent(Object src)
Constructs an invalid ErrorEvent.
|
protected |
ErrorEvent(Object src,
String type,
long time)
Constructs an invalid ErrorEvent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
consume()
Sets the consumed flag.
|
private static ErrorEvent |
create(Object src,
String type,
String follow,
boolean pipe,
String humall)
Creates a fully qualified error or status event.
|
static ErrorEvent |
createError(MessageBin bin)
Creates an error event from a message bin.
|
static ErrorEvent |
createError(Object src,
int severe,
String follow,
boolean pipe,
String humall)
Creates an error event with the given severeness, the defined follow-up
action, the appropriate pipe flag and the human-readable part of the
error as an NL-separated String.
|
static ErrorEvent |
createError(Object src,
String mess)
Creates a error event with the default severeness and the default
follow-up.
|
static ErrorEvent |
createError(Object src,
String follow,
boolean pipe,
String mess)
Creates a error event with the default severeness and the specified
follow-up.
|
static ErrorEvent |
createError(Object src,
String follow,
String mess)
Creates a error event with the default severeness and the specified
follow-up.
|
static ErrorEvent |
createStatus(Object src,
boolean pipe,
String humall)
Creates a status event with the given importance level, pipe-flag and
status message.
|
static ErrorEvent |
createStatus(Object src,
int severe,
boolean pipe,
String humall)
Creates a status event with the given importance level, pipe-flag and
status message.
|
static ErrorEvent |
createStatus(Object src,
String humall)
Creates a status event with the given importance level, pipe-flag and
status message.
|
protected static String |
extractClassName(String firstline)
Returns the error class name template.
|
protected static String |
extractFollowUp(String firstline)
Parses the follow-up from the first command line.
|
protected static boolean |
extractPipe(String firstline)
Returns the value of the pipe-through flag.
|
String |
getErrorClass()
Returns the error class template name.
|
String |
getFollowUp()
Read-access to the follow-up property.
|
String |
getHuman()
Read-access to the human property, the human-readable part of the error
message.
|
String[] |
getLine()
Returns the command lines of the error.
|
int |
getSevereness()
Read-access to the severeness property.
|
private static String |
headLineBreakup(String input,
int count)
Parses the header command line.
|
boolean |
isConsumed()
Returns true if this error event was already consumed, i.e.
|
boolean |
isPipe()
Returns true if the type of the error is of pipe-through.
|
boolean |
isStatus()
Return true if the error event is a status message.
|
protected static String |
parseClassName(String firstline)
Returns the name of the error class if any.
|
protected boolean |
parseHeader(String[] all)
PArses the command lines including the error class and pipe.
|
boolean |
parseLine(String[] all)
Parses the command lines into something readable.
|
protected void |
setFollowUp(String follow)
Set-access to the follow-up property.
|
protected void |
setHuman(String humall)
Set-access to the human property.
|
protected void |
setHuman(String[] humall)
Set-access to the human property.
|
protected void |
setPipe(boolean piping)
Sets the pipe-through flag.
|
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toSkippedString, toStringgetHost, getSourceName, setSourceNamegetSourcepublic static final String ERRORPACKAGE
public static final String ERROR_TOKEN
public static final String STATUS_TOKEN
public static final String NONE
public static final String SHUT_DOWN
public static final String BAD_WEATHER
public static final String GOOD_WEATHER
public static final String BAD_SEEING
public static final String HIGH_WIND
public static final String STOP_TIME
public static final String CONT_TIME
public static final String CLOSE_COVER
public static final String OPEN_COVER
public static final String CLOSE_SHUTTER
public static final String OPEN_SHUTTER
public static final String ABORT_EXPOSURE
public static final String ABORT_TARGET
public static final String REPOSITION
public static final String REACQUIRE
public static final String MOVE_HOME
public static final String MOVE_PARK
public static final String CLOSE_ROOF
public static final String MAIL_HOME
public static final String MAIL_LOCAL
public static final String ALARM_ON
public static final String ALARM_OFF
public static final String RESEND_COMMAND
public static final String RESET_TEL
public static final String CLEAR_TEL
public static final String RESET_ADAPTER
public static final String RESET_SPEC
public static final String RESET_CALIBRATION
public static final String RESET_CCD
public static final String RESET_ENV
public static final String RESET_ERRORS
protected static final char ERRORCOMBINE
protected static final String PIPE
private static final int DEFSEV
private static final String DEFFOLLOWUP
private static final boolean DEFPIPE
private String followUp
private boolean pipe
private String errorClass
private String[] human
private boolean consumed
protected ErrorEvent(Object src)
public static ErrorEvent createError(Object src, String mess)
public static ErrorEvent createError(Object src, String follow, String mess)
public static ErrorEvent createError(Object src, String follow, boolean pipe, String mess)
public static ErrorEvent createError(Object src, int severe, String follow, boolean pipe, String humall)
public static ErrorEvent createStatus(Object src, String humall)
NONE.public static ErrorEvent createStatus(Object src, boolean pipe, String humall)
NONE.public static ErrorEvent createStatus(Object src, int severe, boolean pipe, String humall)
NONE.public static ErrorEvent createError(MessageBin bin)
private static ErrorEvent create(Object src, String type, String follow, boolean pipe, String humall)
public int getSevereness()
public boolean isStatus()
STATUS_TOKEN.public String getErrorClass()
public String getFollowUp()
public boolean isPipe()
public boolean isConsumed()
public void consume()
ErrorHandling instances do not need to process
the follow-up action further.protected void setFollowUp(String follow)
follow - The follow-up actions for this error.protected void setPipe(boolean piping)
protected static String parseClassName(String firstline)
protected static String extractClassName(String firstline)
protected static String extractFollowUp(String firstline)
protected static boolean extractPipe(String firstline)
private static String headLineBreakup(String input, int count)
protected boolean parseHeader(String[] all)
public boolean parseLine(String[] all)
parseLine in class MessageEventpublic String[] getLine()
getLine in class MessageEventpublic String getHuman()
protected void setHuman(String humall)
human - A String specifiying the human-readable part of this error.protected void setHuman(String[] humall)
human - A String specifiying the human-readable part of this error.