client
Class WSIDOClientImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by client.WSIDOClientImpl
All Implemented Interfaces:
WSIDOClientInterface, java.io.Serializable, java.rmi.Remote

public class WSIDOClientImpl
extends java.rmi.server.UnicastRemoteObject
implements WSIDOClientInterface

realizes the callback functionality. Messages from other users are received here.

Since:
1.5
Version:
%I%, %G%
Author:
Karl Tschetschonig
See Also:
Serialized Form
Matrikelnummer:
0525983
Studienkennzahl:
033 526

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
WSIDOClientImpl()
          construction object for RemoteException and chatWindows Hashtable
 
Method Summary
 boolean acceptRequest(StandardUser user)
          callback function that determines if the receiving user wants to interact with the calling user.
 void addChatWindow(StandardUser user)
          creates a new chat window
 boolean receiveMessage(java.lang.String message, StandardUser user)
          receives a Message from the server Application. this method implements the callback functionality and is implemented by the server application
 void removeChatWindow(long userId)
          removes a chat window
 void setMainApp(WSIDOClientMain mainApp)
          allows to change the main application
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WSIDOClientImpl

public WSIDOClientImpl()
                throws java.rmi.RemoteException
construction object for RemoteException and chatWindows Hashtable

Throws:
java.rmi.RemoteException
Method Detail

receiveMessage

public boolean receiveMessage(java.lang.String message,
                              StandardUser user)
receives a Message from the server Application. this method implements the callback functionality and is implemented by the server application

Specified by:
receiveMessage in interface WSIDOClientInterface
Parameters:
message - including the actual message text
user - referencing to the user, who has send this message
Returns:
true if received message else false

acceptRequest

public boolean acceptRequest(StandardUser user)
callback function that determines if the receiving user wants to interact with the calling user.

Specified by:
acceptRequest in interface WSIDOClientInterface
Parameters:
user - referencing to the user, who wants to send a message
Returns:
answer from this user if he wants to chat

setMainApp

public void setMainApp(WSIDOClientMain mainApp)
allows to change the main application

Parameters:
mainApp - reference to the main Application

addChatWindow

public void addChatWindow(StandardUser user)
creates a new chat window

Parameters:
user - user who wants to chat

removeChatWindow

public void removeChatWindow(long userId)
removes a chat window

Parameters:
userId - user Id to select the chat window for removal