core.messages
Class ErrorMessage

java.lang.Object
  extended bycore.Message
      extended bycore.messages.ErrorMessage

public class ErrorMessage
extends Message

Message used for reporting errors.

Author:
hoela
See Also:
for a list of possible errors handled by this MessageType.

Constructor Summary
ErrorMessage(java.lang.String source, java.lang.String destination)
          Creates a new instance of ErrorMessage.
ErrorMessage(java.lang.String source, java.lang.String destination, ErrorCondition condition)
          Creates a new instance of ErrorMessage with a specific ErrorCondition.
ErrorMessage(java.lang.String source, java.lang.String destination, ErrorCondition condition, long id)
          Creates a new instance of ErrorMessage with a specific ErrorCondition and id.
 
Method Summary
 ErrorCondition getCondition()
          Returns the ErrorCondition associated with this ErrorMessage.
 byte[] toXML()
          Converts the contents of this message to XML
 
Methods inherited from class core.Message
getDestination, getId, getMessageType, getSource, restamp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorMessage

public ErrorMessage(java.lang.String source,
                    java.lang.String destination)
Creates a new instance of ErrorMessage.

Parameters:
source - the source's virtual address.
destination - the destination's virtual address.

ErrorMessage

public ErrorMessage(java.lang.String source,
                    java.lang.String destination,
                    ErrorCondition condition)
Creates a new instance of ErrorMessage with a specific ErrorCondition.

Parameters:
source - the source's virtual address.
destination - the destination's virtual address.
condition - the ErrorCondition to report.

ErrorMessage

public ErrorMessage(java.lang.String source,
                    java.lang.String destination,
                    ErrorCondition condition,
                    long id)
Creates a new instance of ErrorMessage with a specific ErrorCondition and id.

Parameters:
source - the source's virtual address.
destination - the destination's virtual address.
condition - the ErrorCondition to report.
id - the id of the message.
Method Detail

toXML

public byte[] toXML()
Converts the contents of this message to XML

Specified by:
toXML in class Message
Returns:
byte[] this message converted to XML.

getCondition

public ErrorCondition getCondition()
Returns the ErrorCondition associated with this ErrorMessage.

Returns:
the ErrorCondition reported by thie ErrorMessage.