de.kosi.chat
Interface ChatChannel

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
ChatChannelImpl

public interface ChatChannel
extends java.rmi.Remote

ChatChannel is the interface to all chat channels in KoSI.

ChangeLog:

 $Log: ChatChannel.java,v $
 Revision 1.2  2001/06/04 14:21:10  jiriki
 Made source more comliant to coding guidelines.

 

Version:
$Revision: 1.2 $ ($Date: 2001/06/04 14:21:10 $)
Author:
Jan-Ole Janssen, Niklas Mehner, Time Sticher

Field Summary
static int ACTION
          Indicates a Action message.
static int SAY
          Indicates a normal text message.
 
Method Summary
 void addChatListener(ChatListener listener)
          Adds a ChatListener to this channel.
 java.lang.String[] getUserNames()
          Returns a list of the users currently in the chat channel.
 void removeChatListener(ChatListener listener, java.lang.String reason)
          Removes a ChatListener from the listener list.
 void sendMessage(java.lang.String msg, int type)
          Sends a message to the channel.
 

Field Detail

ACTION

public static final int ACTION
Indicates a Action message.

SAY

public static final int SAY
Indicates a normal text message.
Method Detail

addChatListener

public void addChatListener(ChatListener listener)
                     throws java.rmi.RemoteException,
                            InvalidSessionException
Adds a ChatListener to this channel. After the listener is added, it receives all events relevant to this chat. If a call to the listener fails, the listener is removed from the listener list.
Parameters:
listener - the listener to be added to the channel.
Throws:
java.rmi.RemoteException - if a RemoteCall to this channel fails.
InvalidSessionException - If the session of the invoker of this method was invalid.

removeChatListener

public void removeChatListener(ChatListener listener,
                               java.lang.String reason)
                        throws java.rmi.RemoteException
Removes a ChatListener from the listener list.
Parameters:
listener - the listener to be removed.
reason - the reason for removeing the listener.
Throws:
java.rmi.RemoteException - if a RemoteCall to this channel fails.

sendMessage

public void sendMessage(java.lang.String msg,
                        int type)
                 throws java.rmi.RemoteException,
                        ChatException,
                        InvalidSessionException,
                        java.security.AccessControlException
Sends a message to the channel.
Parameters:
msg - the message to be send
type - the type of this message. Possible values are the constants in this class.
Throws:
java.rmi.RemoteException - if a RemoteCall to this channel fails.
java.security.AccessControlException - if the caller is not allowed to send a message.
InvalidSessionException - If the session of this method's invoker was invalid.
ChatException - If the message is sent by a read only user or by a user who is not member of the channel.

getUserNames

public java.lang.String[] getUserNames()
                                throws java.rmi.RemoteException
Returns a list of the users currently in the chat channel.
Returns:
list of users.
Throws:
java.rmi.RemoteException - if a RemoteCall to this channel fails.