stella
Class InfoEvent

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.MessageEvent
              extended by stella.InfoEvent
All Implemented Interfaces:
Serializable

public class InfoEvent
extends MessageEvent

An info event may be passed anywhere in the STELLA system without causing any reaction. Any receiver that receives an info event should ignore it. This event is only intended for the debugging phase, where received info event may be published somehow. It must carry at least one command line.
In particular it is necessary that info events should not interfere with command cycles, but nevertheless correctly received.

See Also:
Serialized Form

Field Summary
private static int DEFLEVEL
          The default intege following HEADER.
static String HEADER
          The type of this event.
private static Map IMPORTANT
          A look-up table linking important info messages to status classes.
private  String[] line
          The lines read in or set during initialization of the info event.
 
Fields inherited from class stella.MessageEvent
SEPCHAR
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
InfoEvent(Object src)
          Creates a new info element if only the source is known.
InfoEvent(Object src, String type, long time)
          Creates a new info event.
 
Method Summary
static InfoEvent createInfo(MessageBin bin)
          Creates an info event from a message bin.
static ErrorEvent createStatusFromInfo(InfoEvent ie)
          Due to some misscoding in the ATIS-server, we have to translate some INFO messages to status messages, as they might trigger some action.
 String[] getLine()
          Returns the lines associated with this info event.
 boolean parseLine(String[] info)
          Parsing of lines is not intended for info events.
 void setLine(String[] info)
          Sets the line associated with this info event.
 
Methods inherited from class stella.MessageEvent
checkType, equals, equalTime, equalTime, fromAscii, getAllCommandLines, getExecuteGroupKey, getHead, getNr, getTime, getType, hashCode, isValid, parseFromSingleString, readFromBufferedStream, setNr, setTime, setType, setValid, toString
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER

public static final String HEADER
The type of this event. Is followed by an integer for the full type.

See Also:
Constant Field Values

DEFLEVEL

private static final int DEFLEVEL
The default intege following HEADER.

See Also:
Constant Field Values

line

private String[] line
The lines read in or set during initialization of the info event.


IMPORTANT

private static final Map IMPORTANT
A look-up table linking important info messages to status classes.

Constructor Detail

InfoEvent

public InfoEvent(Object src)
Creates a new info element if only the source is known. The type is set to HEADER followed by DEFLEVEL, the command time is the current system time.


InfoEvent

public InfoEvent(Object src,
                 String type,
                 long time)
Creates a new info event. The type handed over must already contain the integer following HEADER.

Method Detail

createInfo

public static InfoEvent createInfo(MessageBin bin)
Creates an info event from a message bin. Copies the type and time read in from the header line. The additional lines read in with the message bin are copied to this info event's command line buffer.


createStatusFromInfo

public static ErrorEvent createStatusFromInfo(InfoEvent ie)
Due to some misscoding in the ATIS-server, we have to translate some INFO messages to status messages, as they might trigger some action. This method checks if the message bin refers to an info message. If so, the static look-up table linking info message lines to status classes is scanned. If a hit is detected, the appropriate status event is generated from the info event and returned, otherwise null is returned.


setLine

public void setLine(String[] info)
Sets the line associated with this info event. An info event is only valid if it has at least one command line.


getLine

public String[] getLine()
Returns the lines associated with this info event. If the info event is valid, the array returned has at least one entry.

Specified by:
getLine in class MessageEvent
Returns:
An array containing all command lines.

parseLine

public boolean parseLine(String[] info)
Parsing of lines is not intended for info events. This method stores the line handed over and returns true immediately.

Specified by:
parseLine in class MessageEvent
Returns:
True, if parsing was successful.