Interface como.sys.ComObj
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface como.sys.ComObj

public interface ComObj
extends Object
This is an interface for "Communicator" - objects that provides methods for Commlets to send messages to the other Commlet instances.

Method Index

 o ask(Msg)
Sends msg to msg.to and blocks until msg.to answers.
 o getMasterID()
get the ID of master.
 o getMyID()
get the ID of myself.
 o getUser(int)
Get more information about the user with the given id.
 o getUserName(int)
get the name of given user with ID id.
 o getUsers()
get all Users in the commlet.
 o iAmMaster()
Returns true if this Commlet is the "Master".
 o kickUser(int, String)
Kick a User out of the channel.
 o loadAudioClip(String)
Load an audioclip with the specified filename! The ComObj has to know where to get it!
 o loadImage(String)
Load a picture with the specified filename! The ComObj has to know where to get it!
 o logout()
Should be called by commlet.stop() to inform others that the user is leaving to communication.
 o openInputStream(String)
Open an input-stream to the specified file! The ComObj has to know where to get it!
 o sendTo(Msg)
Sends a message to msg.from
 o sendToAll(Msg)
Sends a message to all Commlet instances, including this one.
 o sendToGroup(int[], Msg)
Sends a message to the Commlet instances contained in the byte array to[].
 o sendToOthers(Msg)
Sends a message to the other Commlet instances, but not to this one.
 o setLocalUser(User)
Sets the local User to u.
 o setNewTopic(String)
Set a new topic.

Methods

 o getMyID
  public abstract int getMyID()
get the ID of myself.
Returns:
the local user's ID.
 o getMasterID
  public abstract int getMasterID()
get the ID of master.
Returns:
the masters user's ID. -1 means: it is still unknown. Wait for the NEW_MASTER-message.
 o getUser
  public abstract User getUser(int id)
Get more information about the user with the given id.
Parameters:
id - the id of the user.
Returns:
the information about the User
 o getUserName
  public abstract String getUserName(int id)
get the name of given user with ID id.
Returns:
the name of the user
 o getUsers
  public abstract Vector getUsers()
get all Users in the commlet.
Returns:
a Vector with all Users (User-Object)
 o setLocalUser
  public abstract void setLocalUser(User newUser)
Sets the local User to u. Certain fields can not be changed, such as the nickname etc. Those will simply stay the same
Parameters:
newUser. - A User-Object containig the new information.
 o setNewTopic
  public abstract void setNewTopic(String topic)
Set a new topic. The Commlet has to decide if it may be set or not -- if this method is called, the topic WILL be set.
Parameters:
topic - the new topic.
 o iAmMaster
  public abstract boolean iAmMaster()
Returns true if this Commlet is the "Master". Exactly one Commlet instance in a communication is "Master" at any given time.
Returns:
true if master, false if not.
 o sendTo
  public abstract void sendTo(Msg msg)
Sends a message to msg.from
Parameters:
msg - the msg you want to send.
 o sendToOthers
  public abstract void sendToOthers(Msg msg)
Sends a message to the other Commlet instances, but not to this one.
Parameters:
msg - the msg you want to send.
 o sendToGroup
  public abstract void sendToGroup(int to[],
                                   Msg msg)
Sends a message to the Commlet instances contained in the byte array to[].
Parameters:
to - array of user-ids where to send the message to.
msg - the msg you want to send.
 o sendToAll
  public abstract void sendToAll(Msg msg)
Sends a message to all Commlet instances, including this one.
Parameters:
msg - the msg you want to send.
 o ask
  public abstract Msg ask(Msg msg)
Sends msg to msg.to and blocks until msg.to answers. The answer message is returned! Do not use this method very often. It usually take's a long time to return!!! If you respond to a ask-message, call msg.setAnswer( true );
Parameters:
msg - the msg you want to send.
Returns:
msg the answer-msg.
 o kickUser
  public abstract void kickUser(int id,
                                String reason)
Kick a User out of the channel. Do not use this too often :-) Commlet-Writers: Only let the master kick a user, please.
Parameters:
id - the id of the user
reason - the reason why he was kicked out
 o logout
  public abstract void logout()
Should be called by commlet.stop() to inform others that the user is leaving to communication.
 o loadImage
  public abstract Image loadImage(String filename)
Load a picture with the specified filename! The ComObj has to know where to get it!
Parameters:
filename - the name of the file
Returns:
the Image.
 o loadAudioClip
  public abstract AudioClip loadAudioClip(String filename)
Load an audioclip with the specified filename! The ComObj has to know where to get it!
Parameters:
filename - the name of the file
Returns:
the AudioClip.
 o openInputStream
  public abstract InputStream openInputStream(String filename)
Open an input-stream to the specified file! The ComObj has to know where to get it!
Parameters:
filename - the name of the file
Returns:
the InputStream for that file.

All Packages  Class Hierarchy  This Package  Previous  Next  Index