swpchat.protocol
Interface ClientFunctions

All Known Implementing Classes:
ClientControls

public interface ClientFunctions


Method Summary
 void addAudioFile(java.lang.String audioKey, java.lang.String sound)
          Adds an audio file to the properties.
 boolean changeNick(java.lang.String newNickname)
          Changes the actual nickname.
 boolean connect(java.lang.String servername, java.lang.String nickname)
          Connects to a given server with a given nickname.
 boolean createNewChannel(java.lang.String name, java.lang.String sendPasswd, java.lang.String recvPasswd)
          Creates a new channel.
 boolean disconnect()
          Disconnects from the server.
 java.util.Enumeration getAudioEnumeration()
          gets an enumeration of audio files from the AudioMapper and returns it.
 java.util.Enumeration getAvailableChannelEnumeration()
          gets an enumeration of available channels and returns it.
 java.lang.String getNickname()
          gets the stored default nickname from swpOpions and returns it.
 java.util.Enumeration getSelectedChannelEnumeration()
          gets an enumeration of selected channels and returns it.
 java.lang.String getServername()
          gets the stored default servername from swpOpions and returns it.
 boolean isConnected()
          Checks if the client is actually connected completely.
 boolean join(java.lang.String channel)
          Joins a channel.
 boolean leave(java.lang.String channel)
          Leaves a channel.
 boolean play(java.lang.String channel, java.lang.String audiokey)
           
 boolean playReceivedAudioRequest(java.lang.String channel, java.lang.String sender, java.lang.String audio)
          Plays an audio file.
 void quit()
          Quits the client program with disconnecting from server.
 void removeAudioFile(java.lang.String audioKey)
          Removes an audio file from the properties.
 boolean removeChannel(java.lang.String name)
          Removes an existing channel.
 boolean renameChannel(java.lang.String oldname, java.lang.String newname)
          Renames an existing channel.
 void saveNickname(java.lang.String nickname)
          stores nickname in properties.
 void saveServername(java.lang.String servername)
          stores servername in properties.
 boolean send(java.lang.String channel, java.lang.String message)
          Sends a given message to a given channel to the server.
 boolean sendFile(java.io.File pictureFile, java.util.Vector vecReceiver)
          Sends a picture to the server.
 boolean showReceivedPicture(java.io.File pictureFile)
          Shows a received picture.
 

Method Detail

connect

public boolean connect(java.lang.String servername,
                       java.lang.String nickname)
Connects to a given server with a given nickname. Returns true, if we could connect to the server.
Parameters:
servername - The server name.
nickname - The user's nickname.

disconnect

public boolean disconnect()
Disconnects from the server. Returns true, if we could disconnect.

isConnected

public boolean isConnected()
Checks if the client is actually connected completely.

send

public boolean send(java.lang.String channel,
                    java.lang.String message)
Sends a given message to a given channel to the server.
Parameters:
channel - The channel the message should be sent to.
message - The message :-)

quit

public void quit()
Quits the client program with disconnecting from server.

changeNick

public boolean changeNick(java.lang.String newNickname)
Changes the actual nickname. Returns true, if the nickname could be changed.
Parameters:
newNickname - The new nickname, what else?

getNickname

public java.lang.String getNickname()
gets the stored default nickname from swpOpions and returns it.

saveNickname

public void saveNickname(java.lang.String nickname)
stores nickname in properties.

saveServername

public void saveServername(java.lang.String servername)
stores servername in properties.

getServername

public java.lang.String getServername()
gets the stored default servername from swpOpions and returns it.

play

public boolean play(java.lang.String channel,
                    java.lang.String audiokey)

playReceivedAudioRequest

public boolean playReceivedAudioRequest(java.lang.String channel,
                                        java.lang.String sender,
                                        java.lang.String audio)
Plays an audio file.
Parameters:
channel - The actual channel.
sender - The sender of the play request.
audio - The audio key of the audio file to be played.

addAudioFile

public void addAudioFile(java.lang.String audioKey,
                         java.lang.String sound)
Adds an audio file to the properties.
Parameters:
audioKey - The audio key of the audio file to be added.
sound - The URL to the audio file.

removeAudioFile

public void removeAudioFile(java.lang.String audioKey)
Removes an audio file from the properties.
Parameters:
audioKey - The audio key to be removed.

getAudioEnumeration

public java.util.Enumeration getAudioEnumeration()
gets an enumeration of audio files from the AudioMapper and returns it.

sendFile

public boolean sendFile(java.io.File pictureFile,
                        java.util.Vector vecReceiver)
Sends a picture to the server.
Parameters:
actualChannel - The Channel the picture is sent to.
pictureFile - The File containing th picture.

showReceivedPicture

public boolean showReceivedPicture(java.io.File pictureFile)
Shows a received picture.
Parameters:
pictureFile - The received picture file.

join

public boolean join(java.lang.String channel)
Joins a channel. Returns true on success. Handles, if sender and receiver or only one shall be joined.
Parameters:
channel - The channel to be joined.

leave

public boolean leave(java.lang.String channel)
Leaves a channel. Returns true on success.
Parameters:
channel - The channel to be left.

createNewChannel

public boolean createNewChannel(java.lang.String name,
                                java.lang.String sendPasswd,
                                java.lang.String recvPasswd)
Creates a new channel. Returns true on success.
Parameters:
name - The name of the new channel.
sendPasswd - The password for restricted access for senders
recvPasswd - The password for restricted access for receivers

renameChannel

public boolean renameChannel(java.lang.String oldname,
                             java.lang.String newname)
Renames an existing channel. Returns true on success. But i think it's not used yet...maybe later...
Parameters:
oldname - The old channel name.
newname - The new channel name.

removeChannel

public boolean removeChannel(java.lang.String name)
Removes an existing channel. Returns true on success.
Parameters:
name - The name of the channel to be removed.

getAvailableChannelEnumeration

public java.util.Enumeration getAvailableChannelEnumeration()
gets an enumeration of available channels and returns it.

getSelectedChannelEnumeration

public java.util.Enumeration getSelectedChannelEnumeration()
gets an enumeration of selected channels and returns it.