stella
Class DoneEvent

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

public class DoneEvent
extends ReplyEvent

The event representing a done event. As a convention, only the type of 900 is allowed.

Aside the normal MessageEvent attributes the following attributes are delivered with a done events:

Example:
   900 1 965054163000 131.130.36.79 131.130.36.73
   105 965054152000 1
   
In the example above, computer 131.130.36.79 completes the position command 105 within 10 seconds.

See Also:
Serialized Form

Field Summary
private  boolean commandSuccess
          The success of the progenitor command.
static String DONETYPE
          The type of a done event.
private static String FALSE
          The string to use for unsuccessful done events.
private static String TRUE
          The string to use for successful done events.
 
Fields inherited from class stella.ReplyEvent
VARSEP
 
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
DoneEvent(Object src, long time, CommandEvent cmd)
          Constructs a done event as an answer for the given command.
DoneEvent(Object src, long time, String ctype, long ctime)
          Constructs a done event and defaults to successful completion.
DoneEvent(Object src, String type, long time)
          The default constructor.
 
Method Summary
 String[] getLine()
          Returns the command line.
 boolean isSuccess()
          Returns the completion time for the progenitor command, in ms.
 boolean parseLine(String[] all)
          Parses the acknowledge event progenitor command from the command line.
 void setSuccess(boolean success)
          Sets the completion time for the progenitor command, in ms.
 
Methods inherited from class stella.ReplyEvent
createMatch, createReply, equals, getCommandTime, getCommandType, getExecuteGroupKey, getProgenitor, getReplyMatch, matches, parseProgenitor, setCommandTime, setCommandType
 
Methods inherited from class stella.MessageEvent
checkType, equalTime, equalTime, fromAscii, getAllCommandLines, 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

DONETYPE

public static final String DONETYPE
The type of a done event.

See Also:
Constant Field Values

TRUE

private static final String TRUE
The string to use for successful done events.

See Also:
Constant Field Values

FALSE

private static final String FALSE
The string to use for unsuccessful done events.

See Also:
Constant Field Values

commandSuccess

private boolean commandSuccess
The success of the progenitor command.

Constructor Detail

DoneEvent

public DoneEvent(Object src,
                 String type,
                 long time)
The default constructor.


DoneEvent

public DoneEvent(Object src,
                 long time,
                 CommandEvent cmd)
Constructs a done event as an answer for the given command. The default success is true.

Parameters:
src - The origin of the acknowledge event.
type - The type of the acknowledge event (901 and up).
time - The time-tag of the acknowledge event.
cmd - The command this acknowledge follows.

DoneEvent

public DoneEvent(Object src,
                 long time,
                 String ctype,
                 long ctime)
Constructs a done event and defaults to successful completion.

Parameters:
src - The origin of the acknowledge event.
type - The type of the acknowledge event (901 and up).
time - The time-tag of the acknowledge event.
ctype - The command-type of the original command.
ctime - The command-time-tag of the original command.
Method Detail

setSuccess

public void setSuccess(boolean success)
Sets the completion time for the progenitor command, in ms.


isSuccess

public boolean isSuccess()
Returns the completion time for the progenitor command, in ms.


parseLine

public boolean parseLine(String[] all)
Parses the acknowledge event progenitor command from the command line.

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

getLine

public String[] getLine()
Returns the command line.

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