com.ls.lars.communication
Class GroupMessage

java.lang.Object
  |
  +--com.ls.lars.communication.Message
        |
        +--com.ls.lars.communication.GroupMessage
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public class GroupMessage
extends Message

Message object for the communication between the agents.

Note, that the Message object is not synchronized!

Standard for naming message services:

This standard is needed for automatic registration of "interpret"-methods in agents.

Version:
$Revision: 1.3 $
Author:
Last modified by $Author: ODrugan $
See Also:
Serialized Form

Field Summary
static String TAG_GROUP
          string that represent the "message"
 
Fields inherited from class com.ls.lars.communication.Message
ADDRESS_CONFIG, ADDRESS_LARS_INTERNAL, EXPIRE_HOPS_DEFAULT, MESSAGE_TYPE_GROUP, MESSAGE_TYPE_MULTICAST, MESSAGE_TYPE_SERVICE_BROADCAST, MESSAGE_TYPE_SERVICE_SINGLE, MESSAGE_TYPE_SINGLE, PRIORITY_HIGH, PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_SYSTEM, PRIORITY_TEXT_HIGH, PRIORITY_TEXT_LOW, PRIORITY_TEXT_NORMAL, SERVICE_UNKNOWN, TAG_CONTENT, TAG_CURRENT_HOPS, TAG_EXPIRE_HOPS, TAG_FORWARDED_BY, TAG_IN_REPLY_TO, TAG_MESSAGE, TAG_PRIORITY, TAG_QUALITY_OF_SERVICE, TAG_REPLY_COUNTER, TAG_REPLY_WITH, TAG_SENDER, TAG_SENT_TIME, TAG_SERVICE, TAG_TYPE
 
Constructor Summary
GroupMessage(String service, String group, Object content)
          sets all fields of a group message including the content object
 
Method Summary
 String getGroup()
          returns the name of the group agent
protected  Map inheritorToMap()
          returns a map containing the GroupMessage specific fields (type and group)
protected  String inheritorToString()
          returns a well formatted string containing the GroupMessage specific fields (type and group)
 
Methods inherited from class com.ls.lars.communication.Message
clone, compareTo, createMessage, createReply, getContent, getCurrentHops, getExpireHops, getForwardedBy, getInReplyTo, getPriority, getQualityOfService, getReplyWith, getSender, getSentTime, getService, hasInvalidSender, hop, increasePriority, isExpired, isSent, setExpireHops, setInReplyTo, setPriority, setPriority, setQualityOfService, setQualityOfService, setReplyWith, setSystemPriority, toMap, toString, toStringWithContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_GROUP

public static final String TAG_GROUP
string that represent the "message"
Constructor Detail

GroupMessage

public GroupMessage(String service,
                    String group,
                    Object content)
             throws InvalidArgumentException
sets all fields of a group message including the content object
Parameters:
service - service of the message
group - name of the receiver group
content - content of the message as a hash
Throws:
InvalidArgumentException - if given service or group is null or empty or contains only whitespace characters or if given content is null
Method Detail

getGroup

public final String getGroup()
returns the name of the group agent
Returns:
name of this group agent

inheritorToMap

protected Map inheritorToMap()
returns a map containing the GroupMessage specific fields (type and group)
Overrides:
inheritorToMap in class Message
Returns:
GroupMessage specific fields as a Map

inheritorToString

protected String inheritorToString()
returns a well formatted string containing the GroupMessage specific fields (type and group)
Overrides:
inheritorToString in class Message
Returns:
GroupMessage specific fields as a well-formatted string