org.kaariboga.core
Class KaaribogaMessage

java.lang.Object
  |
  +--org.kaariboga.core.KaaribogaMessage
All Implemented Interfaces:
java.io.Serializable

public class KaaribogaMessage
extends java.lang.Object
implements java.io.Serializable

The kaariboga message is a message that kaaribogas and bases can send to each other. In contains information about the recipient, the sender, the kind and the content of a message. Messages can contain all kinds of contents, for example agents, class source code or files.

See Also:
Serialized Form

Field Summary
 byte[] binary
          Binary content of the message
 java.lang.String content
          String content of the message.
 java.lang.String kind
          Kind of message.
 KaaribogaAddress recipient
          Recipient of this message.
 KaaribogaAddress sender
          Sender of this message.
 int version
          Unused at the moment.
 
Constructor Summary
KaaribogaMessage(KaaribogaAddress sender, KaaribogaAddress recipient, java.lang.String kind, java.lang.String content, byte[] binary)
          Creates a new KaaribogaMessage.
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

version

public int version
Unused at the moment.

recipient

public KaaribogaAddress recipient
Recipient of this message. If the recipient is another base the name field of the KaaribogaMessage should be empty.

sender

public KaaribogaAddress sender
Sender of this message. If the sender is not an agent but the base the name field of the sender should be empty.

kind

public java.lang.String kind
Kind of message.
Values:
KAARIBOGA: Message contains an an agent. content field contains the agent's name. binary field it's values.
GET: Get a kaariboga from another base. content field contains the agent's name.
GET_CLASS: Get the java byte code of a class. content field contains the class name.
CLASS: Message contains java byte code of a class. content field contains the class name. binary the byte code.
FILE: Message contains a file. content field contains the file name. binary the file.
MESSAGE: To send arbitrary messages. content and binary may be used freely.

content

public java.lang.String content
String content of the message.

binary

public byte[] binary
Binary content of the message
Constructor Detail

KaaribogaMessage

public KaaribogaMessage(KaaribogaAddress sender,
                        KaaribogaAddress recipient,
                        java.lang.String kind,
                        java.lang.String content,
                        byte[] binary)
Creates a new KaaribogaMessage.
Parameters:
sender - The object that sends the message. If the sender is not an agent but the base the name field of the sender should be empty.
recipient - The receiving object. If the recipient is another base the name field of the KaaribogaMessage should be empty.
kind - The kind of the message. This can be KAARIBOGA, GET, GET_CLASS, CLASS, FILE, MESSAGE.
content - Extra string for message contents for example a class or a file name.
binary - Binary content of the message for example the source code of a file.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object