nl.toolforge.karma.core.cmd.event
Class MessageEvent

java.lang.Object
  extended bynl.toolforge.karma.core.cmd.event.CommandResponseEvent
      extended bynl.toolforge.karma.core.cmd.event.MessageEvent
All Implemented Interfaces:
Event

public final class MessageEvent
extends CommandResponseEvent

An event generated as a result of something ordinary. Commands can generate these events, but

Version:
$Id: MessageEvent.java,v 1.3 2004/11/02 23:57:06 asmedes Exp $
Author:
D.A. Smedes

Field Summary
 
Fields inherited from interface nl.toolforge.karma.core.cmd.event.Event
LEVEL_DEBUG, LEVEL_INFO, LEVEL_VERBOSE
 
Constructor Summary
MessageEvent(Command command, int priority)
          Creates a MessageEvent not linked to any command with a priority of priority.
MessageEvent(Command command, int priority, SimpleMessage message)
          Creates the event for command.
MessageEvent(Command command, SimpleMessage message)
          Creates the event for command.
MessageEvent(SimpleMessage message)
          Creates a MessageEvent not linked to any command.
 
Method Summary
 Message getEventMessage()
          Returns a SimpleMessage formatted as [ <command-name> ] <message-text> if this message was constructed with a Command object, otherwise it returns the SimpleMessgae as-is.
 
Methods inherited from class nl.toolforge.karma.core.cmd.event.CommandResponseEvent
getCommand, getPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageEvent

public MessageEvent(Command command,
                    int priority)
Creates a MessageEvent not linked to any command with a priority of priority.

Parameters:
command - The command generated this event.
priority - The priority of the event.

MessageEvent

public MessageEvent(Command command,
                    int priority,
                    SimpleMessage message)
Creates the event for command.

Parameters:
command - The command generated this event.
priority - The priority of the event.
message - The message for the event.

MessageEvent

public MessageEvent(Command command,
                    SimpleMessage message)
Creates the event for command.

Parameters:
command - The command generated this event.

MessageEvent

public MessageEvent(SimpleMessage message)
Creates a MessageEvent not linked to any command.

Parameters:
message - Some message.
Method Detail

getEventMessage

public Message getEventMessage()
Returns a SimpleMessage formatted as [ <command-name> ] <message-text> if this message was constructed with a Command object, otherwise it returns the SimpleMessgae as-is.

Specified by:
getEventMessage in class CommandResponseEvent
Returns:
A SimpleMessage object optionally prefixed with the Command name.


Copyright © 2002-2004 Toolforge. All Rights Reserved.