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