stella
Class AcknowledgeEvent

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

public class AcknowledgeEvent
extends ReplyEvent

The event representing an acknowledge event. As a convention, all types of 901 and higher are permitted. An acknowledge with type 901 is always the last in a chain of acknowledge events. It signals that the next event in the command sequence will be a done event. For numbers higher than 901 the convention is not as strict but the users are enchouraged to use a decreasing sequence with the last acknowledge event carrying the number 901.

Aside the normal MessageEvent attributes the following attributes are delivered with an acknowledge events:

Example:
   901 1 965054153000 131.130.36.79 131.130.36.73
   105 965054152000 300000
   
In the example above, computer 131.130.36.79 will complete the position command 105 within 5 minutes. It took 1 sec for the acknowledge message to be generated, notable from the date tag in the message header.

Real acknowledge event will have different completion times. After construction using the standard constructors only a default completion time of DEFCOMPLETION is set.

See Also:
Serialized Form

Field Summary
private  long completionTime
          The completion time for this acknowledge event.
static long DEFCOMPLETION
          A very default completion time.
static String PRIMARY_ACK
          Any acknowledge event starts with this string.
 
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
AcknowledgeEvent(Object src, String type, long time)
          The default constructor.
AcknowledgeEvent(Object src, String type, long time, CommandEvent cmd)
          Constructs an acknowledge event as an answer for the given command.
AcknowledgeEvent(Object src, String type, long time, CommandEvent cmd, long complete)
          Constructs an acknowledge event as an answer for the given command.
AcknowledgeEvent(Object src, String type, long time, String ctype, long ctime)
          Constructs an acknowledge event with the default completion time.
AcknowledgeEvent(Object src, String type, long time, String ctype, long ctime, long complete)
          Constructs a fully qualified acknowledge event.
 
Method Summary
 long getCompletionTime()
          Returns the completion time for the progenitor command, in ms.
 String[] getLine()
          Returns the command line.
 boolean parseLine(String[] all)
          Parses the acknowledge event progenitor command from the command line.
protected  void setCompletionTime(long comp)
          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

PRIMARY_ACK

public static final String PRIMARY_ACK
Any acknowledge event starts with this string.

See Also:
Constant Field Values

DEFCOMPLETION

public static final long DEFCOMPLETION
A very default completion time.

See Also:
Constant Field Values

completionTime

private long completionTime
The completion time for this acknowledge event.

Constructor Detail

AcknowledgeEvent

public AcknowledgeEvent(Object src,
                        String type,
                        long time)
The default constructor. Event is not valid after the construction.


AcknowledgeEvent

public AcknowledgeEvent(Object src,
                        String type,
                        long time,
                        CommandEvent cmd)
Constructs an acknowledge event as an answer for the given command. The default completion time is used.

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.

AcknowledgeEvent

public AcknowledgeEvent(Object src,
                        String type,
                        long time,
                        CommandEvent cmd,
                        long complete)
Constructs an acknowledge event as an answer for the given command.

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.
complete - The completion time for the original command.

AcknowledgeEvent

public AcknowledgeEvent(Object src,
                        String type,
                        long time,
                        String ctype,
                        long ctime)
Constructs an acknowledge event with the default completion time.

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.

AcknowledgeEvent

public AcknowledgeEvent(Object src,
                        String type,
                        long time,
                        String ctype,
                        long ctime,
                        long complete)
Constructs a fully qualified acknowledge event.

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.
complete - The completion time for the original command.
Method Detail

setCompletionTime

protected void setCompletionTime(long comp)
Sets the completion time for the progenitor command, in ms.


getCompletionTime

public long getCompletionTime()
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.